Skip to main content
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.

GET/api/v2/sites/{site_id}/custom-domains

List 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

Parameters listCustomDomains
NameInTypeRequiredRules
site_idPathstringYes
  • Pattern: ^site_([0-9a-f]{7}|[0-9a-f]{12})$

Responses

  • 200OKapplication/json

    Fields (18)
    Responses listCustomDomains 200
    FieldTypeRequiredRules
    dataarray<object>Yes
    data[].idstringYes
    data[].hostnamestringYes
    data[].statusstringYes
    • One of: pending_validation, active, failed, removed
    data[].claim_expires_atstringYes
    • Format: date-time
    • Can be null
    data[].invalidated_reasonstringYes
    • One of: claimed_elsewhere, expired
    • Can be null
    data[].tlsobjectYes
    data[].tls.modestringYes
    • One of: shared, managed, custom
    data[].ownership_methodstringYes
    • One of: dns_txt, dns_cname, legacy_grandfathered
    • Can be null
    data[].ownership_verified_atstringYes
    • Format: date-time
    • Can be null
    data[].verificationobjectNo
    data[].verification.policystringYes
    • One of: dns_txt, dns_cname, any
    data[].verification.recordsarray<object>Yes
    data[].verification.records[].typestringYes
    • One of: TXT, CNAME
    data[].verification.records[].namestringYes
    data[].verification.records[].valuestringYes
    data[].created_atstringYes
    • Format: date-time
    data[].updated_atstringYes
    • 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
curl 'https://api.cdnify.lat/api/v2/sites/site_0a1b2c3/custom-domains' \
  -H "Authorization: Bearer $CDNIFY_API_TOKEN"
POST/api/v2/sites/{site_id}/custom-domains

Add 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

Parameters addCustomDomain
NameInTypeRequiredRules
site_idPathstringYes
  • Pattern: ^site_([0-9a-f]{7}|[0-9a-f]{12})$
Idempotency-KeyHeaderstringNo
  • At most 255 characters

Request body

Content types: application/json

Request body addCustomDomain
FieldTypeRequiredRules
hostnamestringYes
  • At most 253 characters
Example (generated from the schema)
{
  "hostname": "cdn.example.com"
}

Responses

  • 201Createdapplication/json

    Headers: Location

    Fields (17)
    Responses addCustomDomain 201
    FieldTypeRequiredRules
    idstringYes
    hostnamestringYes
    statusstringYes
    • One of: pending_validation, active, failed, removed
    claim_expires_atstringYes
    • Format: date-time
    • Can be null
    invalidated_reasonstringYes
    • One of: claimed_elsewhere, expired
    • Can be null
    tlsobjectYes
    tls.modestringYes
    • One of: shared, managed, custom
    ownership_methodstringYes
    • One of: dns_txt, dns_cname, legacy_grandfathered
    • Can be null
    ownership_verified_atstringYes
    • Format: date-time
    • Can be null
    verificationobjectNo
    verification.policystringYes
    • One of: dns_txt, dns_cname, any
    verification.recordsarray<object>Yes
    verification.records[].typestringYes
    • One of: TXT, CNAME
    verification.records[].namestringYes
    verification.records[].valuestringYes
    created_atstringYes
    • Format: date-time
    updated_atstringYes
    • 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
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"}'
GET/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

Parameters getCustomDomain
NameInTypeRequiredRules
site_idPathstringYes
  • Pattern: ^site_([0-9a-f]{7}|[0-9a-f]{12})$
domain_idPathstringYes

Responses

  • 200OKapplication/json

    Fields (17)
    Responses getCustomDomain 200
    FieldTypeRequiredRules
    idstringYes
    hostnamestringYes
    statusstringYes
    • One of: pending_validation, active, failed, removed
    claim_expires_atstringYes
    • Format: date-time
    • Can be null
    invalidated_reasonstringYes
    • One of: claimed_elsewhere, expired
    • Can be null
    tlsobjectYes
    tls.modestringYes
    • One of: shared, managed, custom
    ownership_methodstringYes
    • One of: dns_txt, dns_cname, legacy_grandfathered
    • Can be null
    ownership_verified_atstringYes
    • Format: date-time
    • Can be null
    verificationobjectNo
    verification.policystringYes
    • One of: dns_txt, dns_cname, any
    verification.recordsarray<object>Yes
    verification.records[].typestringYes
    • One of: TXT, CNAME
    verification.records[].namestringYes
    verification.records[].valuestringYes
    created_atstringYes
    • Format: date-time
    updated_atstringYes
    • 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
curl 'https://api.cdnify.lat/api/v2/sites/site_0a1b2c3/custom-domains/domain_example' \
  -H "Authorization: Bearer $CDNIFY_API_TOKEN"
DELETE/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

Parameters removeCustomDomain
NameInTypeRequiredRules
site_idPathstringYes
  • Pattern: ^site_([0-9a-f]{7}|[0-9a-f]{12})$
domain_idPathstringYes

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
curl -X DELETE 'https://api.cdnify.lat/api/v2/sites/site_0a1b2c3/custom-domains/domain_example' \
  -H "Authorization: Bearer $CDNIFY_API_TOKEN"
POST/api/v2/sites/{site_id}/custom-domains/{domain_id}/verification

Verify 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

Parameters verifyCustomDomain
NameInTypeRequiredRules
site_idPathstringYes
  • Pattern: ^site_([0-9a-f]{7}|[0-9a-f]{12})$
domain_idPathstringYes
Idempotency-KeyHeaderstringNo
  • At most 255 characters

Responses

  • 200OKapplication/json

    Fields (17)
    Responses verifyCustomDomain 200
    FieldTypeRequiredRules
    idstringYes
    hostnamestringYes
    statusstringYes
    • One of: pending_validation, active, failed, removed
    claim_expires_atstringYes
    • Format: date-time
    • Can be null
    invalidated_reasonstringYes
    • One of: claimed_elsewhere, expired
    • Can be null
    tlsobjectYes
    tls.modestringYes
    • One of: shared, managed, custom
    ownership_methodstringYes
    • One of: dns_txt, dns_cname, legacy_grandfathered
    • Can be null
    ownership_verified_atstringYes
    • Format: date-time
    • Can be null
    verificationobjectNo
    verification.policystringYes
    • One of: dns_txt, dns_cname, any
    verification.recordsarray<object>Yes
    verification.records[].typestringYes
    • One of: TXT, CNAME
    verification.records[].namestringYes
    verification.records[].valuestringYes
    created_atstringYes
    • Format: date-time
    updated_atstringYes
    • 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
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)"