Skip to main content
POST
/
domains
/
setup
curl --request POST \
  --url https://api.royalti.io/domains/setup \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "domain": "app.yourlabel.com",
  "validationMethod": "txt"
}
'
{
  "success": true,
  "message": "Custom domain setup initiated",
  "data": {
    "domain": "app.yourlabel.com",
    "hostnameId": "<string>",
    "status": "pending",
    "sslStatus": "pending_validation",
    "validationInstructions": {
      "method": "DNS TXT Record",
      "instructions": [
        "Add the following TXT record to your DNS:",
        "Name: _cf-custom-hostname.app.yourlabel.com",
        "Value: 8f14e45f-ceea-4d5e-8b3a-0a1b2c3d4e5f"
      ]
    },
    "cnameTarget": "app.royalti.io",
    "estimatedValidationTime": "5-10 minutes"
  }
}
{
"success": false,
"errors": [
"<string>"
],
"suggestions": [
"<string>"
]
}
{
"status": "error",
"message": "<string>",
"code": "<string>",
"details": {}
}
This endpoint requires authentication. Include your Bearer token in the Authorization header.

Description

POST /domains/setup Description: Validates the domain, provisions a custom hostname with automatic SSL, stores it on the tenant record, and queues background monitoring of the validation/SSL status. A tenant may have only one custom domain at a time — remove the existing one first. Authorization:
  • Required role: admin or higher
Method: POST

Code Examples

const response = await fetch('https://api.royalti.io/domains/setup', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${token}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "ref": "#/components/schemas/SetupCustomDomainRequest"
  })
});

const data = await response.json();
console.log(data);
import requests

response = requests.post(
  'https://api.royalti.io/domains/setup',
  headers={
    'Authorization': f'Bearer {token}'
  },
  json={"ref":"#/components/schemas/SetupCustomDomainRequest"}
)

data = response.json()
print(data)
curl -X POST https://api.royalti.io/domains/setup \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"ref":"#/components/schemas/SetupCustomDomainRequest"}'

Authorizations

Authorization
string
header
required

JWT Authorization header using the Bearer scheme. Format: "Bearer {token}"

Body

application/json
domain
string
required

Fully-qualified domain to connect to this tenant's workspace, 4-253 characters.

Example:

"app.yourlabel.com"

validationMethod
enum<string>
default:txt

How ownership of the domain is proven. DNS TXT is recommended as the simplest option.

Available options:
txt,
http,
email

Response

Custom domain setup initiated

success
boolean
Example:

true

message
string
Example:

"Custom domain setup initiated"

data
object