Skip to content
Suomi

Set the organisation's single sign-on and its e-mail domains

PUT
/v1/organisation/sso
Code sample: Shell / cURL
curl --request PUT \
--url https://api.whatsbuilt.fi/v1/organisation/sso \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "provider": "saml", "ssoDomains": [ "example" ], "defaultRole": "admin", "ssoUrl": "https://example.com", "entityId": "example", "certificate": "example", "metadataUrl": "https://example.com", "metadataXml": "example" }'

SAML only: an OIDC configuration answers 400 SSO_OIDC_UNSUPPORTED and changes nothing, because sign-in runs on Cognito, which gets no OIDC identity provider. A domain another organisation signs in with answers 409. People of the domains sign in through the identity provider from then on.

Media typeapplication/json

The body of an SSO configuration, SsoConfigBody.

One of:

SAML.

object
provider
required

The SAML discriminator.

string
Allowed values: saml
ssoDomains
required
Array<string>
>= 1 items <= 20 items
defaultRole

The role new users of the domains get.

string
Allowed values: admin inspector viewer
ssoUrl
string format: uri
entityId
string
>= 1 characters
certificate
string
metadataUrl
string format: uri
metadataXml
string

SSO

Media typeapplication/json

SsoSettings: the organisation’s single sign-on.

object
provider
required
string | null
domains
required
Array<string>
default_role
required
string | null
config
required

Secrets are replaced by has_* markers

object | null
service_provider
required

What the service provider side of SAML looks like to the identity provider.

object
acs_url
required
string
entity_id
required
string
login_url
required
string
attribute_mapping
required
object
key
additional properties
string
is_placeholder
required
boolean

Example generated

{
"provider": "example",
"domains": [
"example"
],
"default_role": "example",
"config": "example",
"service_provider": {
"acs_url": "example",
"entity_id": "example",
"login_url": "example",
"attribute_mapping": {
"additionalProperty": "example"
},
"is_placeholder": true
}
}

Invalid body; SSO_OIDC_UNSUPPORTED: OIDC single sign-on is not available

Media typeapplication/json

The error body of every /v1 answer of 400 or more.

object
error
required

A sentence for people; it may change

string
code
required

Part of the contract

string
details

What the code names, where it names something

request_id
required

The X-Request-Id of the call

string

Example generated

{
"error": "example",
"code": "example",
"details": "example",
"request_id": "example"
}

Missing, malformed, expired or revoked token

Media typeapplication/json

The error body of every /v1 answer of 400 or more.

object
error
required

A sentence for people; it may change

string
code
required

Part of the contract

string
details

What the code names, where it names something

request_id
required

The X-Request-Id of the call

string

Example generated

{
"error": "example",
"code": "example",
"details": "example",
"request_id": "example"
}

INSUFFICIENT_SCOPE; INSUFFICIENT_ROLE when the principal is not an admin of its organisation; PUBLIC_API_DISABLED

Media typeapplication/json

The error body of every /v1 answer of 400 or more.

object
error
required

A sentence for people; it may change

string
code
required

Part of the contract

string
details

What the code names, where it names something

request_id
required

The X-Request-Id of the call

string

Example generated

{
"error": "example",
"code": "example",
"details": "example",
"request_id": "example"
}

Not found in the organisation

Media typeapplication/json

The error body of every /v1 answer of 400 or more.

object
error
required

A sentence for people; it may change

string
code
required

Part of the contract

string
details

What the code names, where it names something

request_id
required

The X-Request-Id of the call

string

Example generated

{
"error": "example",
"code": "example",
"details": "example",
"request_id": "example"
}

SSO_DOMAIN_TAKEN: a domain belongs to another organisation; SSO_IDP_NAME_TAKEN: the identity provider name belongs to another organisation

Media typeapplication/json

The error body of every /v1 answer of 400 or more.

object
error
required

A sentence for people; it may change

string
code
required

Part of the contract

string
details

What the code names, where it names something

request_id
required

The X-Request-Id of the call

string

Example generated

{
"error": "example",
"code": "example",
"details": "example",
"request_id": "example"
}

RATE_LIMITED; wait for Retry-After seconds

Media typeapplication/json

The error body of every /v1 answer of 400 or more.

object
error
required

A sentence for people; it may change

string
code
required

Part of the contract

string
details

What the code names, where it names something

request_id
required

The X-Request-Id of the call

string

Example generated

{
"error": "example",
"code": "example",
"details": "example",
"request_id": "example"
}

The identity provider could not be reached

Media typeapplication/json

The error body of every /v1 answer of 400 or more.

object
error
required

A sentence for people; it may change

string
code
required

Part of the contract

string
details

What the code names, where it names something

request_id
required

The X-Request-Id of the call

string

Example generated

{
"error": "example",
"code": "example",
"details": "example",
"request_id": "example"
}