# Custom Domains

> Custom-domain setup, DNS and certificate status, setup lifecycle, and next actions for the Platform API.

Source: https://docs.oursprivacy.com/docs/platform-api/custom-domains

The Custom Domains API reports account setup, attached-domain status, observed DNS values, managed certificate status, and lifecycle guidance. `certificateStatus` reports issuance state; `certificateActive` reports whether the issued certificate is attached to serve the custom domains. `dnsValue` is the DNS value currently observed; `cnameValue` is the target to configure. DNS records are managed by the account’s DNS provider. An empty `domains` list means no customer domains are attached.

Every setup response includes `domainLimit`, the maximum number of customer domains allowed for the account. The default is 10; contact your account representative for a larger allowance. Domain replacement requests must stay within this allowance. The API cannot change the allowance.

Every setup response includes `setupStatus`: a `state`, human-readable `message`, recommended `nextAction`, domains blocking DNS progress, and an `isReady` flag. Reading the setup status also advances certificate setup, so polling status advances pending validation and activation after DNS is configured.

| State                             | Meaning                                                                                   | Next action             |
| --------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------- |
| `NO_DOMAINS`                      | No customer domains are attached.                                                         | `ADD_DOMAINS`           |
| `DNS_REQUIRED`                    | One or more domains do not point to the required CNAME. `blockingDomains` names them.     | `CONFIGURE_DNS`         |
| `CERTIFICATE_VALIDATION_REQUIRED` | DNS is configured and certificate validation is waiting for DNS changes to reach the CDN. | `RECONCILE_CERTIFICATE` |
| `CERTIFICATE_PENDING`             | Certificate issuance is in progress.                                                      | `WAIT`                  |
| `CERTIFICATE_ACTIVATION_REQUIRED` | The certificate is issued and is activated on the next status read.                       | `RECONCILE_CERTIFICATE` |
| `DEPLOYING`                       | The certificate is active and the domain configuration is deploying.                      | `WAIT`                  |
| `READY`                           | All domains are ready to serve HTTPS traffic.                                             | `NONE`                  |
| `CERTIFICATE_FAILED`              | Certificate setup failed or the certificate is no longer valid.                           | `CONTACT_SUPPORT`       |
| `DISABLED`                        | Custom-domain serving is disabled for the account.                                        | `CONTACT_SUPPORT`       |

The certificate-validation operation runs the same certificate step on demand: when `nextAction` is `RECONCILE_CERTIFICATE`, call it to retry immediately instead of waiting for the next status read. If DNS changes have not reached the CDN yet, it returns HTTP 409; wait a few minutes and retry.

## GET /rest/v1/custom-domains/setup

Returns the account custom-domain setup, observed DNS values, and `setupStatus` lifecycle guidance, including readiness, blocking domains, and the next recommended action. Reading status also advances certificate setup: it starts certificate validation once DNS is configured and activates the certificate once it is issued. Terminal certificate failures include `certificateFailure` with a provider code, explanation, and failed validation domains; a successful status read still returns HTTP 200. DNS blockers can coexist with a certificate failure. Refresh does not restart a terminal failed request; contact support after remediation. The setup is `null` until created. Requires scope: `distributionTenant:find`. Requires API-key scope or current OAuth user permission: distributionTenant:find

Request URL: `GET https://app.oursprivacy.com/rest/v1/custom-domains/setup`

Authentication: apiKey or oauth2.

### Responses

- `200`: Account custom-domain setup, DNS, certificate, and lifecycle status
- `400`: Bad Request
- `401`: Unauthorized — missing, invalid, or expired API key or OAuth access token
- `403`: Forbidden — credential does not have the required current Ours permission
- `404`: Not Found
- `500`: Internal Server Error

