Resend API
api.resend.com · Communication
Modern developer-first email API — send transactional emails with React, HTML, or plain text. Clean REST API, excellent DX. Free tier: 100 emails/day, 3,000/month.
Authentication
Bearer Token
Free API key at resend.com. Pass as Authorization: Bearer YOUR_KEY.
Sample Requests
POST
Send email
Send an HTML email with Resend.
https://api.resend.com/emails
Hover any highlighted part to learn what it does
Headers — extra info sent with the request
| Content-Type | application/json |
| Authorization | Bearer YOUR_KEY |
Request Body — data you're sending
{
"to": [
"[email protected]"
],
"from": "[email protected]",
"html": "<p>Hello from <strong>Resend</strong>!</p>",
"subject": "Hello World"
}
curl -X POST "https://api.resend.com/emails" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"to":["[email protected]"],"from":"[email protected]","html":"<p>Hello from <strong>Resend</strong>!</p>","subject":"Hello World"}'import requests
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_ACCESS_TOKEN"
}
data = {
"to": [
"[email protected]"
],
"from": "[email protected]",
"html": "<p>Hello from <strong>Resend</strong>!</p>",
"subject": "Hello World"
}
response = requests.post(
"https://api.resend.com/emails",
headers=headers,
json=data,
)
print(response.json())const url = 'https://api.resend.com/emails';
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
},
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
"to": [
"[email protected]"
],
"from": "[email protected]",
"html": "<p>Hello from <strong>Resend</strong>!</p>",
"subject": "Hello World"
}),
});
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"bytes"
"encoding/json"
)
func main() {
targetURL := "https://api.resend.com/emails"
jsonData, _ := json.Marshal({"to":["[email protected]"],"from":"[email protected]","html":"<p>Hello from <strong>Resend</strong>!</p>","subject":"Hello World"})
req, _ := http.NewRequest("POST", targetURL, bytes.NewBuffer(jsonData))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_ACCESS_TOKEN")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.resend.com/emails")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Post.new(uri)
req["Content-Type"] = "application/json"
req["Authorization"] = "Bearer YOUR_ACCESS_TOKEN"
req["Content-Type"] = "application/json"
req.body = "{\"to\":[\"[email protected]\"],\"from\":\"[email protected]\",\"html\":\"<p>Hello from <strong>Resend</strong>!</p>\",\"subject\":\"Hello World\"}"
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.resend.com/emails";
$opts = ["http" => [
"method" => "POST",
"header" => implode("\r\n", [
"Content-Type: application/json",
"Authorization: Bearer YOUR_ACCESS_TOKEN",
"Content-Type: application/json"
]),
"content" => json_encode({"to":["[email protected]"],"from":"[email protected]","html":"<p>Hello from <strong>Resend</strong>!</p>","subject":"Hello World"}),
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Postman Setup Guide
- Sign up at resend.com — free tier: 3,000 emails/month
- Get API key from resend.com/api-keys
- Set Authorization: Bearer YOUR_KEY
- from must be from a verified domain (or use [email protected] for testing)
- Works great with React Email for templating