Skip to content
GitHubLog inStart free
cetra is not released yet. These docs describe the development version.

Save the org's SAML identity provider

PUT
/api/v1/orgs/{org}/sso/saml
curl --request PUT \
--url http://localhost:8080/api/v1/orgs/example/sso/saml \
--header 'Content-Type: application/json' \
--cookie cetra_session=<cetra_session> \
--data '{ "attributes": { "display_name": "example", "email": "example", "first_name": "example", "last_name": "example" }, "certificates": [ "example" ], "confirm_entity_id_change": true, "display_name": "example", "idp_entity_id": "example", "jit_role": "viewer", "metadata_url": "example", "metadata_xml": "example", "sso_url": "example" }'

Creates or updates the org’s one SAML provider (D-SA-17, D-SA-18). Give exactly one source: metadata_url (an https URL, fetched now and refreshed daily), metadata_xml (pasted), or idp_entity_id, sso_url and certificates together. With none of them, only the SAML settings are saved. Changing the IdP entity ID needs confirm_entity_id_change: true and deletes the org’s identities. The server’s public URL must be https (D-SA-19). Needs the org SSO and SAML features (D-P-61). Owners only, session only (D-P-51).

org
required
string

Org UUID or slug.

Media typeapplication/json

PUT /api/v1/orgs/{org}/sso/saml (D-SA-18). Exactly one source: metadata_url, metadata_xml, or idp_entity_id + sso_url + certificates. With none of them, only the settings of the org’s SAML provider are saved. Debug omits the metadata and the fields.

object
attributes

Attribute names; an absent field uses the default.

object
display_name

The attribute that carries the display name.

string
email

The attribute that carries the email address.

string
first_name

The attribute that carries the first name.

string
last_name

The attribute that carries the last name.

string
certificates

PEM certificates of the IdP’s signing keys, with idp_entity_id and sso_url.

Array<string>
confirm_entity_id_change

Needed to change the IdP entity ID, which deletes the linked identities.

boolean
display_name
required

Shown on the login page; 1 to 100 characters.

string
idp_entity_id

The IdP’s entity ID, with sso_url and certificates.

string
jit_role
required

Role of people who join through the provider.

string
Allowed values: viewer member
metadata_url

An https metadata URL, fetched now and refreshed daily.

string
metadata_xml

The IdP metadata document, pasted.

string
sso_url

The IdP’s HTTP-Redirect sign-on URL, with idp_entity_id and certificates.

string

The saved SSO settings.

Media typeapplication/json

GET /api/v1/orgs/{org}/sso and every settings write.

object
callback_url
required

The redirect URI to register at the identity provider.

string
domains
required

Ordered by domain.

Array<object>

One email domain of the org and how to prove it.

object
created_at
required

Creation time.

string format: date-time
domain
required

Lowercase domain name.

string
id
required

The domain row id.

string format: uuid
last_checked_at

Last lookup, found or not. Omitted before the first one.

string format: date-time
status
required

Pending or verified.

string
Allowed values: pending verified
txt_name
required

TXT record name, _cetra-verify.<domain>.

string
txt_value
required

TXT record value, cetra-verify=<token>.

string
verified_at

When the TXT record was found. Omitted while pending.

string format: date-time
provider

The provider, when the org has one.

object
client_id

The OAuth client id. Set for an OIDC provider only.

string
created_at
required

Creation time.

string format: date-time
display_name
required

Shown on the login page.

string
enabled
required

Discovery sends users to this provider (D-P-57).

boolean
enforced
required

Password and other sign-ins are refused for the org’s domains (D-P-58).

boolean
issuer

The OIDC issuer URL. Set for an OIDC provider only.

string
jit_role
required

Role of people who join through the provider.

string
Allowed values: viewer member
last_login_at

The last successful sign-in through the provider. Absent before the first one.

string format: date-time
protocol
required

OpenID Connect or SAML. The OIDC fields are set for an OIDC provider, saml for a SAML one.

string
Allowed values: oidc saml
saml

The SAML settings. Set for a SAML provider only.

object
attributes
required

The attribute names the owner set. An absent field uses the default.

object
display_name

The attribute that carries the display name.

string
email

The attribute that carries the email address.

string
first_name

The attribute that carries the first name.

string
last_name

The attribute that carries the last name.

string
certificates
required

The trusted IdP signing certificates.

Array<object>

A trusted IdP signing certificate, shown by hash and validity (D-SA-11).

object
not_after
required

End of validity.

string format: date-time
not_before
required

Start of validity.

string format: date-time
sha256
required

The hex SHA-256 of the certificate’s DER encoding.

string
certificates_changed_at

When the set of certificates last changed. Omitted before the first change.

string format: date-time
idp_entity_id
required

The IdP’s entity ID (the Issuer of its responses).

string
metadata_url

The metadata URL, when the metadata was fetched from one.

string
refresh_error

Why the last scheduled refresh failed.

string
Allowed values: fetch_failed status too_large denied unusable entity_id_changed
refreshed_at

When the metadata was last fetched. Omitted for pasted metadata or manual fields.

string format: date-time
sso_url
required

The IdP’s HTTP-Redirect sign-on URL.

string
updated_at
required

Last change to the settings.

string format: date-time
saml_sp
required

The values for the org’s SAML provider (D-SA-12). The same for every protocol.

object
acs_url
required

The assertion consumer service URL.

string
entity_id
required

The SP entity ID.

string
start_url
required

Starts a login; also the IdP’s tile URL.

string

Example

{
"domains": [
{
"status": "pending"
}
],
"provider": {
"jit_role": "viewer",
"protocol": "oidc",
"saml": {
"refresh_error": "fetch_failed"
}
}
}

The request is malformed or a filter is invalid.

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}

No credentials, or the credentials are invalid.

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}

The credentials do not allow this operation, or the organization’s plan does not include it (code plan_required).

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}

The resource does not exist.

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}

The request conflicts with the current state.

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}

Too many requests.

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}