Skip to content
sproutboatDocs
Esc
↑↓navigate↵open⌘Jpreview

Claim a custom domain

Starts the proof for one exact hostname (no wildcards; lowercase, no trailing dot). The answer carries txt, the DNS record to publish: name _sproutboat-challenge.<host>, type TXT, the given value. Then call POST /v1/domains/{host}/verify. Claiming a host you already claimed returns the claim (200). A team holds at most 10 domains (429 domain-limit). Names under sproutboat.app and the platform’s own hostnames cannot be claimed. Once verified, add the hostname to an app’s routes (PATCH /v1/apps/{project}/routes); a certificate is then issued on first use.

POST/v1/domains
Authorization
AuthorizationBearer token · headerrequired

A team API key, sbk_..., from Settings, API keys.

or
x-api-keyAPI key · headerrequired

The same key, in a header of its own.

Request body
requiredapplication/json
hoststringrequired
Responses
200

The existing claim.

hoststring
statestring
Allowed:pendingverifiedlost
methodstring
Allowed:txtoperator
verified_atstring<date-time> | null
last_checked_atstring<date-time> | null
lost_atstring<date-time> | null
lost_reasonstring | null
created_atstring<date-time>
txtobject | null

The DNS record to publish while the claim is pending (and after a loss, to take the name back). Null once verified.

Show properties
typestring
namestring
valuestring
routesobject[]

The team's apps that route this host.

Show properties
Array of object
projectstring
keystring
201

A new pending claim.

hoststring
statestring
Allowed:pendingverifiedlost
methodstring
Allowed:txtoperator
verified_atstring<date-time> | null
last_checked_atstring<date-time> | null
lost_atstring<date-time> | null
lost_reasonstring | null
created_atstring<date-time>
txtobject | null

The DNS record to publish while the claim is pending (and after a loss, to take the name back). Null once verified.

Show properties
typestring
namestring
valuestring
routesobject[]

The team's apps that route this host.

Show properties
Array of object
projectstring
keystring
400

The hostname cannot be claimed (reason: invalid-host), or the body is malformed.

One of:
ErrorInvalidHost
errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:invalid-host
ErrorPlain
errorstringrequired

A message for people. Do not parse it.

reasonstring

A stable, machine-readable cause, when there is one.

pathstring

The request field at fault.

needstring

The grant a 403 asks for, app:write for example.

retry_after_sinteger
401

No key, or an invalid, expired or revoked key (unknown or missing API token, invalid, expired or revoked API key). No reason.

errorstringrequired

A message for people. Do not parse it.

reasonstring

A stable, machine-readable cause, when there is one.

pathstring

The request field at fault.

needstring

The grant a 403 asks for, app:write for example.

retry_after_sinteger
403

The key lacks a grant (reason: forbidden, need: "<resource>:<action>").

errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:forbidden
needstringrequired

The grant, as <resource>:<action>, for example app:write.

409

Another team holds the name, verified (reason: host-claimed).

errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:host-claimed
413

The body is over the limit for this route (reason: too-large; some refusals carry a message only).

One of:
ErrorTooLarge
errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:too-large
ErrorPlain
errorstringrequired

A message for people. Do not parse it.

reasonstring

A stable, machine-readable cause, when there is one.

pathstring

The request field at fault.

needstring

The grant a 403 asks for, app:write for example.

retry_after_sinteger
429

The team holds the maximum number of domains (domain-limit), or the key is rate-limited (key-rate-limited).

One of:
ErrorKeyRateLimited
errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:key-rate-limited
retry_after_sintegerrequired

Seconds to wait; also the Retry-After header.

ErrorDomainLimit
errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:domain-limit
Request
curl -X POST 'https://dash.sproutboat.com/v1/domains' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "host": "app.example.com"
}'
Response
{
  "host": "string",
  "state": "pending",
  "method": "txt",
  "verified_at": "2019-08-24T14:15:22Z",
  "last_checked_at": "2019-08-24T14:15:22Z",
  "lost_at": "2019-08-24T14:15:22Z",
  "lost_reason": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "txt": {
    "type": "TXT",
    "name": "_sproutboat-challenge.app.example.com",
    "value": "sproutboat-verify=..."
  },
  "routes": [
    {
      "project": "string",
      "key": "string"
    }
  ]
}