
# Get a custom domain

`GET /v1/custom-domains/{custom_domain_id}` · permission `custom-domains:read`

Returns a custom domain. When certificate issuance is blocked by CAA (`failure_reason = caa_blocked`), `caa` carries a live CAA check with the exact records to add to your DNS. The `ETag` header is the `If-Match` value for removal and `:make-primary`.

## Request

| Field | Type | Required | Description |
|---|---|---|---|
| `custom_domain_id` | string | yes | Custom domain ID (`cdom_…`). |

No request body.

## Response

`200 OK` with the domain and an `ETag` header.

```json
{
  "id": "cdom_01j9xk3m7q8r2s4t6v8w0y2z4a",
  "hostname": "login.example.com",
  "is_primary": false,
  "status": "issuing",
  "failure_reason": "caa_blocked",
  "dns_records": [
    {
      "type": "TXT",
      "name": "_akp-verify.login.example.com",
      "value": "idp-verify=3q2-7wEXAMPLEtokenQ9"
    },
    {
      "type": "CNAME",
      "name": "login.example.com",
      "value": "acme.eu.edge.keenauth.app"
    }
  ],
  "certificate_expires_at": null,
  "last_checked_at": "2026-10-05T09:31:00Z",
  "next_check_at": "2026-10-05T09:36:00Z",
  "activated_at": null,
  "degraded_since": null,
  "status_changed_at": "2026-10-05T09:30:00.123456Z",
  "caa": {
    "blocked": true,
    "node": "example.com",
    "missing_issuers": [
      "letsencrypt.org"
    ],
    "critical_unknown": false,
    "suggested_records": [
      "example.com. CAA 0 issue \"letsencrypt.org; validationmethods=http-01,tls-alpn-01\""
    ]
  },
  "created_at": "2026-10-05T09:30:00.123456Z",
  "updated_at": "2026-10-05T09:30:00.123456Z"
}
```

## Errors

| HTTP | code | When |
|---|---|---|
| 404 | `not_found` | The custom domain does not exist or belongs to another environment. |
| 401 | `unauthenticated` | The credential is missing, invalid or revoked. |
| 403 | `insufficient_permissions` | The credential lacks the required permission. |
| 429 | `rate_limited` | The rate limit was exceeded; retry after the `Retry-After` period. |
| 503 | `service_unavailable` | A dependency is temporarily unavailable; retry after the `Retry-After` period. |

## Example

```bash
curl https://api.eu.keenauth.com/v1/custom-domains/cdom_01j9xk3m7q8r2s4t6v8w0y2z4a \
  -H "Authorization: Bearer $KEENAUTH_SECRET_KEY"
```
