Register an app
const url = 'https://example.com/v1/connection-apps';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"app":"example","label":"example","oauth2":{"clientId":"example","clientSecret":{"envName":"example","name":"example"},"tenant":"example"},"githubApp":{"appNumber":1,"slug":"example","clientId":"example","clientSecret":{"envName":"example","name":"example"},"privateKey":{"envName":"example","name":"example"},"webhookSecret":{"envName":"example","name":"example"}},"token":{"provider":"telnyx","apiKey":{"envName":"example","name":"example"},"publicKey":"example"},"projects":["example"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/v1/connection-apps \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "app": "example", "label": "example", "oauth2": { "clientId": "example", "clientSecret": { "envName": "example", "name": "example" }, "tenant": "example" }, "githubApp": { "appNumber": 1, "slug": "example", "clientId": "example", "clientSecret": { "envName": "example", "name": "example" }, "privateKey": { "envName": "example", "name": "example" }, "webhookSecret": { "envName": "example", "name": "example" } }, "token": { "provider": "telnyx", "apiKey": { "envName": "example", "name": "example" }, "publicKey": "example" }, "projects": [ "example" ] }'Registers the workspace’s own client at an app, or, for an app whose sign-in is an account’s credential (texts), the provider account (token). Store its secrets first; the registration references them by name. The response gives the redirectUrl and noticesUrl to enter at the app. An app that signs in through Kindgi’s own app (signIn.kind kindgi-app) isn’t registered here: the server makes its registration itself (via: 'kindgi'), and refuses one here (connection-app-invalid, details.field app). Tenant admins only.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Caller-supplied idempotency key, scoped to the caller: the same key from someone else in the workspace is their own request (from 0.1.5). Retries with the same key return the original response byte-identical (per docs/API-ROUTE-CONVENTIONS.md §3.1). A retry sent while the first request still runs is answered 409 idempotency-key-in-flight with Retry-After, on a runtime whose store holds keys (from 0.1.5); retry after it, and you get the first request’s answer. An answer that carries a secret (a new API key or public run token, a session token, a generated signing secret) isn’t kept: a retry gets 409 idempotency-key-replay-withheld, with the first request’s status and when it succeeded (from 0.1.5). A request whose key store can’t be read before it runs is answered 503 idempotency-store-unavailable with Retry-After: nothing ran, so retry with the same key (from 0.3.0).
Request Bodyrequired
Section titled “Request Bodyrequired”Give oauth2 for an app that signs in with OAuth, githubApp for a GitHub App, token for an app whose sign-in is an account’s credential (texts). An app that signs in through Kindgi’s own app (signIn.kind kindgi-app) isn’t registered here: the server makes that registration itself.
object
The app’s entry id.
object
A secret by name in the deployment’s secrets store, resolved at tenant scope. The registration keeps only this reference, never the value.
object
The directory the app signs people in at, for an app whose sign-in names one: Microsoft’s tenant id or domain for a single-tenant app, organizations, common or consumers for a multi-tenant one. Required when the app’s entry has no default, refused for an app without one (connection-app-invalid, details.field oauth2.tenant).
object
The app’s slug.
A secret by name in the deployment’s secrets store, resolved at tenant scope. The registration keeps only this reference, never the value.
object
A secret by name in the deployment’s secrets store, resolved at tenant scope. The registration keeps only this reference, never the value.
object
A secret by name in the deployment’s secrets store, resolved at tenant scope. The registration keeps only this reference, never the value.
object
A texts registration’s provider account: its API key, by reference, and the key its texts are signed with.
object
One of the entry’s signIn.providers.
The provider account’s API key. Not a reserved kindgi. name, not a model provider’s key, not an identity provider’s secret (400 identity-provider-key-refused), and not a secret a tool, an MCP endpoint, a webhook endpoint, a webhook trigger, a destination or another connection app registration uses (409 connection-key-in-use). Only this registration names it: a tool, an endpoint, a webhook trigger, a destination, a model provider or another registration that names it is refused (400 connection-key-refused).
object
The account’s Ed25519 public key, base64 of its 32 bytes, as the provider shows it. Anything else is 400 bad-input (token.publicKey).
The projects whose runs may use its connections. Leave out for every project.
Responses
Section titled “Responses”App registered.
A workspace’s registration of an app: its own client there, or Kindgi’s own app (via). Secrets are references, never values.
object
The app’s entry id.
kindgi: the app connects through Kindgi’s own app (its entry’s signIn.kind is kindgi-app). The server makes this registration itself, with no oauth2 or githubApp. Absent: the workspace’s own client.
object
A secret by name in the deployment’s secrets store, resolved at tenant scope. The registration keeps only this reference, never the value.
object
The directory the app signs people in at, for an app whose sign-in names one: Microsoft’s tenant id or domain for a single-tenant app, organizations, common or consumers for a multi-tenant one. Required when the app’s entry has no default, refused for an app without one (connection-app-invalid, details.field oauth2.tenant).
object
The app’s slug.
A secret by name in the deployment’s secrets store, resolved at tenant scope. The registration keeps only this reference, never the value.
object
A secret by name in the deployment’s secrets store, resolved at tenant scope. The registration keeps only this reference, never the value.
object
A secret by name in the deployment’s secrets store, resolved at tenant scope. The registration keeps only this reference, never the value.
object
A texts registration’s provider account: its API key, by reference, and the key its texts are signed with.
object
One of the entry’s signIn.providers.
The provider account’s API key. Not a reserved kindgi. name, not a model provider’s key, not an identity provider’s secret (400 identity-provider-key-refused), and not a secret a tool, an MCP endpoint, a webhook endpoint, a webhook trigger, a destination or another connection app registration uses (409 connection-key-in-use). Only this registration names it: a tool, an endpoint, a webhook trigger, a destination, a model provider or another registration that names it is refused (400 connection-key-refused).
object
The account’s Ed25519 public key, base64 of its 32 bytes, as the provider shows it. Anything else is 400 bad-input (token.publicKey).
The projects whose runs may use its connections. Absent: every project.
Give this to the app as its redirect URL: a GitHub App’s Callback URL, with “Request user authorization (OAuth) during installation” ticked. Nothing to give anyone for a registration via: 'kindgi'.
Give this to the app as the place it reports removals. Nothing to give anyone for a registration via: 'kindgi'.
Example
{ "via": "kindgi", "token": { "provider": "telnyx" }}Malformed body or unknown field, including a token.provider the server doesn’t serve or a token.publicKey that isn’t base64 of 32 bytes (bad-input, details.field); a registration that doesn’t fit its entry, or that would serve a project another registration of the app serves (connection-app-invalid, details.field); no such app (connection-app-unknown-entry); a model provider’s key named as a secret (provider-key-refused); or a secret under the reserved kindgi. prefix (reserved-name-prefix). Or connection-key-refused: a secret it names is the account key of a texts connection app registration (details.secret, details.appId), which only that registration names. Use a key of its own: a new API key from the provider, stored under its own name. A copy of this one under another name reaches the same account. Or identity-provider-key-refused: a secret it names is an identity provider’s secret, an OIDC client secret or a SAML signing or decryption key (details.secret, details.identityProviderId), which only sign-in names. If one app registration serves both, give it a second secret of its own (a second client secret), store that under its own name and use that name.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Missing / malformed / expired / revoked bearer token.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Not a tenant admin (permission-denied). Without an authorization store, a tenant admin is the deployment’s API token, an admin key, or a console signed in with either.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Idempotency-Key was reused with a different body, or resource-state conflict. Or connection-key-in-use: token.apiKey names a secret that a tool (its current version), an MCP endpoint, a webhook endpoint, a webhook trigger, a destination or another connection app registration uses; details.secret names it and details.usedBy lists each (kind, id, a tool’s version). A texts registration’s key is used by its registration only: give the registration a new API key from the provider, stored under a name of its own. If the secret holds this account’s key, what uses it already reaches the whole account: rotate it at the provider. Nothing is stored. Or env-not-served: this runtime keeps every value under the env it serves (whoami’s servedEnv, with refusesOtherEnvs), and the secret reference names another. Name it under details.servedEnv. Nothing is stored. Or idempotency-key-in-flight (with Retry-After): a request with the same Idempotency-Key still runs, so this one wasn’t run; send it again after Retry-After to get that request’s answer.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”Whole seconds to wait before sending the request again, at least 1. Sent with the codes the answer names as sending it, so it may be absent.
The request body is over the API’s limit (request-too-large; details.maxBytes says how much).
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}rate-limit-exceeded with details.limit: "api-requests", on a runtime that sets workspace limits (Kindgi Cloud): this workspace’s limit on API requests a minute is reached, so the request wasn’t run; Retry-After says when to send it again.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”Whole seconds to wait before sending the request again, at least 1. Sent with the codes the answer names as sending it, so it may be absent.
Server error (unmapped domain code or framework crash).
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}The Idempotency-Key store (idempotency-store-unavailable) or the authorization store (authz-backend-unavailable) couldn’t be reached before the request ran, or the database was too busy for its authorization check (database-busy), so nothing was changed; Retry-After (whole seconds) says when to try again with the same key. Or tenant-state-unavailable (with Retry-After), on a runtime serving many workspaces: the workspace’s state couldn’t be read, so nothing was changed.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”Whole seconds to wait before sending the request again, at least 1. Sent with the codes the answer names as sending it, so it may be absent.
See also
GET /v1/connection-apps: List the workspace's app registrations- Error code
authz-backend-unavailable - Error code
bad-input - Error code
connection-app-invalid - Error code
connection-app-unknown-entry - Error code
connection-key-in-use - Error code
connection-key-refused - Error code
database-busy - Error code
env-not-served - Error code
idempotency-key-in-flight - Error code
idempotency-store-unavailable - Error code
identity-provider-key-refused - Error code
permission-denied - Error code
provider-key-refused - Error code
rate-limit-exceeded - Error code
request-too-large - Error code
reserved-name-prefix - Error code
tenant-state-unavailable - Every error code