Domains
You can send only from a domain that is verified in your project. The from address of every email, and the from of every broadcast, is checked against it.
Add a domain
curl https://api.mesend.co/domains \
-H "Authorization: Bearer $ME_SEND_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"yourdomain.com"}'
Or with the SDK: await resend.domains.create({ name: 'yourdomain.com' }).
The response has the domain's id, its status (not_started) and a records list. Each record has a type, name, value, a per-record status and a record kind such as Ownership, SPF or DKIM. Publish every record at your DNS host. The ownership record is a TXT record at _mesend-verify.yourdomain.com; it proves you control the DNS.
Options on create and update:
| Field | Meaning |
|---|---|
region | One of us-east-1, eu-west-1, sa-east-1, ap-northeast-1. Defaults to ap-northeast-1. |
custom_return_path | The bounce subdomain, a label like send or a full host under the domain. |
open_tracking, click_tracking | Turn tracking on or off. Both are off by default. |
tracking_subdomain | Host for tracking links, under your domain. |
tls | opportunistic (default) or enforced (the message is not sent without TLS). |
provider | The delivery provider: cloudflare (default), ses, mailgun or postmark. |
A name already held by another project answers 409 validation_error. A name added over the API and never verified is released after 72 hours, so a stuck claim cannot block the real owner.
Verify
After the records are in DNS, ask Me Send to check them:
curl -X POST https://api.mesend.co/domains/$DOMAIN_ID/verify -H "Authorization: Bearer $ME_SEND_API_KEY"
The call answers { "object": "domain", "id": "..." } straight away and updates the domain's status. Read it with GET /domains/:id:
| Status | Meaning |
|---|---|
not_started | Added, never checked. |
pending | Only the ownership record could be checked so far. |
partially_failed | Some required records are missing. |
failed | None of the required records are in DNS yet. |
verified | Ready to send from. |
A missing DMARC record never blocks verification; it is advised and reported. DNS changes can take time to spread, so retry verify after a few minutes. If DNS itself cannot be read, verify answers 502 and changes nothing. A daily check re-reads the records of every domain and records changes on the domain's timeline, GET /domains/:id/events.
Other calls
GET /domainslists the project's domains.PATCH /domains/:idchanges the options above.DELETE /domains/:idretires the domain: it stops sending and its name is freed. Sent emails keep their history. A domain with scheduled or queued mail, a queued broadcast or an inbox cannot be deleted until that work is done (409).
A domain is also what inboxes and broadcasts send from.