apicheats.dev resend/llms.txt Raw .md
POST

/domains

Resend API

Create a new domain

Base URL
https://api.resend.com
Auth
Authorization: Bearer <RESEND_API_KEY>
Last verified
2026-09-03 · upstream hash matched
Actions
Agents: curl -H "Accept: text/markdown" this URL
→ 220 tokens · Vary: Accept

Critical gotchas

All requests must include a User-Agent header (e.g. User-Agent: my-app/1.0) or the API returns HTTP 403.

The to field is an array of strings, even when sending to a single recipient.

cURL

curl -X POST 'https://api.resend.com/domains' \  -H "Authorization: Bearer $RESEND_API_KEY" \  -H 'User-Agent: my-app/1.0' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "region": "us-east-1",  "custom_return_path": "string",  "open_tracking": true,  "click_tracking": true,  "tls": "opportunistic",  "capabilities": {    "sending": "enabled",    "receiving": "enabled"  },  "tracking_subdomain": "string"}'
Get a free Resend API key → sponsored

Parameters

Name In Type Required Description
name body string Yes The name of the domain you want to create.
region body string No The region where emails will be sent from. Possible values are us-east-1 | eu-west-1 | sa-east-1 | ap-northeast-1
custom_return_path body string No For advanced use cases, choose a subdomain for the Return-Path address. Defaults to 'send' (i.e., send.yourdomain.tld).
open_tracking body boolean No Track the open rate of each email.
click_tracking body boolean No Track clicks within the body of each HTML email.
tls body string No TLS mode. Opportunistic attempts secure connection but falls back to unencrypted. Enforced requires TLS or email won't be sent.
capabilities body object No Configure the domain capabilities for sending and receiving emails. At least one capability must be enabled.
tracking_subdomain body string No The subdomain to use for click and open tracking.

Response 200 OK

{
  "id": "string",
  "name": "string",
  "created_at": "2023-10-06 23:47:56.678+00",
  "status": "pending",
  "capabilities": {
    "sending": "enabled",
    "receiving": "enabled"
  },
  "records": [
    {
      "record": "SPF",
      "name": "string",
      "type": "MX",
      "ttl": "string",
      "status": "pending",
      "value": "string",
      "priority": 0
    }
  ],
  "region": "string",
  "open_tracking": true,
  "click_tracking": true,
  "tracking_subdomain": "string"
}