Resend's API lives at https://api.resend.com. Sending is one POST with from, to, subject, and html or text.
Create a key at resend.com/api-keys and send it as Authorization: Bearer <key>. In the examples it's written {{RESEND_API_KEY}}.
Until you verify a domain, send from [email protected], and only to your own address.
Full reference: https://resend.com/docs/api-reference/introduction
Returns the email's id.
curl -X POST https://api.resend.com/emails \
-H "Authorization: Bearer {{RESEND_API_KEY}}" \
-H "Content-Type: application/json" \
-d '{
"from": "[email protected]",
"to": ["{{YOUR_EMAIL}}"],
"subject": "Hello from PostTaco",
"html": "<p>It <strong>works</strong>.</p>"
}'
Up to 100 emails in one request; an array of the same objects.
curl -X POST https://api.resend.com/emails/batch \
-H "Authorization: Bearer {{RESEND_API_KEY}}" \
-H "Content-Type: application/json" \
-d '[
{"from": "[email protected]", "to": ["{{YOUR_EMAIL}}"], "subject": "First", "text": "One"},
{"from": "[email protected]", "to": ["{{YOUR_EMAIL}}"], "subject": "Second", "text": "Two"}
]'
Delivery status (last_event) and contents for an id returned by send.
curl https://api.resend.com/emails/{{EMAIL_ID}} \
-H "Authorization: Bearer {{RESEND_API_KEY}}"
Your sending domains and their verification status.
curl https://api.resend.com/domains \
-H "Authorization: Bearer {{RESEND_API_KEY}}"