---
title: "Register a sending domain"
method: POST
path: "/domains"
tags: ["Domains"]
---

# Register a sending domain

`POST /domains`

## Request

- Base URL: `https://api.eusend.dev`
- URL: `https://api.eusend.dev/domains`
- Auth: HTTP bearer

Generates a DKIM key pair and returns every DNS record to publish. DNS polling starts immediately; the domain cannot send until it reaches `verified`.

## Request body

- CreateDomainRequest
  - `name` string, required: The domain itself (`acme.com`), not an address on it. Mailbox providers such as gmail.com are refused.

## Response `201`

Registered. Publish `records`, then poll the domain.

- CreateDomainResponse
  - `id` string, uuid, required
  - `name` string, required
  - `records` DnsRecord[], required: The full ordered record set. Prefer this over `dkim`/`dmarc`.
    - `id` string, required: Stable key: `dkim`, `dmarc`, `returnPathSpf`, `returnPathMx`.
    - `type` 'TXT' | 'MX', required
    - `name` string, required
    - `value` string, required
    - `priority` integer: MX records only.
    - `purpose` 'authentication' | 'policy' | 'alignment', required: `authentication` blocks sending when missing; `policy` is recommended; `alignment` is optional and enables Return-Path SPF alignment when both alignment records are published.
    - `description` string, required
  - `dkim` DnsRecord: One record to publish on the sending domain.
    - `id` string, required: Stable key: `dkim`, `dmarc`, `returnPathSpf`, `returnPathMx`.
    - `type` 'TXT' | 'MX', required
    - `name` string, required
    - `value` string, required
    - `priority` integer: MX records only.
    - `purpose` 'authentication' | 'policy' | 'alignment', required: `authentication` blocks sending when missing; `policy` is recommended; `alignment` is optional and enables Return-Path SPF alignment when both alignment records are published.
    - `description` string, required
  - `dmarc` DnsRecord: One record to publish on the sending domain.
    - `id` string, required: Stable key: `dkim`, `dmarc`, `returnPathSpf`, `returnPathMx`.
    - `type` 'TXT' | 'MX', required
    - `name` string, required
    - `value` string, required
    - `priority` integer: MX records only.
    - `purpose` 'authentication' | 'policy' | 'alignment', required: `authentication` blocks sending when missing; `policy` is recommended; `alignment` is optional and enables Return-Path SPF alignment when both alignment records are published.
    - `description` string, required

## Other responses

- `400`: The request body or query failed validation (`VALIDATION_ERROR`).
- `401`: Missing, malformed, or revoked API key (`UNAUTHORIZED`).
- `403`: The key exists but may not reach this resource — a `sending_access` key outside the send paths, a test-mode key writing live state, or an account on hold (`FORBIDDEN`, `ACCOUNT_RESTRICTED`).
- `409`: That domain is already verified on another account (`CONFLICT`).
- `429`: Rate limit exceeded (`RATE_LIMITED`).
- `500`: Unexpected server error (`INTERNAL_ERROR`). Carries `request_id`.

---

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