Skip to content

Register a custom domain

POST
/organizations/{orgId}/catalog/domains
curl --request POST \
--url https://api.modeldesk.io/organizations/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/catalog/domains \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "domain": "begrippen.example.nl" }'

Registers a host the organization owns, PENDING_DNS, with a fresh verification token. The answer names the TXT record to publish (verificationRecordName, a label _modeldesk under the domain, so it survives the CNAME the domain gets later) and what it has to read (verificationRecordValue). The host is a lowercase name of at least three labels, without scheme, user name, port, path, query or fragment; a host the platform answers on or an IP address is refused as 422 on the field domain. Several organizations may register one host; the first whose TXT record is found claims it. A host another organization has claimed is refused with This domain cannot be registered., which does not say who holds it. The certificate source is PLATFORM: the edge’s managed certificate, issued when the domain is bound. Requires an administrator of the organization.

orgId
required
string format: uuid
Media typeapplication/json
object
domain
required

The host only, a subdomain the organization owns: at least three labels, no scheme, user name, port, path, query or fragment. Stored in lowercase.

string

Example

begrippen.example.nl

Registered, pending its DNS record.

Media typeapplication/json
object
id
required
string format: uuid
domain
required

The lowercase host.

string
status
required

Where a domain is in its lifecycle. PENDING_DNS until the verification record is found (re-check), VERIFIED until ops bind the host at the edge and activate it, ACTIVE while it serves, INACTIVE once ops, the organization, a lapsed subscription or an erasure took it out of service. An INACTIVE domain whose record is still in DNS can be re-checked to VERIFIED and activated again.

string
Allowed values: PENDING_DNS VERIFIED ACTIVE INACTIVE
isPrimary
required

Whether this is the organization’s primary domain. Only meaningful while ACTIVE: the effective hosting takes the active domain marked primary, else the oldest active one.

boolean
verificationToken
required

The random token the verification record carries.

string
verificationRecordName
required

The owner of the TXT record to publish, _modeldesk.{domain}.

string
verificationRecordValue
required

What the TXT record has to read, modeldesk-verify={verificationToken}.

string
createdAt
required
string format: date-time
certificateSource
required

Who issues the domain’s TLS certificate. PLATFORM is the edge’s managed certificate, the only source available; CUSTOMER is reserved for an uploaded certificate and cannot be chosen yet.

string
Allowed values: PLATFORM CUSTOMER
certificateThumbprint

Set once a certificate is bound; absent until then.

string
certificateExpiresAt

Set once a certificate is bound; absent until then.

string format: date-time

Example

{
"status": "PENDING_DNS",
"verificationRecordName": "_modeldesk.begrippen.example.nl",
"certificateSource": "PLATFORM"
}

The caller is not an administrator of the organization.

No such organization.

The host cannot be a custom domain, another organization claimed it, or this one has it already; the violation names the field.

Media typeapplication/problem+json

An RFC 9457 problem document, always sent as application/problem+json.

object
type

Present only on a typed refusal, whose own schema requires it and fixes its value. An untyped problem omits it, which RFC 9457 defines as about:blank: the status and title are all there is to branch on.

string format: uri
title
required
string
status
required
integer
detail
required
string
instance

The path of the request that was refused. Absent when the request was refused before it reached the application’s handlers: a 401 for a missing or unusable access token, and a 403 for a service account whose scopes do not reach the route.

string
violations

Present on a 400 raised by request-body validation, and on a 422 that refuses named fields (a malformed slug or namespace prefix). Each entry names the rejected property, so a client can attach the message to the field that caused it rather than showing one error for the whole form.

Array<object>
object
property
required
string
message
required
string

Example generated

{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example",
"violations": [
{
"property": "example",
"message": "example"
}
]
}

Error

Media typeapplication/problem+json

An RFC 9457 problem document, always sent as application/problem+json.

object
type

Present only on a typed refusal, whose own schema requires it and fixes its value. An untyped problem omits it, which RFC 9457 defines as about:blank: the status and title are all there is to branch on.

string format: uri
title
required
string
status
required
integer
detail
required
string
instance

The path of the request that was refused. Absent when the request was refused before it reached the application’s handlers: a 401 for a missing or unusable access token, and a 403 for a service account whose scopes do not reach the route.

string
violations

Present on a 400 raised by request-body validation, and on a 422 that refuses named fields (a malformed slug or namespace prefix). Each entry names the rejected property, so a client can attach the message to the field that caused it rather than showing one error for the whole form.

Array<object>
object
property
required
string
message
required
string

Example generated

{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example",
"violations": [
{
"property": "example",
"message": "example"
}
]
}