---
title: "Update a domain"
method: PATCH
path: "/domains/{domain_id}"
tags: ["Domains"]
---

# Update a domain

`PATCH /domains/{domain_id}`

The `proxy_url` can be updated only for production instances.
Update one of the instance's domains. Both primary and satellite domains can be updated.
If you choose to use Clerk via proxy, use this endpoint to specify the `proxy_url`.
Whenever you decide you'd rather switch to DNS setup for Clerk, simply set `proxy_url`
to `null` for the domain. When you update a production instance's primary domain name,
you have to make sure that you've completed all the necessary setup steps for DNS and
emails to work. Expect downtime otherwise. Updating a primary domain's name will also
update the instance's home origin, affecting the default application paths.

## Path parameters

- `domain_id` string, required

## Request body

- object
  - `name` string, nullable — The new domain name. For development instances, can contain the port, i.e `myhostname:3000`. For production instances, must be a valid FQDN, i.e `mysite.com`. Cannot contain protocol scheme.
  - `proxy_url` string, nullable — The full URL of the proxy that will forward requests to Clerk's Frontend API. Can only be updated for production instances.
  - `is_secondary` boolean, nullable — Whether this is a domain for a secondary app, meaning that any subdomain provided is significant and will be stored as part of the domain. This is useful for supporting multiple apps (one primary and multiple secondaries) on the same root domain (eTLD+1).

## Response `200`

A domain

- Domain
  - `object` 'domain', required
  - `id` string, required
  - `name` string, required
  - `is_satellite` boolean, required
  - `frontend_api_url` string, required
  - `accounts_portal_url` string, nullable — Null for satellite domains.
  - `proxy_url` string, nullable
  - `development_origin` string, required
  - `cname_targets` CNameTarget[], nullable
    - `host` string, required
    - `value` string, required
    - `required` boolean, required — Denotes whether this CNAME target is required to be set in order for the domain to be considered deployed.

## Other responses

- `400` — Request was not successful
- `404` — Resource not found
- `422` — Invalid request parameters

---

[API](https://skmtc.net/clerk/apis/clerk-backend-api.md) · [All operations](https://skmtc.net/clerk/apis/clerk-backend-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/clerk/clerk-backend-api/versions/cf036e7951d3/schema)