#### `200` response body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `setup` | object \| null | Yes |  |
| `setup.id` | string | Yes | Custom-domain setup ID. |
| `setup.enabled` | boolean | Yes | Whether the setup is enabled to serve traffic. |
| `setup.domainLimit` | integer | Yes | Maximum number of custom domains this account can attach. |
| `setup.status` | string \| null | Yes | Delivery deployment status, or null when unavailable. |
| `setup.createdAt` | string \| null | Yes | ISO 8601 timestamp when the setup was created. |
| `setup.updatedAt` | string \| null | Yes | ISO 8601 timestamp when the setup was last updated. |
| `setup.setupStatus` | object | Yes | Current custom-domain setup progress and next action. |
| `setup.setupStatus.state` | string | Yes | Current setup stage. READY means every custom domain can serve traffic. One of: `"NO_DOMAINS"`, `"DNS_REQUIRED"`, `"CERTIFICATE_VALIDATION_REQUIRED"`, `"CERTIFICATE_PENDING"`, `"CERTIFICATE_ACTIVATION_REQUIRED"`, `"DEPLOYING"`, `"READY"`, `"CERTIFICATE_FAILED"`, `"DISABLED"`. |
| `setup.setupStatus.message` | string | Yes | Customer-facing explanation of the current stage. |
| `setup.setupStatus.nextAction` | string | Yes | Recommended next step to move setup forward. One of: `"ADD_DOMAINS"`, `"CONFIGURE_DNS"`, `"RECONCILE_CERTIFICATE"`, `"WAIT"`, `"CONTACT_SUPPORT"`, `"NONE"`. |
| `setup.setupStatus.blockingDomains` | string[] | Yes | Custom domains whose DNS currently blocks setup. Empty when DNS is not the blocker. |
| `setup.setupStatus.isReady` | boolean | Yes | Whether every custom domain is ready to serve traffic. |
| `setup.certificateStatus` | string \| null | Yes | Managed certificate issuance status. |
| `setup.certificateActive` | boolean | Yes | Whether the managed certificate is attached to serve the custom domains. |
| `setup.certificateFailure` | object \| null | Yes | Current terminal certificate failure. Null for new, pending, or issued requests; independent of DNS lifecycle blockers. |
| `setup.certificateFailure.code` | string \| null | Yes | Certificate failure reason, such as CAA_ERROR when DNS CAA records do not authorize the issuer. Other values may appear. Null when unavailable. |
| `setup.certificateFailure.message` | string | Yes | Certificate failure explanation and next steps. |
| `setup.certificateFailure.domains` | string[] | Yes | Customer domains with failed certificate validation, not individually proven CAA policy defects. An empty list means none were identified. |
| `setup.domains` | object[] | Yes | Custom domains attached to the setup. |
| `setup.domains[].domain` | string | Yes | Custom domain attached to the account. |
| `setup.domains[].status` | string | Yes | Domain attachment status. One of: `"active"`, `"inactive"`. |
| `setup.domains[].dnsStatus` | string \| null | Yes | Whether DNS points to the required CNAME target. One of: `"configured"`, `"notConfigured"`, `"wrongEndpoint"`, `"error"`, `null`. |
| `setup.domains[].dnsValue` | string \| null | Yes | DNS value currently observed for this domain. |
| `setup.domains[].cnameValue` | string | Yes | Required CNAME target for this domain. |

