Resend email API via curl. Use this skill to send transactional emails, manage contacts, domains, and API keys.
If requests fail, run zero doctor check-connector --env-name RESEND_TOKEN or zero doctor check-connector --url https://api.resend.com/emails --method POST
Write to /tmp/resend_request.json:
{
"from": "Acme <onboarding@resend.dev>",
"to": ["<your-recipient-email>"],
"subject": "<your-subject>",
"html": "<p><your-html-content></p>"
}
Then run:
curl -s -X POST "https://api.resend.com/emails" --header "Authorization: Bearer $RESEND_TOKEN" --header "Content-Type: application/json" -d @/tmp/resend_request.json
Write to /tmp/resend_request.json:
{
"from": "Acme <onboarding@resend.dev>",
"to": ["<your-recipient-email>"],
"subject": "<your-subject>",
"text": "<your-plain-text-content>"
}
Then run:
curl -s -X POST "https://api.resend.com/emails" --header "Authorization: Bearer $RESEND_TOKEN" --header "Content-Type: application/json" -d @/tmp/resend_request.json
Write to /tmp/resend_request.json:
{
"from": "Acme <onboarding@resend.dev>",
"to": ["<your-recipient-email>"],
"cc": ["<your-cc-email>"],
"bcc": ["<your-bcc-email>"],
"subject": "<your-subject>",
"html": "<p><your-html-content></p>"
}
Then run:
curl -s -X POST "https://api.resend.com/emails" --header "Authorization: Bearer $RESEND_TOKEN" --header "Content-Type: application/json" -d @/tmp/resend_request.json
Write to /tmp/resend_request.json:
{
"from": "Acme <onboarding@resend.dev>",
"to": ["<your-recipient-email>"],
"reply_to": "<your-reply-to-email>",
"subject": "<your-subject>",
"html": "<p><your-html-content></p>"
}
Then run:
curl -s -X POST "https://api.resend.com/emails" --header "Authorization: Bearer $RESEND_TOKEN" --header "Content-Type: application/json" -d @/tmp/resend_request.json
Schedule email using natural language or ISO 8601 format:
Write to /tmp/resend_request.json:
{
"from": "Acme <onboarding@resend.dev>",
"to": ["<your-recipient-email>"],
"subject": "<your-subject>",
"html": "<p><your-html-content></p>",
"scheduled_at": "in 1 hour"
}
Then run:
curl -s -X POST "https://api.resend.com/emails" --header "Authorization: Bearer $RESEND_TOKEN" --header "Content-Type: application/json" -d @/tmp/resend_request.json
Send up to 100 emails in a single request:
Write to /tmp/resend_request.json:
[
{
"from": "Acme <onboarding@resend.dev>",
"to": ["<your-recipient-1>"],
"subject": "Hello 1",
"html": "<p>Email 1</p>"
},
{
"from": "Acme <onboarding@resend.dev>",
"to": ["<your-recipient-2>"],
"subject": "Hello 2",
"html": "<p>Email 2</p>"
}
]
Then run:
curl -s -X POST "https://api.resend.com/emails/batch" --header "Authorization: Bearer $RESEND_TOKEN" --header "Content-Type: application/json" -d @/tmp/resend_request.json
curl -s "https://api.resend.com/emails/<your-email-id>" --header "Authorization: Bearer $RESEND_TOKEN"
curl -s "https://api.resend.com/emails" --header "Authorization: Bearer $RESEND_TOKEN"
curl -s -X POST "https://api.resend.com/emails/<your-email-id>/cancel" --header "Authorization: Bearer $RESEND_TOKEN"
Write to /tmp/resend_request.json:
{
"email": "<your-contact-email>",
"first_name": "<your-first-name>",
"last_name": "<your-last-name>",
"unsubscribed": false
}
Then run:
curl -s -X POST "https://api.resend.com/contacts" --header "Authorization: Bearer $RESEND_TOKEN" --header "Content-Type: application/json" -d @/tmp/resend_request.json
Write to /tmp/resend_request.json:
{
"email": "<your-contact-email>",
"first_name": "<your-first-name>",
"last_name": "<your-last-name>",
"properties": {
"company": "<your-company-name>",
"role": "<your-role>"
}
}
Then run:
curl -s -X POST "https://api.resend.com/contacts" --header "Authorization: Bearer $RESEND_TOKEN" --header "Content-Type: application/json" -d @/tmp/resend_request.json
curl -s "https://api.resend.com/contacts/<your-contact-id>" --header "Authorization: Bearer $RESEND_TOKEN"
curl -s "https://api.resend.com/contacts" --header "Authorization: Bearer $RESEND_TOKEN"
curl -s "https://api.resend.com/contacts?limit=50" --header "Authorization: Bearer $RESEND_TOKEN"
Write to /tmp/resend_request.json:
{
"first_name": "<your-new-first-name>",
"unsubscribed": true
}
Then run:
curl -s -X PATCH "https://api.resend.com/contacts/<your-contact-id>" --header "Authorization: Bearer $RESEND_TOKEN" --header "Content-Type: application/json" -d @/tmp/resend_request.json
curl -s -X DELETE "https://api.resend.com/contacts/<your-contact-id>" --header "Authorization: Bearer $RESEND_TOKEN"
curl -s "https://api.resend.com/domains" --header "Authorization: Bearer $RESEND_TOKEN"
curl -s "https://api.resend.com/domains/<your-domain-id>" --header "Authorization: Bearer $RESEND_TOKEN"
Write to /tmp/resend_request.json:
{
"name": "<your-domain-name>"
}
Then run:
curl -s -X POST "https://api.resend.com/domains" --header "Authorization: Bearer $RESEND_TOKEN" --header "Content-Type: application/json" -d @/tmp/resend_request.json
curl -s -X POST "https://api.resend.com/domains/<your-domain-id>/verify" --header "Authorization: Bearer $RESEND_TOKEN"
curl -s -X DELETE "https://api.resend.com/domains/<your-domain-id>" --header "Authorization: Bearer $RESEND_TOKEN"
curl -s "https://api.resend.com/api-keys" --header "Authorization: Bearer $RESEND_TOKEN"
Write to /tmp/resend_request.json:
{
"name": "<your-key-name>"
}
Then run:
curl -s -X POST "https://api.resend.com/api-keys" --header "Authorization: Bearer $RESEND_TOKEN" --header "Content-Type: application/json" -d @/tmp/resend_request.json
Write to /tmp/resend_request.json:
{
"name": "<your-key-name>",
"permission": "sending_access"
}
Then run:
curl -s -X POST "https://api.resend.com/api-keys" --header "Authorization: Bearer $RESEND_TOKEN" --header "Content-Type: application/json" -d @/tmp/resend_request.json
curl -s -X DELETE "https://api.resend.com/api-keys/<your-api-key-id>" --header "Authorization: Bearer $RESEND_TOKEN"
| Parameter | Type | Description |
|---|---|---|
from |
string | Sender email (required). Format: "Name <email@domain.com>" |
to |
string[] | Recipients (required). Max 50 addresses |
subject |
string | Email subject (required) |
html |
string | HTML content |
text |
string | Plain text content |
cc |
string[] | CC recipients |
bcc |
string[] | BCC recipients |
reply_to |
string | Reply-to address |
scheduled_at |
string | Schedule time (ISO 8601 or natural language) |
tags |
array | Custom tags for tracking |
attachments |
array | File attachments (max 40MB total) |
| Status | Description |
|---|---|
200 |
Success |
400 |
Invalid parameters |
401 |
Missing API key |
403 |
Invalid API key |
404 |
Resource not found |
429 |
Rate limit exceeded (2 req/sec) |
5xx |
Server error |
onboarding@resend.dev for testing/emails/batch for sending to multiple recipients efficientlyIdempotency-Key header to prevent duplicate sendsin 1 hour) or ISO 8601 format for scheduled_at