v71

latestOpenAPI 3.1.0raw.githubusercontent.com2026-08-0778281700.3 KB
domains

Get domain

Retrieve a custom domain and its verification status.

Address the domain by its id or by its name. Names are unique per workspace, so api.acme.com is sufficient. You do not need to supply a project, app, or environment.

Use this endpoint to poll after domains.createDomain. Verification runs in the background and checks DNS approximately each minute.

status: verified means the domain is verified. Unkey has configured routing and requested a certificate. Each entry in dnsRecords has a verified flag. The flag shows which records Unkey has read back, so you can see which records are still missing. Some providers hide a record from DNS lookups, for example a proxied or flattened routing record. Such a record stays false while it serves traffic. verificationError gives the reason for the last failed attempt.

dnsRecords contains the same values that domains.createDomain returned. Use it to recover the values without creating the domain again.

Important: verification stops 24 hours after the domain was created, and the status becomes failed. The window starts at createdAt, not at the last attempt.

Required Permissions

Your root key must have one of the following permissions:

  • environment.*.read_domain (to read domains in any environment)
  • environment.<environment_id>.read_domain (to read domains in a specific environment)
post/v2/domains.getDomain

Request body

domainstring required

Identifies a domain by its Unkey ID or by its name. Pass a 'dom_'-prefixed ID, or a fully qualified domain name such as 'api.acme.com' without a scheme, port, or path. You can give an internationalized name in Unicode or Punycode form. Both forms address the same domain.

Domain names are unique per workspace, so the name alone addresses the domain. You do not need to supply a project, app, or environment.

Example request

{
  "domain": "api.acme.com"
}

Response

Successfully retrieved the domain.

Example response

{
  "meta": {
    "requestId": "req_123"
  },
  "data": {
    "id": "proj_1234abcd",
    "domain": "api.acme.com",
    "projectId": "proj_1234abcd",
    "appId": "app_1234abcd",
    "environmentId": "env_1234abcd",
    "status": "verified",
    "verificationError": "domain verification timed out after 24 hours",
    "dnsRecords": [
      {
        "type": "CNAME",
        "name": "api.acme.com",
        "value": "a1b2c3d4e5f6g7h8.cname.unkey.com",
        "ttl": 60,
        "note": "Create as DNS-only if your provider offers the choice."
      }
    ],
    "createdAt": 1704067200000,
    "updatedAt": 1704153600000
  }
}