Skip to content
Connect an agent

Organisations

Replace the organisation's data key

Makes a new data key for the organisation, seals every connector's token again under it, and destroys the old key.

POST/orgs/{org}/connectors/rotate-key

TL;DR

QuestionAnswer
What does it do?Replace the organisation's data key.
What does it take?org in the path.
What does it return?Status 200 with a body of type OrgConnectors.
What can go wrong?401 not signed in; 403 not the owner or an admin, or the origin may not make changes; 404 no such organisation, the caller is not a member of it, or no connector for that provider; 409 a stored token can no longer be opened (connectors.token_unreadable); 429 too many requests; 503 this server cannot keep a token (connectors.unavailable). Every failure uses the one error envelope.

What it does

Makes a new data key for the organisation, seals every connector's token again under it, and destroys the old key.

Path parameters

FieldTypeRequiredDescription
orgstringyesThe organisation's id or its slug.

Responses

StatusMeaningBody
200The organisation's connectors now.OrgConnectors
401Not signed in.ErrorResponse
403Not the owner or an admin, or the origin may not make changes.ErrorResponse
404No such organisation, the caller is not a member of it, or no connector for that provider.ErrorResponse
409A stored token can no longer be opened (connectors.token_unreadable).ErrorResponse
429Too many requests.ErrorResponse
503This server cannot keep a token (connectors.unavailable).ErrorResponse

Response body

A 200 answer has the type OrgConnectors.

FieldTypeRequiredDescription
availablebooleanyesWhether the plan has connectors: Enterprise.
planstringyes
domainsstring[]yesThe domains the organisation verified, which a From address must be on.
emailOrgEmailConnector[]yesThe email connectors, at most one a provider: the default first, then in the order they were added.
email[].provider"resend" | "sendgrid" | "postmark" | "mailgun" | "brevo"yes
email[].fromEmailstringyes
email[].fromNamestring | nullyes
email[].replyTostring | nullyes
email[].region"us" | "eu" | nullyesMailgun's region; null for every other provider.
email[].tokenLast4stringyesThe last four characters of the token. The token itself is never answered.
email[].enabledbooleanyes
email[].isDefaultbooleanyesWhether it is the default, the connector tried first. At most one is.
email[].testedAtinteger | nullyes
email[].lastErrorstring | nullyesWhy the last email through it failed, in our words, or null.
email[].lastErrorAtinteger | nullyes
email[].keyVersionintegeryesThe version of the organisation's data key the token is sealed with.
email[].updatedAtintegeryes
defaultProvider"resend" | "sendgrid" | "postmark" | "mailgun" | "brevo" | nullyesThe provider tried first, or null when there is no connector.

See also

DocWhy
API referenceEvery endpoint, and the error envelope
SchemasEvery request and response type
Tool referenceThe operations as callable tools