Contents
Custom domains
Serve a site from your own hostname, such as cdn.example.com. A custom domain is verified with DNS records before it is used.
Examples marked as generated are built from the schema with synthetic values.
- GETList custom domains
/api/v2/sites/{site_id}/custom-domains - POSTAdd a custom domain
/api/v2/sites/{site_id}/custom-domains - GETGet a custom domain
/api/v2/sites/{site_id}/custom-domains/{domain_id} - DELETERemove a custom domain
/api/v2/sites/{site_id}/custom-domains/{domain_id} - POSTVerify a custom domain
/api/v2/sites/{site_id}/custom-domains/{domain_id}/verification
/api/v2/sites/{site_id}/custom-domainsList custom domains
Returns the custom domains of a site with their status, TLS mode and verification records.
- Authentication
- API token or portal session
- Required permission
domains.read
Parameters
| Name | In | Type | Required | Rules |
|---|---|---|---|---|
| site_id | Path | string | Yes |
|
Responses
200OKapplication/json
Fields (18)
Responses listCustomDomains 200 Field Type Required Rules data array<object> Yes data[].id string Yes data[].hostname string Yes data[].status string Yes - One of: pending_validation, active, failed, removed
data[].claim_expires_at string Yes - Format: date-time
- Can be null
data[].invalidated_reason string Yes - One of: claimed_elsewhere, expired
- Can be null
data[].tls object Yes data[].tls.mode string Yes - One of: shared, managed, custom
data[].ownership_method string Yes - One of: dns_txt, dns_cname, legacy_grandfathered
- Can be null
data[].ownership_verified_at string Yes - Format: date-time
- Can be null
data[].verification object No data[].verification.policy string Yes - One of: dns_txt, dns_cname, any
data[].verification.records array<object> Yes data[].verification.records[].type string Yes - One of: TXT, CNAME
data[].verification.records[].name string Yes data[].verification.records[].value string Yes data[].created_at string Yes - Format: date-time
data[].updated_at string Yes - Format: date-time
Example (generated from the schema) { "data": [ { "id": "id_example", "hostname": "cdn.example.com", "status": "pending_validation", "claim_expires_at": "2026-01-15T10:00:00Z", "invalidated_reason": "claimed_elsewhere", "tls": { "mode": "shared" }, "ownership_method": "dns_txt", "ownership_verified_at": "2026-01-15T10:00:00Z", "verification": { "policy": "dns_txt", "records": [ { "type": "TXT", "name": "Example", "value": "string" } ] }, "created_at": "2026-01-15T10:00:00Z", "updated_at": "2026-01-15T10:00:00Z" } ] }401Unauthorizedapplication/problem+json
Headers: WWW-Authenticate
Error codes:
Problem details body
Example { "type": "https://www.cdnify.lat/docs/errors/unauthenticated", "title": "Authentication required", "status": 401, "code": "unauthenticated", "request_id": "req_01EXAMPLE00000000000000000" }404Not foundapplication/problem+json
Error codes:
Problem details body
Example { "type": "https://www.cdnify.lat/docs/errors/not_found", "title": "Not found", "status": 404, "code": "not_found", "request_id": "req_01EXAMPLE00000000000000000" }
curl 'https://api.cdnify.lat/api/v2/sites/site_0a1b2c3/custom-domains' \
-H "Authorization: Bearer $CDNIFY_API_TOKEN"/api/v2/sites/{site_id}/custom-domainsAdd a custom domain
Adds a hostname to the site in pending_validation and returns the DNS records that prove you control it. Create those records, then verify the domain.
- Authentication
- API token or portal session
- Required permission
domains.manage
Parameters
| Name | In | Type | Required | Rules |
|---|---|---|---|---|
| site_id | Path | string | Yes |
|
| Idempotency-Key | Header | string | No |
|
Request body
Content types: application/json
| Field | Type | Required | Rules |
|---|---|---|---|
| hostname | string | Yes |
|
{
"hostname": "cdn.example.com"
}Responses
201Createdapplication/json
Headers: Location
Fields (17)
Responses addCustomDomain 201 Field Type Required Rules id string Yes hostname string Yes status string Yes - One of: pending_validation, active, failed, removed
claim_expires_at string Yes - Format: date-time
- Can be null
invalidated_reason string Yes - One of: claimed_elsewhere, expired
- Can be null
tls object Yes tls.mode string Yes - One of: shared, managed, custom
ownership_method string Yes - One of: dns_txt, dns_cname, legacy_grandfathered
- Can be null
ownership_verified_at string Yes - Format: date-time
- Can be null
verification object No verification.policy string Yes - One of: dns_txt, dns_cname, any
verification.records array<object> Yes verification.records[].type string Yes - One of: TXT, CNAME
verification.records[].name string Yes verification.records[].value string Yes created_at string Yes - Format: date-time
updated_at string Yes - Format: date-time
Example (generated from the schema) { "id": "id_example", "hostname": "cdn.example.com", "status": "pending_validation", "claim_expires_at": "2026-01-15T10:00:00Z", "invalidated_reason": "claimed_elsewhere", "tls": { "mode": "shared" }, "ownership_method": "dns_txt", "ownership_verified_at": "2026-01-15T10:00:00Z", "verification": { "policy": "dns_txt", "records": [ { "type": "TXT", "name": "Example", "value": "string" } ] }, "created_at": "2026-01-15T10:00:00Z", "updated_at": "2026-01-15T10:00:00Z" }401Unauthorizedapplication/problem+json
Headers: WWW-Authenticate
Error codes:
Problem details body
Example { "type": "https://www.cdnify.lat/docs/errors/unauthenticated", "title": "Authentication required", "status": 401, "code": "unauthenticated", "request_id": "req_01EXAMPLE00000000000000000" }403Forbiddenapplication/problem+json
Error codes:
Problem details body
Example { "type": "https://www.cdnify.lat/docs/errors/insufficient_scope", "title": "Insufficient permissions", "status": 403, "code": "insufficient_scope", "request_id": "req_01EXAMPLE00000000000000000" }404Not foundapplication/problem+json
Error codes:
Problem details body
Example { "type": "https://www.cdnify.lat/docs/errors/not_found", "title": "Not found", "status": 404, "code": "not_found", "request_id": "req_01EXAMPLE00000000000000000" }409Conflictapplication/problem+json
Error codes:
Problem details body
Example { "type": "https://www.cdnify.lat/docs/errors/alias_in_use", "title": "Site name already in use", "status": 409, "code": "alias_in_use", "request_id": "req_01EXAMPLE00000000000000000" }422Unprocessable contentapplication/problem+json
Error codes:
Problem details body
Example { "type": "https://www.cdnify.lat/docs/errors/validation_failed", "title": "Validation failed", "status": 422, "code": "validation_failed", "request_id": "req_01EXAMPLE00000000000000000" }
curl -X POST 'https://api.cdnify.lat/api/v2/sites/site_0a1b2c3/custom-domains' \
-H "Authorization: Bearer $CDNIFY_API_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"hostname":"cdn.example.com"}'/api/v2/sites/{site_id}/custom-domains/{domain_id}Get a custom domain
Returns one custom domain with its verification state.
- Authentication
- API token or portal session
- Required permission
domains.read
Parameters
| Name | In | Type | Required | Rules |
|---|---|---|---|---|
| site_id | Path | string | Yes |
|
| domain_id | Path | string | Yes |
Responses
200OKapplication/json
Fields (17)
Responses getCustomDomain 200 Field Type Required Rules id string Yes hostname string Yes status string Yes - One of: pending_validation, active, failed, removed
claim_expires_at string Yes - Format: date-time
- Can be null
invalidated_reason string Yes - One of: claimed_elsewhere, expired
- Can be null
tls object Yes tls.mode string Yes - One of: shared, managed, custom
ownership_method string Yes - One of: dns_txt, dns_cname, legacy_grandfathered
- Can be null
ownership_verified_at string Yes - Format: date-time
- Can be null
verification object No verification.policy string Yes - One of: dns_txt, dns_cname, any
verification.records array<object> Yes verification.records[].type string Yes - One of: TXT, CNAME
verification.records[].name string Yes verification.records[].value string Yes created_at string Yes - Format: date-time
updated_at string Yes - Format: date-time
Example (generated from the schema) { "id": "id_example", "hostname": "cdn.example.com", "status": "pending_validation", "claim_expires_at": "2026-01-15T10:00:00Z", "invalidated_reason": "claimed_elsewhere", "tls": { "mode": "shared" }, "ownership_method": "dns_txt", "ownership_verified_at": "2026-01-15T10:00:00Z", "verification": { "policy": "dns_txt", "records": [ { "type": "TXT", "name": "Example", "value": "string" } ] }, "created_at": "2026-01-15T10:00:00Z", "updated_at": "2026-01-15T10:00:00Z" }401Unauthorizedapplication/problem+json
Headers: WWW-Authenticate
Error codes:
Problem details body
Example { "type": "https://www.cdnify.lat/docs/errors/unauthenticated", "title": "Authentication required", "status": 401, "code": "unauthenticated", "request_id": "req_01EXAMPLE00000000000000000" }404Not foundapplication/problem+json
Error codes:
Problem details body
Example { "type": "https://www.cdnify.lat/docs/errors/not_found", "title": "Not found", "status": 404, "code": "not_found", "request_id": "req_01EXAMPLE00000000000000000" }
curl 'https://api.cdnify.lat/api/v2/sites/site_0a1b2c3/custom-domains/domain_example' \
-H "Authorization: Bearer $CDNIFY_API_TOKEN"/api/v2/sites/{site_id}/custom-domains/{domain_id}Remove a custom domain
Removes the hostname from the site. Visitors who use it no longer receive content from CDNify.
- Authentication
- API token or portal session
- Required permission
domains.manage
Parameters
| Name | In | Type | Required | Rules |
|---|---|---|---|---|
| site_id | Path | string | Yes |
|
| domain_id | Path | string | Yes |
Responses
204No content
401Unauthorizedapplication/problem+json
Headers: WWW-Authenticate
Error codes:
Problem details body
Example { "type": "https://www.cdnify.lat/docs/errors/unauthenticated", "title": "Authentication required", "status": 401, "code": "unauthenticated", "request_id": "req_01EXAMPLE00000000000000000" }403Forbiddenapplication/problem+json
Error codes:
Problem details body
Example { "type": "https://www.cdnify.lat/docs/errors/insufficient_scope", "title": "Insufficient permissions", "status": 403, "code": "insufficient_scope", "request_id": "req_01EXAMPLE00000000000000000" }404Not foundapplication/problem+json
Error codes:
Problem details body
Example { "type": "https://www.cdnify.lat/docs/errors/not_found", "title": "Not found", "status": 404, "code": "not_found", "request_id": "req_01EXAMPLE00000000000000000" }
curl -X DELETE 'https://api.cdnify.lat/api/v2/sites/site_0a1b2c3/custom-domains/domain_example' \
-H "Authorization: Bearer $CDNIFY_API_TOKEN"/api/v2/sites/{site_id}/custom-domains/{domain_id}/verificationVerify a custom domain
Looks for the ownership records in DNS. When they are found, the domain becomes active. While they are missing, the answer is a conflict such as domain_not_pointing; an expired claim answers domain_claim_expired.
- Authentication
- API token or portal session
- Required permission
domains.manage
Parameters
| Name | In | Type | Required | Rules |
|---|---|---|---|---|
| site_id | Path | string | Yes |
|
| domain_id | Path | string | Yes | |
| Idempotency-Key | Header | string | No |
|
Responses
200OKapplication/json
Fields (17)
Responses verifyCustomDomain 200 Field Type Required Rules id string Yes hostname string Yes status string Yes - One of: pending_validation, active, failed, removed
claim_expires_at string Yes - Format: date-time
- Can be null
invalidated_reason string Yes - One of: claimed_elsewhere, expired
- Can be null
tls object Yes tls.mode string Yes - One of: shared, managed, custom
ownership_method string Yes - One of: dns_txt, dns_cname, legacy_grandfathered
- Can be null
ownership_verified_at string Yes - Format: date-time
- Can be null
verification object No verification.policy string Yes - One of: dns_txt, dns_cname, any
verification.records array<object> Yes verification.records[].type string Yes - One of: TXT, CNAME
verification.records[].name string Yes verification.records[].value string Yes created_at string Yes - Format: date-time
updated_at string Yes - Format: date-time
Example (generated from the schema) { "id": "id_example", "hostname": "cdn.example.com", "status": "pending_validation", "claim_expires_at": "2026-01-15T10:00:00Z", "invalidated_reason": "claimed_elsewhere", "tls": { "mode": "shared" }, "ownership_method": "dns_txt", "ownership_verified_at": "2026-01-15T10:00:00Z", "verification": { "policy": "dns_txt", "records": [ { "type": "TXT", "name": "Example", "value": "string" } ] }, "created_at": "2026-01-15T10:00:00Z", "updated_at": "2026-01-15T10:00:00Z" }401Unauthorizedapplication/problem+json
Headers: WWW-Authenticate
Error codes:
Problem details body
Example { "type": "https://www.cdnify.lat/docs/errors/unauthenticated", "title": "Authentication required", "status": 401, "code": "unauthenticated", "request_id": "req_01EXAMPLE00000000000000000" }404Not foundapplication/problem+json
Error codes:
Problem details body
Example { "type": "https://www.cdnify.lat/docs/errors/not_found", "title": "Not found", "status": 404, "code": "not_found", "request_id": "req_01EXAMPLE00000000000000000" }409Conflictapplication/problem+json
Error codes:
Problem details body
Example { "type": "https://www.cdnify.lat/docs/errors/alias_in_use", "title": "Site name already in use", "status": 409, "code": "alias_in_use", "request_id": "req_01EXAMPLE00000000000000000" }
curl -X POST 'https://api.cdnify.lat/api/v2/sites/site_0a1b2c3/custom-domains/domain_example/verification' \
-H "Authorization: Bearer $CDNIFY_API_TOKEN" \
-H "Idempotency-Key: $(uuidgen)"