Full schema: [OpenAPI specification](https://docs.oursprivacy.com/openapi-platform.json).

## POST /rest/v1/custom-domains

Creates the account custom-domain setup and returns its `setupStatus` lifecycle guidance with `certificateFailure: null`. Each account can have one setup; an existing setup returns HTTP 409. Requires scope: `distributionTenant:create`. Requires API-key scope or current OAuth user permission: distributionTenant:create

Request URL: `POST https://app.oursprivacy.com/rest/v1/custom-domains`

Authentication: apiKey or oauth2.

### Responses

- `200`: Created account custom-domain setup and lifecycle status
- `400`: Bad Request
- `401`: Unauthorized — missing, invalid, or expired API key or OAuth access token
- `403`: Forbidden — credential does not have the required current Ours permission
- `404`: Not Found
- `409`: Conflict — this account already has a custom-domain setup, or setup provisioning failed.
- `500`: Internal Server Error

#### `200` response body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `setup` | object | Yes |  |
| `setup.id` | string | Yes | Custom-domain setup ID. |
| `setup.enabled` | boolean | Yes | Whether the setup is enabled to serve traffic. |
| `setup.domainLimit` | integer | Yes | Maximum number of custom domains this account can attach. |
| `setup.status` | string \| null | Yes | Delivery deployment status, or null when unavailable. |
| `setup.createdAt` | string \| null | Yes | ISO 8601 timestamp when the setup was created. |
| `setup.updatedAt` | string \| null | Yes | ISO 8601 timestamp when the setup was last updated. |
| `setup.setupStatus` | object | Yes | Current custom-domain setup progress and next action. |
| `setup.setupStatus.state` | string | Yes | Current setup stage. READY means every custom domain can serve traffic. One of: `"NO_DOMAINS"`, `"DNS_REQUIRED"`, `"CERTIFICATE_VALIDATION_REQUIRED"`, `"CERTIFICATE_PENDING"`, `"CERTIFICATE_ACTIVATION_REQUIRED"`, `"DEPLOYING"`, `"READY"`, `"CERTIFICATE_FAILED"`, `"DISABLED"`. |
| `setup.setupStatus.message` | string | Yes | Customer-facing explanation of the current stage. |
| `setup.setupStatus.nextAction` | string | Yes | Recommended next step to move setup forward. One of: `"ADD_DOMAINS"`, `"CONFIGURE_DNS"`, `"RECONCILE_CERTIFICATE"`, `"WAIT"`, `"CONTACT_SUPPORT"`, `"NONE"`. |
| `setup.setupStatus.blockingDomains` | string[] | Yes | Custom domains whose DNS currently blocks setup. Empty when DNS is not the blocker. |
| `setup.setupStatus.isReady` | boolean | Yes | Whether every custom domain is ready to serve traffic. |
| `setup.certificateStatus` | string \| null | Yes | Managed certificate issuance status. |
| `setup.certificateActive` | boolean | Yes | Whether the managed certificate is attached to serve the custom domains. |
| `setup.certificateFailure` | object \| null | Yes | Current terminal certificate failure. Null for new, pending, or issued requests; independent of DNS lifecycle blockers. |
| `setup.certificateFailure.code` | string \| null | Yes | Certificate failure reason, such as CAA_ERROR when DNS CAA records do not authorize the issuer. Other values may appear. Null when unavailable. |
| `setup.certificateFailure.message` | string | Yes | Certificate failure explanation and next steps. |
| `setup.certificateFailure.domains` | string[] | Yes | Customer domains with failed certificate validation, not individually proven CAA policy defects. An empty list means none were identified. |
| `setup.domains` | object[] | Yes | Custom domains attached to the setup. |
| `setup.domains[].domain` | string | Yes | Custom domain attached to the account. |
| `setup.domains[].status` | string | Yes | Domain attachment status. One of: `"active"`, `"inactive"`. |
| `setup.domains[].dnsStatus` | string \| null | Yes | Whether DNS points to the required CNAME target. One of: `"configured"`, `"notConfigured"`, `"wrongEndpoint"`, `"error"`, `null`. |
| `setup.domains[].dnsValue` | string \| null | Yes | DNS value currently observed for this domain. |
| `setup.domains[].cnameValue` | string | Yes | Required CNAME target for this domain. |

Full schema: [OpenAPI specification](https://docs.oursprivacy.com/openapi-platform.json).

## PUT /rest/v1/custom-domains/{id}

Replaces the full custom-domain list for this account and returns `setupStatus` lifecycle guidance. The setup `id` is the path identifier. The account allowance is returned as `domainLimit` in the setup response (10 by default, up to 99 with an increased allowance). An empty `domains` list removes all custom domains. Duplicate domains are rejected. Domains under `oursprivacy.com` are rejected. Domain delivery and certificate settings are managed by Ours Privacy; DNS changes are customer-managed. Requires scope: `distributionTenant:update`. Requires API-key scope or current OAuth user permission: distributionTenant:update

Request URL: `PUT https://app.oursprivacy.com/rest/v1/custom-domains/{id}`

Authentication: apiKey or oauth2.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | Yes |  |

### Request body (`application/json`, required)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `domains` | string[] | Yes | Replacement list of up to 99 custom domains, subject to the account's domainLimit (10 by default). An empty list removes all custom domains. Domains under oursprivacy.com are rejected. |

### Responses

- `200`: Updated custom domains, DNS, and lifecycle status
- `400`: Bad Request
- `401`: Unauthorized — missing, invalid, or expired API key or OAuth access token
- `403`: Forbidden — credential does not have the required current Ours permission
- `404`: Not Found
- `409`: Conflict — the domain list violates a business rule.
- `500`: Internal Server Error

#### `200` response body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `setup` | object \| null | Yes |  |
| `setup.id` | string | Yes | Custom-domain setup ID. |
| `setup.enabled` | boolean | Yes | Whether the setup is enabled to serve traffic. |
| `setup.domainLimit` | integer | Yes | Maximum number of custom domains this account can attach. |
| `setup.status` | string \| null | Yes | Delivery deployment status, or null when unavailable. |
| `setup.createdAt` | string \| null | Yes | ISO 8601 timestamp when the setup was created. |
| `setup.updatedAt` | string \| null | Yes | ISO 8601 timestamp when the setup was last updated. |
| `setup.setupStatus` | object | Yes | Current custom-domain setup progress and next action. |
| `setup.setupStatus.state` | string | Yes | Current setup stage. READY means every custom domain can serve traffic. One of: `"NO_DOMAINS"`, `"DNS_REQUIRED"`, `"CERTIFICATE_VALIDATION_REQUIRED"`, `"CERTIFICATE_PENDING"`, `"CERTIFICATE_ACTIVATION_REQUIRED"`, `"DEPLOYING"`, `"READY"`, `"CERTIFICATE_FAILED"`, `"DISABLED"`. |
| `setup.setupStatus.message` | string | Yes | Customer-facing explanation of the current stage. |
| `setup.setupStatus.nextAction` | string | Yes | Recommended next step to move setup forward. One of: `"ADD_DOMAINS"`, `"CONFIGURE_DNS"`, `"RECONCILE_CERTIFICATE"`, `"WAIT"`, `"CONTACT_SUPPORT"`, `"NONE"`. |
| `setup.setupStatus.blockingDomains` | string[] | Yes | Custom domains whose DNS currently blocks setup. Empty when DNS is not the blocker. |
| `setup.setupStatus.isReady` | boolean | Yes | Whether every custom domain is ready to serve traffic. |
| `setup.certificateStatus` | string \| null | Yes | Managed certificate issuance status. |
| `setup.certificateActive` | boolean | Yes | Whether the managed certificate is attached to serve the custom domains. |
| `setup.certificateFailure` | object \| null | Yes | Current terminal certificate failure. Null for new, pending, or issued requests; independent of DNS lifecycle blockers. |
| `setup.certificateFailure.code` | string \| null | Yes | Certificate failure reason, such as CAA_ERROR when DNS CAA records do not authorize the issuer. Other values may appear. Null when unavailable. |
| `setup.certificateFailure.message` | string | Yes | Certificate failure explanation and next steps. |
| `setup.certificateFailure.domains` | string[] | Yes | Customer domains with failed certificate validation, not individually proven CAA policy defects. An empty list means none were identified. |
| `setup.domains` | object[] | Yes | Custom domains attached to the setup. |
| `setup.domains[].domain` | string | Yes | Custom domain attached to the account. |
| `setup.domains[].status` | string | Yes | Domain attachment status. One of: `"active"`, `"inactive"`. |
| `setup.domains[].dnsStatus` | string \| null | Yes | Whether DNS points to the required CNAME target. One of: `"configured"`, `"notConfigured"`, `"wrongEndpoint"`, `"error"`, `null`. |
| `setup.domains[].dnsValue` | string \| null | Yes | DNS value currently observed for this domain. |
| `setup.domains[].cnameValue` | string | Yes | Required CNAME target for this domain. |

Full schema: [OpenAPI specification](https://docs.oursprivacy.com/openapi-platform.json).

## POST /rest/v1/custom-domains/{id}/certificate-validation

Checks DNS and certificate status, applies any required certificate changes, and returns updated `setupStatus` lifecycle guidance. Optional: reading the setup status performs the same steps automatically. Use it to retry immediately after configuring the required CNAME or after the certificate is issued. It does not restart a terminal failed certificate request; contact support after correcting the reported problem. Requires scope: `distributionTenant:update`. Requires API-key scope or current OAuth user permission: distributionTenant:update

Request URL: `POST https://app.oursprivacy.com/rest/v1/custom-domains/{id}/certificate-validation`

Authentication: apiKey or oauth2.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | Yes |  |

### Responses

- `200`: Custom-domain setup, certificate, and lifecycle status after reconciliation
- `400`: Bad Request
- `401`: Unauthorized — missing, invalid, or expired API key or OAuth access token
- `403`: Forbidden — credential does not have the required current Ours permission
- `404`: Not Found
- `409`: Conflict — DNS changes are not yet visible to the CDN. Wait a few minutes for DNS propagation, then retry.
- `500`: Internal Server Error

#### `200` response body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `setup` | object \| null | Yes |  |
| `setup.id` | string | Yes | Custom-domain setup ID. |
| `setup.enabled` | boolean | Yes | Whether the setup is enabled to serve traffic. |
| `setup.domainLimit` | integer | Yes | Maximum number of custom domains this account can attach. |
| `setup.status` | string \| null | Yes | Delivery deployment status, or null when unavailable. |
| `setup.createdAt` | string \| null | Yes | ISO 8601 timestamp when the setup was created. |
| `setup.updatedAt` | string \| null | Yes | ISO 8601 timestamp when the setup was last updated. |
| `setup.setupStatus` | object | Yes | Current custom-domain setup progress and next action. |
| `setup.setupStatus.state` | string | Yes | Current setup stage. READY means every custom domain can serve traffic. One of: `"NO_DOMAINS"`, `"DNS_REQUIRED"`, `"CERTIFICATE_VALIDATION_REQUIRED"`, `"CERTIFICATE_PENDING"`, `"CERTIFICATE_ACTIVATION_REQUIRED"`, `"DEPLOYING"`, `"READY"`, `"CERTIFICATE_FAILED"`, `"DISABLED"`. |
| `setup.setupStatus.message` | string | Yes | Customer-facing explanation of the current stage. |
| `setup.setupStatus.nextAction` | string | Yes | Recommended next step to move setup forward. One of: `"ADD_DOMAINS"`, `"CONFIGURE_DNS"`, `"RECONCILE_CERTIFICATE"`, `"WAIT"`, `"CONTACT_SUPPORT"`, `"NONE"`. |
| `setup.setupStatus.blockingDomains` | string[] | Yes | Custom domains whose DNS currently blocks setup. Empty when DNS is not the blocker. |
| `setup.setupStatus.isReady` | boolean | Yes | Whether every custom domain is ready to serve traffic. |
| `setup.certificateStatus` | string \| null | Yes | Managed certificate issuance status. |
| `setup.certificateActive` | boolean | Yes | Whether the managed certificate is attached to serve the custom domains. |
| `setup.certificateFailure` | object \| null | Yes | Current terminal certificate failure. Null for new, pending, or issued requests; independent of DNS lifecycle blockers. |
| `setup.certificateFailure.code` | string \| null | Yes | Certificate failure reason, such as CAA_ERROR when DNS CAA records do not authorize the issuer. Other values may appear. Null when unavailable. |
| `setup.certificateFailure.message` | string | Yes | Certificate failure explanation and next steps. |
| `setup.certificateFailure.domains` | string[] | Yes | Customer domains with failed certificate validation, not individually proven CAA policy defects. An empty list means none were identified. |
| `setup.domains` | object[] | Yes | Custom domains attached to the setup. |
| `setup.domains[].domain` | string | Yes | Custom domain attached to the account. |
| `setup.domains[].status` | string | Yes | Domain attachment status. One of: `"active"`, `"inactive"`. |
| `setup.domains[].dnsStatus` | string \| null | Yes | Whether DNS points to the required CNAME target. One of: `"configured"`, `"notConfigured"`, `"wrongEndpoint"`, `"error"`, `null`. |
| `setup.domains[].dnsValue` | string \| null | Yes | DNS value currently observed for this domain. |
| `setup.domains[].cnameValue` | string | Yes | Required CNAME target for this domain. |

Full schema: [OpenAPI specification](https://docs.oursprivacy.com/openapi-platform.json).
