import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
resend.domains.create({ name: 'example.com' });
{
"id": "4dd369bc-aa82-4ff3-97de-514ae3000ee0",
"name": "example.com",
"created_at": "2023-03-28T17:12:02.059593+00:00",
"status": "not_started",
"records": [
{
"record": "SPF",
"name": "send",
"type": "MX",
"ttl": "Auto",
"status": "not_started",
"value": "feedback-smtp.us-east-1.amazonses.com",
"priority": 10
},
{
"record": "SPF",
"name": "send",
"value": "\"v=spf1 include:amazonses.com ~all\"",
"type": "TXT",
"ttl": "Auto",
"status": "not_started"
},
{
"record": "DKIM",
"name": "nhapbbryle57yxg3fbjytyodgbt2kyyg._domainkey",
"value": "nhapbbryle57yxg3fbjytyodgbt2kyyg.dkim.amazonses.com.",
"type": "CNAME",
"status": "not_started",
"ttl": "Auto"
},
{
"record": "DKIM",
"name": "xbakwbe5fcscrhzshpap6kbxesf6pfgn._domainkey",
"value": "xbakwbe5fcscrhzshpap6kbxesf6pfgn.dkim.amazonses.com.",
"type": "CNAME",
"status": "not_started",
"ttl": "Auto"
},
{
"record": "DKIM",
"name": "txrcreso3dqbvcve45tqyosxwaegvhgn._domainkey",
"value": "txrcreso3dqbvcve45tqyosxwaegvhgn.dkim.amazonses.com.",
"type": "CNAME",
"status": "not_started",
"ttl": "Auto"
}
],
"region": "us-east-1"
}
Create a domain through the Resend Email API.
import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
resend.domains.create({ name: 'example.com' });
{
"id": "4dd369bc-aa82-4ff3-97de-514ae3000ee0",
"name": "example.com",
"created_at": "2023-03-28T17:12:02.059593+00:00",
"status": "not_started",
"records": [
{
"record": "SPF",
"name": "send",
"type": "MX",
"ttl": "Auto",
"status": "not_started",
"value": "feedback-smtp.us-east-1.amazonses.com",
"priority": 10
},
{
"record": "SPF",
"name": "send",
"value": "\"v=spf1 include:amazonses.com ~all\"",
"type": "TXT",
"ttl": "Auto",
"status": "not_started"
},
{
"record": "DKIM",
"name": "nhapbbryle57yxg3fbjytyodgbt2kyyg._domainkey",
"value": "nhapbbryle57yxg3fbjytyodgbt2kyyg.dkim.amazonses.com.",
"type": "CNAME",
"status": "not_started",
"ttl": "Auto"
},
{
"record": "DKIM",
"name": "xbakwbe5fcscrhzshpap6kbxesf6pfgn._domainkey",
"value": "xbakwbe5fcscrhzshpap6kbxesf6pfgn.dkim.amazonses.com.",
"type": "CNAME",
"status": "not_started",
"ttl": "Auto"
},
{
"record": "DKIM",
"name": "txrcreso3dqbvcve45tqyosxwaegvhgn._domainkey",
"value": "txrcreso3dqbvcve45tqyosxwaegvhgn.dkim.amazonses.com.",
"type": "CNAME",
"status": "not_started",
"ttl": "Auto"
}
],
"region": "us-east-1"
}
'us-east-1' | 'eu-west-1' | 'sa-east-1' | 'ap-northeast-1'
send
(i.e., send.yourdomain.tld
). Avoid
setting values that could undermine credibility (e.g. testing
), as they may
be exposed to recipients.Learn more about custom return paths.status
types in the Domains
overview.import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
resend.domains.create({ name: 'example.com' });
{
"id": "4dd369bc-aa82-4ff3-97de-514ae3000ee0",
"name": "example.com",
"created_at": "2023-03-28T17:12:02.059593+00:00",
"status": "not_started",
"records": [
{
"record": "SPF",
"name": "send",
"type": "MX",
"ttl": "Auto",
"status": "not_started",
"value": "feedback-smtp.us-east-1.amazonses.com",
"priority": 10
},
{
"record": "SPF",
"name": "send",
"value": "\"v=spf1 include:amazonses.com ~all\"",
"type": "TXT",
"ttl": "Auto",
"status": "not_started"
},
{
"record": "DKIM",
"name": "nhapbbryle57yxg3fbjytyodgbt2kyyg._domainkey",
"value": "nhapbbryle57yxg3fbjytyodgbt2kyyg.dkim.amazonses.com.",
"type": "CNAME",
"status": "not_started",
"ttl": "Auto"
},
{
"record": "DKIM",
"name": "xbakwbe5fcscrhzshpap6kbxesf6pfgn._domainkey",
"value": "xbakwbe5fcscrhzshpap6kbxesf6pfgn.dkim.amazonses.com.",
"type": "CNAME",
"status": "not_started",
"ttl": "Auto"
},
{
"record": "DKIM",
"name": "txrcreso3dqbvcve45tqyosxwaegvhgn._domainkey",
"value": "txrcreso3dqbvcve45tqyosxwaegvhgn.dkim.amazonses.com.",
"type": "CNAME",
"status": "not_started",
"ttl": "Auto"
}
],
"region": "us-east-1"
}
Was this page helpful?