Domains
Update a domain
PATCH /v1/domains/{id} — change origin, mode, or routing flags.
PATCH /v1/domains/{id}
Updates any combination of: originUrl, mode, keepHost, redirectWww,
redirectStatus, metadata. Hostname is immutable — delete and re-create
if you need to change it.
Request
curl -X PATCH https://api.domainee.dev/v1/domains/$DOMAIN_ID \
-H "Authorization: Bearer $DOMAINEE_API_KEY" \
-H "content-type: application/json" \
-d '{ "originUrl": "https://new-origin.fly.dev" }'
Body parameters
| Field | Notes |
|---|---|
originUrl | New origin URL. Must be https:// or http://. SSRF-checked. |
mode | "proxy" or "redirect". |
keepHost | Forward original Host header (proxy mode). |
redirectWww | Also serve and 301 the www variant. |
redirectStatus | 301 or 302 for redirect mode. |
metadata | Replace the metadata object wholesale. |
Response — 200 OK
Returns the updated Domain object.
Cache propagation
The edge proxy caches resolver lookups for 60 seconds. Changes to
originUrl / mode / keepHost propagate within that window without any
extra action.
Errors
| Status | Code | When |
|---|---|---|
400 | bad_request | Invalid originUrl or unknown field |
400 | preflight_failed | New originUrl resolved to a private/loopback IP |
404 | not_found | The id doesn't exist or doesn't belong to your workspace |