---
title: "Update a domain's origin or routing options."
method: PATCH
path: "/v1/domains/{id}"
tags: ["Domains"]
---

# Update a domain's origin or routing options.

`PATCH /v1/domains/{id}`

## Request

- Base URL: `https://api.domainee.dev`
- URL: `https://api.domainee.dev/v1/domains/{id}`
- Auth: HTTP bearer

Only the fields you send change. The hostname itself is immutable.

## Request body

- object
  - `originUrl` string, uri
  - `metadata` object
  - `mode` 'proxy' | 'redirect'
  - `keepHost` boolean
  - `redirectWww` boolean
  - `redirectStatus` 301 | 302

## Response `200`

The domain.

- object
  - `domain` Domain, required: A customer hostname connected to one of your origins.
    - `id` string, required: Domainee identifier.
    - `workspaceId` string, required: Workspace the domain belongs to.
    - `hostname` string, required
    - `originUrl` string, uri, required: Where verified traffic is sent.
    - `metadata` object: Opaque key/value bag echoed back on reads and webhooks.
    - `mode` 'proxy' | 'redirect': `proxy` serves the origin under the custom hostname; `redirect` sends a 301/302.
    - `keepHost` boolean: Forward the original Host header to the origin instead of rewriting it.
    - `redirectWww` boolean: Also answer for the www. variant.
    - `redirectStatus` 301 | 302
    - `status` 'pending' | 'verified' | 'failed' | 'expired', required: Verification state. Traffic only flows once `verified`.
    - `dnsRecords` DnsRecordInstruction[]: The records the domain owner must create for verification to pass. Always the single CNAME. Unchanged and safe to keep rendering as-is; read `dnsRecordOptions` if you want to offer the apex A-record path.
      - `name` string, required
      - `value` string, required
      - `type` string, required
      - `purpose` string
    - `dnsRecordOptions` DnsRecordSet[]: Every supported way to point this hostname at the edge, recommended first — take `[0]` to get the right one. For a subdomain that is the `cname` set. For an apex it is the `a` set: a root domain cannot hold a CNAME, and the ALIAS/ANAME/flattening substitutes all pin the name to a single region with no failover, whereas the anycast A records keep every region.
      - `method` 'cname' | 'a', required: `cname` works wherever the provider allows a CNAME at this position. `a` is for apex/root domains on providers with no ALIAS or ANAME support.
      - `label` string, required
      - `recommended` boolean, required
      - `note` string
      - `records` DnsRecordInstruction[], required
        - `name` string, required
        - `value` string, required
        - `type` string, required
        - `purpose` string
    - `verificationToken` string
    - `verifiedAt` string, date-time, nullable
    - `lastCheckedAt` string, date-time, nullable
    - `isResolving` boolean: The hostname resolves in public DNS.
    - `pointsToEdge` boolean: It resolves to Domainee's edge.
    - `dnsPointedAt` string[]: What the hostname currently resolves to.
    - `sslActiveFrom` string, date-time, nullable
    - `sslActiveUntil` string, date-time, nullable
    - `monitorStatus` 'unknown' | 'dns_not_resolving' | 'dns_incorrect' | 'pending_ssl' | 'active_ssl' | 'target_not_loading' | 'ssl_failed' | 'ssl_expired': Live health, refreshed by the DNS monitor and by POST /v1/domains/{id}/check.
    - `monitorMessage` string, nullable
    - `lastMonitoredAt` string, date-time, nullable
    - `createdAt` string, date-time, required
    - `updatedAt` string, date-time

## Other responses

- `400`: The request body or query failed validation.
- `401`: Missing, malformed, revoked, or expired Bearer token.
- `404`: No such object in this workspace.

---

[API](https://skmtc.dev/domainee/apis/domainee-api.md) · [All operations](https://skmtc.dev/domainee/apis/domainee-api/llms.txt) · [OpenAPI document](https://skmtc.dev/domainee/apis/domainee-api/revisions/756d54434372?raw)
