Create Domain

Add a sending domain to the organization. DNS records (SPF, DKIM, DMARC) are automatically generated.

POST/domains

Resend Compatibility: Compatible

Requires a full_access API key.

Body Parameters

namestringrequired

The domain name to add (e.g. example.com).

Response Fields

objectstring

Always "domain".

idstring

The domain ID.

namestring

The domain name.

statusstring

The domain verification status (e.g. pending, verified).

created_atstring

ISO 8601 timestamp.

recordsarray

Array of DNS records to configure.

typestring

DNS record type (SPF, DKIM, or DMARC).

namestring

DNS record name.

valuestring

Expected DNS record value.

statusstring

Verification status of this record.

prioritynumber | null

DNS record priority (if applicable).

curl -X POST 'https://api.postflare.app/domains' \
  -H 'Authorization: Bearer re_xxxxxxxxx' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "example.com"
  }'
import { Resend } from 'resend';

const resend = new Resend('re_xxxxxxxxx');

const { data, error } = await resend.domains.create({
  name: 'example.com',
});

Response

Response
{
  "object": "domain",
  "id": "d91cd9bd-1176-453e-8fc1-35364d380206",
  "name": "example.com",
  "status": "pending",
  "created_at": "2026-01-01T00:00:00.000Z",
  "records": [
    {
      "type": "SPF",
      "name": "example.com",
      "value": "v=spf1 include:_spf.postflare.com ~all",
      "status": "pending",
      "priority": null
    },
    {
      "type": "DKIM",
      "name": "postflare._domainkey.example.com",
      "value": "v=DKIM1; k=rsa; p=MIGf...",
      "status": "pending",
      "priority": null
    },
    {
      "type": "DMARC",
      "name": "_dmarc.example.com",
      "value": "v=DMARC1; p=none; rua=mailto:dmarc@postflare.com",
      "status": "pending",
      "priority": null
    }
  ]
}