Skip to content
Connect an agent
Organisations

Add an email domain

Adds a domain and answers the TXT record to publish at _plotwork-verify.<domain>.

POST/orgs/{org}/sso/domains

TL;DR

QuestionAnswer
What does it do?Add an email domain.
What does it take?A JSON body of type SsoDomainBody.
What does it return?Status 201 with a body of type SsoDomain.
What can go wrong?400 the body is not valid; 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; 409 another organisation verified this domain (sso.domain_taken); 422 not a domain a provider can be proved for (sso.domain_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

Adds a domain and answers the TXT record to publish at _plotwork-verify.<domain>. It counts once verified. Public mail domains are refused; at most 20; one another organisation verified is 409 sso.domain_taken.

Path parameters

FieldTypeRequiredDescription
orgstringyesThe organisation's id or its slug.

Request body

The body has the type SsoDomainBody.

FieldTypeRequiredDescription
domainstringyesat least 3 characters; at most 253 characters.

Responses

StatusMeaningBody
201The domain and its record.SsoDomain
400The body is not valid.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
409Another organisation verified this domain (sso.domain_taken).ErrorResponse
422Not a domain a provider can be proved for (sso.domain_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 201 answer has the type SsoDomain.

FieldTypeRequiredDescription
idstringyes
domainstringyes
verifiedbooleanyes
verifiedAtinteger | nullyes
checkedAtinteger | nullyes
createdAtintegeryes
recordobjectyes
record.namestringyes
record.type"TXT"yes
record.valuestringyes

See also

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