# Update a sending domain

```http
PATCH https://trydimmi.com/api/v1/email-domains/{domain}
```

## Authorization

Send an API token as `Authorization: Bearer <token>`.
The token needs: `settings:write`.

## Path parameters

- `domain` (string, required): Id of the sending email domain, starting with edm_, such as edm_01jx2m8k4t. Find it with GET /email-domains.

## Body

- `dns_host` (string): The DNS host the person uses; an empty string goes back to the detected one.
- `mail_from_subdomain` (string): The return path label, such as bounce.

## Response 200 (OK)

- `data` (object, required)
  - `ascii_domain` (string, required): The domain as DNS stores it, in ASCII, such as xn--mnchen-3ya.de. Same as domain for plain names.
  - `created_at` (string, required): When it was created, as an RFC 3339 time, such as 2026-01-31T09:00:00Z.
  - `dns_setup` (object, required)
    - `apply_url` (string): The link to open at the DNS host to approve adding the records. Present only once someone asked for the setup.
    - `host_name` (string, required): The name of the DNS host that can add the records itself.
    - `object` (string, required): The kind of record this is, the same for every record of its kind, such as article.
  - `domain` (string, required): The domain as people write it, such as acme.com.
  - `driver` (string, required): The mail service the domain is set up to send through: ses, smtp, postmark, resend, mailgun or sendgrid.
  - `failure_message` (string | null, required): A sentence explaining failure_reason in words. Null when there is no failure.
  - `failure_reason` (string | null, required): Why the domain failed: not_verified, records_removed, ownership_transferred or provider_rejected_sender. Null when it has not failed.
  - `host_guide` (object, required)
    - `deep_link` (string, required): Address of the DNS host's records page for this domain, where the records are added.
    - `detected` (boolean, required): True when the DNS host was read from the domain's name servers; false when the team picked it or it is unknown.
    - `host_form` (string, required): How this host wants a record's name typed: relative (without the domain) or fqdn (the whole name).
    - `key` (string, required): Short key of the DNS host, such as cloudflare, route53 or godaddy; other when the host is not known.
    - `name` (string, required): The DNS host's name as people know it, such as Cloudflare; Your DNS host when it is not known.
    - `quirks` (string[] | null, required): Things that trip people up at this DNS host, as sentences in the reader's language.
    - `steps` (string[] | null, required): The steps to add the records at this DNS host, in order, as sentences in the reader's language.
  - `id` (string, required): The id of this record. Send it wherever an endpoint asks for this record; never use its name or title in its place.
  - `last_checked_at` (string | null, required): When the domain's DNS records were last checked. Null when never checked.
  - `links` (object, required)
    - `checks` (string, required): The API address of the domain's DNS checks.
    - `self` (string, required): The API address of this domain, such as https://.../api/v1/email-domains/edm_...
    - `zone_file` (string, required): The API address that returns the domain's records as a BIND zone file, to import at a DNS host.
  - `mail_from_domain` (string | null, required): The subdomain used as the return path for bounces, such as bounce.acme.com. Null when none is set up.
  - `next_check_at` (string | null, required): When the DNS records will be checked again. Null when no check is planned.
  - `object` (string, required): The kind of record this is, the same for every record of its kind, such as article.
  - `provider_hint` (string, required): The key of the DNS host the setup instructions are written for, such as cloudflare, route53 or godaddy, or other when unknown.
  - `provider_trusted` (boolean, required): True when the install's operator listed this domain as already set up at the mail service.
  - `records` (object[] | null, required): The DNS records to publish for the domain, each with what it is for, where it goes, its value and what the last check found.
    - `host` (string, required): The record's name as it should be typed at the domain's DNS host, which may be relative to the domain, such as dimmi._domainkey.
    - `name` (string, required): The record's fully qualified name, such as dimmi._domainkey.acme.com.
    - `observed` (string[] | null, required): The values the last check actually found at this record. Empty when nothing was found or no check has run.
    - `priority` (integer): The priority to set on an MX record. Absent on other record types.
    - `purpose` (string, required): What the record is for: ownership, dkim, return_path, return_path_spf, spf or dmarc.
    - `required` (boolean, required): True when the domain cannot be verified until this record is in place; false for guidance.
    - `selector` (string): On a guidance record, the mail provider's own hint it refers to. Absent otherwise.
    - `status` (string, required): What the last check found: verified, mismatch, missing, propagating, error, or info for guidance a check never blocks on.
    - `type` (string, required): The DNS record type, such as TXT, CNAME or MX.
    - `value` (string, required): The value the record must hold.
  - `status` (string, required): Where the domain stands: pending, verifying, verified, degraded (was verified, now failing checks) or failed.
  - `updated_at` (string, required): When it last changed, as an RFC 3339 time, such as 2026-01-31T09:00:00Z.
  - `verified_at` (string | null, required): When the domain was verified for sending. Null while it is not verified.
  - `warnings` (object[] | null, required): Mistakes the last check found in the domain's DNS, each with a code, a message and, where it helps, the host and the fixing value. Empty when none.
    - `code` (string, required): The kind of mistake found, such as duplicate_spf, dmarc_missing, cloudflare_proxied, doubled_domain, propagating or domain_claimed.
    - `host` (string): The DNS name of the record the mistake is at. Absent when it does not point at one record.
    - `message` (string, required): A sentence explaining the mistake and what to do about it.
    - `value` (string): The value that fixes the mistake, where one helps. Absent otherwise.

## Response default (Error)

- `code` (string, required): Stable code for programs to tell errors apart, such as validation_failed or internal_error.
- `errors` (object): Each rejected field mapped to its messages. Only present when the input was invalid.
- `message` (string, required): What went wrong, in words safe to show a person.

## Example request

```bash
curl --request PATCH \
  --url 'https://trydimmi.com/api/v1/email-domains/{domain}' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "dns_host": "<string>",
  "mail_from_subdomain": "<string>"
}'
```

## Example response

```json
{
  "data": {
    "ascii_domain": "<string>",
    "created_at": "2026-11-01T09:30:00Z",
    "dns_setup": {
      "apply_url": "<string>",
      "host_name": "<string>",
      "object": "<string>"
    },
    "domain": "<string>",
    "driver": "<string>",
    "failure_message": "<string>",
    "failure_reason": "<string>",
    "host_guide": {
      "deep_link": "<string>",
      "detected": true,
      "host_form": "<string>",
      "key": "<string>",
      "name": "<string>",
      "quirks": [
        "<string>"
      ],
      "steps": [
        "<string>"
      ]
    },
    "id": "<string>",
    "last_checked_at": "2026-11-01T09:30:00Z",
    "links": {
      "checks": "<string>",
      "self": "<string>",
      "zone_file": "<string>"
    },
    "mail_from_domain": "<string>",
    "next_check_at": "2026-11-01T09:30:00Z",
    "object": "<string>",
    "provider_hint": "<string>",
    "provider_trusted": true,
    "records": [
      {
        "host": "<string>",
        "name": "<string>",
        "observed": [
          "<string>"
        ],
        "priority": 123,
        "purpose": "<string>",
        "required": true,
        "selector": "<string>",
        "status": "<string>",
        "type": "<string>",
        "value": "<string>"
      }
    ],
    "status": "<string>",
    "updated_at": "2026-11-01T09:30:00Z",
    "verified_at": "2026-11-01T09:30:00Z",
    "warnings": [
      {
        "code": "<string>",
        "host": "<string>",
        "message": "<string>",
        "value": "<string>"
      }
    ]
  }
}
```

---

Index of all dimmi docs: https://trydimmi.com/llms.txt (full text: https://trydimmi.com/llms-full.txt)
