Skip to content
Connect an agent

Organisations

Rotate the signing key of a federated credential or a private key JWT

Makes a new RS256 key that signs from now on, and keeps the old public key published for a day.

POST/orgs/{org}/sso/connection/rotate-key

TL;DR

QuestionAnswer
What does it do?Rotate the signing key of a federated credential or a private key JWT.
What does it take?org in the path.
What does it return?Status 200 with a body of type SsoConnection.
What can go wrong?400 no connection, or one with a client secret, which has no key (sso.invalid); 401 not signed in; 403 a member or a reader (orgs.forbidden), a plan without single sign-on (plan.sso_not_included), or the request came from an origin that may not make changes; 404 no such organisation, or the caller is not a member of it; 429 too many requests; 503 single sign-on is not set up on this server (sso.unavailable), or organisations are not. Every failure uses the one error envelope.

What it does

Makes a new RS256 key that signs from now on, and keeps the old public key published for a day. A provider holding a pasted copy of the key needs the new one. Only for federated and private_key_jwt. The owner and admins.

Path parameters

FieldTypeRequiredDescription
orgstringyesThe organisation's id or its slug.

Responses

StatusMeaningBody
200The connection, with its new key.SsoConnection
400No connection, or one with a client secret, which has no key (sso.invalid).ErrorResponse
401Not signed in.ErrorResponse
403A member or a reader (orgs.forbidden), a plan without single sign-on (plan.sso_not_included), or the request came from an origin that may not make changes.ErrorResponse
404No such organisation, or the caller is not a member of it.ErrorResponse
429Too many requests.ErrorResponse
503Single sign-on is not set up on this server (sso.unavailable), or organisations are not.ErrorResponse

Response body

A 200 answer has the type SsoConnection.

FieldTypeRequiredDescription
protocol"oidc" | "saml"yesOpenID Connect or SAML 2.0. One connection, one protocol.
issuerstringyesThe OpenID Connect issuer, or the SAML provider's entity id.
clientIdstring | nullyesOpenID Connect only.
credential"client_secret" | "federated" | "private_key_jwt" | nullyesWhat the connection proves itself with at the token endpoint: a client secret, a Microsoft Entra ID federated credential, or a private key JWT. OpenID Connect only.
secretSetbooleanyesTrue when an OpenID Connect client secret is stored. It is never returned. False for the other credentials and for SAML.
tokenAuthMethod"client_secret_basic" | "client_secret_post" | "private_key_jwt" | nullyes
signingKeySsoSigningKeyyesThe connection's signing key, for federated and private_key_jwt; null otherwise.
signingKey.kidstringyes
signingKey.createdAtintegeryesWhen the key was made: the last rotation, or when the credential was chosen. Milliseconds since the epoch.
signingKey.publicJwkSsoPublicJwkyes
signingKey.publicJwk.kty"RSA"yes
signingKey.publicJwk.nstringyesThe modulus, base64url.
signingKey.publicJwk.estringyesThe public exponent, base64url.
signingKey.publicJwk.kidstringyesThe key id: the key's RFC 7638 thumbprint.
signingKey.publicJwk.alg"RS256"yes
signingKey.publicJwk.use"sig"yes
signingKey.publicKeyPemstringyesThe same public key as a PEM PUBLIC KEY, for a provider that takes a pasted key.
signingKey.previousKidstring | nullyesThe key a rotation replaced, while it is still published (a day), or null.
signingKey.previousExpiresAtinteger | nullyesWhen the previous key leaves the JWKS, or null.
warnings"private_key_jwt_not_listed"[]yesWhat the save noticed but did not refuse: private_key_jwt_not_listed when the provider's discovery document does not list private_key_jwt. Empty when read.
samlSamlConnectionyesSAML only.
saml.entityIdstringyesThe provider's entity id, which every Issuer must equal.
saml.ssoUrlstringyesThe provider's sign-in service on the redirect binding.
saml.certificatesobject[]yes
saml.certificates[].fingerprintstringyesSHA-256 of the certificate, as providers show it.
saml.certificates[].notAfterintegeryesWhen the certificate expires, in milliseconds since the epoch. Shown, not enforced.
saml.emailAttributestring | nullyesThe attribute that carries the address, or null when the name identifier does.
saml.metadataUrlstring | nullyesWhere the metadata was fetched from, or null when it was pasted.
enabledbooleanyes
requireSsobooleanyes
jitbooleanyes
jitRole"member" | "reader"yes
updatedAtintegeryes

See also

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