Rename a connection, or make it your main
const url = 'https://example.com/v1/connections/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"main":true,"label":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://example.com/v1/connections/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "main": true, "label": "example" }'One change. label renames it, the name people know it by: whoever may disconnect it, its owner or a tenant admin. main: true makes it its owner’s main connection of its app through its registration and env, in place of the one that was, audited as connection-main-set: its owner alone, and only a person’s. Making the main main again answers it as it is. A main never moves a mail trigger’s stored connection. Anyone else gets the 404 of a connection that doesn’t exist. A key or session limited to a project is refused, 403 permission-denied: a connection reaches every project.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”One change: label renames it, main: true makes it your main.
object
Examplegenerated
{ "main": true, "label": "example"}Responses
Section titled “Responses”The connection, renamed or made main.
One owner’s account at an app, through a registration, in one env. Never its token.
object
Example
{ "owner": { "kind": "member" }, "state": "working", "removedReason": "disconnected", "withdrawn": "at-app"}connectionId is not a UUID, or a malformed body, unknown field, both label and main, or a label that isn’t 1 to 100 characters with no control, format or invisible characters (such as bidi overrides, zero-width characters or line separators) (bad-input, details.field). With main (details.field main): false, since a main moves only by making another connection main; the company’s connection, which has no main; or a caller who isn’t its owner, a tenant admin too.
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" }}A key or session limited to a project (permission-denied).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}No connection with that id, it was disconnected, or it’s not the caller’s (connection-not-found).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Idempotency-Key was reused with a different body; or another live connection of the same app, owner and env has that label, ignoring case, an emoji’s variation selector and how accented letters are encoded (connection-label-taken, details.field label). 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 rename couldn’t be stored just now (connection-store-failed), or the Idempotency-Key store couldn’t be read before the request ran (idempotency-store-unavailable, with Retry-After). Or the authorization store couldn’t be reached (authz-backend-unavailable, with Retry-After), or the database was too busy for the authorization check (database-busy, with Retry-After), so the request wasn’t run. 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/connections/{connectionId}: Fetch a connectionDELETE /v1/connections/{connectionId}: DisconnectGET /v1/connections/{connectionId}/choices: List a connection's choices- Choose a connection
- How connections work
- Kindgi 0.5.0
- Error code
authz-backend-unavailable - Error code
bad-input - Error code
connection-label-taken - Error code
connection-not-found - Error code
connection-store-failed - Error code
database-busy - Error code
idempotency-key-in-flight - Error code
idempotency-store-unavailable - Error code
permission-denied - Error code
rate-limit-exceeded - Error code
request-too-large - Error code
tenant-state-unavailable - Every error code