How to hit the Resend API

Resend's API lives at https://api.resend.com. Sending is one POST with from, to, subject, and html or text.

Authentication

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

Send an email

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>"
  }'
Run in PostTaco

Send a batch

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"}
  ]'
Run in PostTaco

Check an email

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}}"
Run in PostTaco

List domains

Your sending domains and their verification status.

curl https://api.resend.com/domains \
  -H "Authorization: Bearer {{RESEND_API_KEY}}"
Run in PostTaco