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

# Update a domain

`PATCH /domains/{id}`

## Request

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

Changes a domain's click and open tracking or TLS policy.

## Path parameters

- `id` string, uuid, required

## Request body

- UpdateDomainRequest
  - `click_tracking` boolean: Rewrite links to redirect through the tracking subdomain and record email.clicked events. Off by default.
  - `open_tracking` boolean: Inject a tracking pixel served from the tracking subdomain and record email.opened events. Off by default.
  - `tracking_subdomain` string, nullable: DNS label of the branded tracking host, e.g. "links" for links.<domain>. Setting it adds a Tracking CNAME to records[]; links are tracked through it once that CNAME resolves. Required on MepMail Cloud to turn tracking on. Empty string or null clears it.
  - `tls` unknown
  - `capabilities` unknown

## Response `200`

Domain updated; full object with records

- GetDomainResponse
  - `id` string, uuid, required
  - `name` string, required
  - `status` string, required
  - `created_at` string, required
  - `region` string, required
  - `open_tracking` boolean, required
  - `click_tracking` boolean, required
  - `tracking_subdomain` string, nullable, required
  - `capabilities` object, required
    - `sending` string, required
    - `receiving` string, required
  - `object` 'domain', required
  - `records` object[], required
    - `record` string, required: Which record this is: DKIM, SPF (the MAIL FROM MX and TXT rows), DMARC, or Tracking (the branded tracking CNAME, present once a tracking subdomain is set). Only the DKIM and SPF rows gate sending.
    - `name` string, required
    - `type` string, required
    - `ttl` string, required
    - `status` string, required: not_started | pending | verified | failed. DKIM and SPF rows combine public DNS with the provider's verification: found in DNS but not yet confirmed reads pending, a different published value reads failed, no record reads not_started. DMARC reads verified when a policy covers the domain — its own or a parent domain's (see inherited_from) — and not_started when none does. Tracking reads verified once its CNAME resolves.
    - `value` string, required
    - `priority` number
    - `live` 'found' | 'missing' | 'mismatch' | 'unknown': What public DNS answers for this record right now: found, missing, mismatch (a different value is published) or unknown (the lookup did not conclude). Omitted when no live check ran (the create response).
    - `detail` string: One sentence explaining a row that is not verified: found but awaiting the provider, the value that is published instead, no record at the name, or which parent DMARC policy covers the domain. Omitted when there is nothing to add.
    - `inherited_from` string: DMARC only: the _dmarc name whose policy covers this domain when it has no record of its own (RFC 7489 organizational-domain fallback).
    - `policy` 'none' | 'quarantine' | 'reject': DMARC only, alongside inherited_from: the inherited policy's p= value.

## Other responses

- `401`: Missing, malformed or invalid API key
- `404`: Not found
- `422`: Validation error
- `429`: Rate limit exceeded: 600 requests per minute per API key and 3,000 per team; wait for Retry-After

---

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