Make a destination
const url = 'https://example.com/v1/destinations';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","kind":"email","people":["2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"],"url":"https://example.com","urlRef":{"envName":"example","name":"example"},"secretRef":{"envName":"example","name":"example"},"projects":["2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"],"content":"link"}'};
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/destinations \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "kind": "email", "people": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ], "url": "https://example.com", "urlRef": { "envName": "example", "name": "example" }, "secretRef": { "envName": "example", "name": "example" }, "projects": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ], "content": "link" }'Makes a named place outside Kindgi that schedules send their results to: a Slack, Teams, Google Chat or Discord channel’s incoming webhook, a signed webhook, or workspace members’ email. A chat webhook URL lets anyone who has it post to that channel, so url is write-only: the runtime keeps it in its secrets store, and the API shows only its host. Or name a secret you stored with urlRef. A webhook destination signs its requests as webhook endpoints do, with the secret secretRef names. content: "answer" sends the run’s answer too, up to its first 1,000 characters: it needs projects, and the webhook kind never takes it.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”url or urlRef on every kind but email, which takes people; secretRef on webhook only.
object
Responses
Section titled “Responses”Destination made.
Where a schedule sends its results. Its URL is never returned: host and urlRef say where it goes. GET /v1/destinations?projectId= answers a caller who is not a workspace admin without people, host, urlRef, secretRef and projects.
object
Example
{ "kind": "email", "content": "link", "status": "active"}Malformed body, unknown field (unknown-field), or fields that don’t fit the kind (bad-input); the deployment lacks what the kind needs (bad-input, details.setting); a person in people is no member of the workspace (bad-input, details.userId); the URL is refused (destination-url-refused); a secret urlRef or secretRef names does not exist (destination-secret-not-found), the signing secret is too weak (destination-secret-too-weak), it’s a model provider’s key (provider-key-refused), or it’s 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
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Missing / malformed / expired / revoked bearer token.
object
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
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}A project in projects does not exist (project-not-found).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Idempotency-Key was reused with a different body, or resource-state conflict. 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
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”The request body is over the API’s limit (request-too-large; details.maxBytes says how much).
object
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
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”Server error (unmapped domain code or framework crash).
object
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
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”See also
GET /v1/destinations: List destinations- Send results to a destination
- Error code
authz-backend-unavailable - Error code
bad-input - Error code
connection-key-refused - Error code
database-busy - Error code
destination-secret-not-found - Error code
destination-secret-too-weak - Error code
destination-url-refused - 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
project-not-found - 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 - Error code
unknown-field - Every error code