Skip to content
Connect an agent
Organisations

Set up a SAML identity provider

Reads the provider's metadata from its HTTPS address or pasted XML and stores the entity id, the sign-in service and the signing certificates.

PUT/orgs/{org}/sso/saml

TL;DR

QuestionAnswer
What does it do?Set up a SAML identity provider.
What does it take?A JSON body of type SamlConnectionBody.
What does it return?Status 200 with a body of type SsoConnection.
What can go wrong?400 the body is not valid, or no metadata the first time (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; 422 the metadata cannot be fetched or used (sso.metadata_invalid); 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

Reads the provider's metadata from its HTTPS address or pasted XML and stores the entity id, the sign-in service and the signing certificates. emailAttribute names the attribute with the address; null reads the name identifier. A new connection is off until it is turned on. Enterprise; the owner and admins.

Path parameters

FieldTypeRequiredDescription
orgstringyesThe organisation's id or its slug.

Request body

The body has the type SamlConnectionBody.

FieldTypeRequiredDescription
metadataUrlstringnoThe address of the provider's metadata, fetched over HTTPS. Give this or metadataXml, or neither to keep the stored metadata. at least 9 characters; at most 500 characters.
metadataXmlstringnoThe provider's metadata XML, pasted. at least 1 character; at most 262144 characters.
emailAttributestring | nullnoThe attribute that carries the address. Null reads the name identifier; left out keeps the stored choice. at least 1 character; at most 200 characters.

Responses

StatusMeaningBody
200The connection.SsoConnection
400The body is not valid, or no metadata the first time (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
422The metadata cannot be fetched or used (sso.metadata_invalid).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.
secretSetbooleanyesTrue when an OpenID Connect client secret is stored. It is never returned. Always false for SAML.
tokenAuthMethod"client_secret_basic" | "client_secret_post" | nullyes
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