Emails · Sending
Send Email
Send a single email, now or scheduled.
POST
/emailsBody Parameters
fromstringrequiredSender address. Add a display name with
Name <you@yourdomain.com>. The domain must be verified.tostring | string[]requiredRecipient address, or an array of up to 50 addresses.
subjectstringrequiredEmail subject line.
htmlstringHTML body. Provide
html, text, or both.textstringPlain-text body. Generated mail clients without HTML support will show this.
ccstring | string[]Carbon-copy recipients.
bccstring | string[]Blind carbon-copy recipients.
reply_tostring | string[]Address(es) replies should go to.
scheduled_atstringSend later: ISO 8601 (
2026-11-20T09:00:00Z) or natural language (in 1 hour). Up to 30 days ahead.headersobjectCustom email headers, e.g.
{ "X-Entity-Ref-ID": "123" }.tags{ name, value }[]Labels returned in webhooks. Letters, numbers,
_ and - only.attachments{ filename, content | path, content_type? }[]Files to attach.
content is base64; path is a public URL to fetch. 40 MB total.template{ id, variables? }Send a published template by ID or alias. Fills
from/subject/html unless you pass them.Idempotency-KeyheaderOptional. Repeating a request with the same key within 24 hours returns the original email instead of sending twice.
import { Resend } from 'resend';
const client = new Resend('pw_xxxxxxxxx');
const { data, error } = await client.emails.send({
from: 'Acme <onboarding@yourdomain.com>',
to: ['delivered@postwave.test'],
subject: 'Hello world',
html: '<p>It works!</p>',
});import requests
res = requests.post(
"https://postwaves.online/emails",
headers={"Authorization": "Bearer pw_xxxxxxxxx"},
json={
"from": "Acme <onboarding@yourdomain.com>",
"to": [
"delivered@postwave.test"
],
"subject": "Hello world",
"html": "<p>It works!</p>"
},
)
print(res.json())<?php
$ch = curl_init('https://postwaves.online/emails');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer pw_xxxxxxxxx',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'from' => 'Acme <onboarding@yourdomain.com>',
'to' => [
'delivered@postwave.test',
],
'subject' => 'Hello world',
'html' => '<p>It works!</p>',
]),
]);
$response = json_decode(curl_exec($ch), true);require "net/http"
require "json"
uri = URI("https://postwaves.online/emails")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer pw_xxxxxxxxx"
req["Content-Type"] = "application/json"
req.body = {
from: "Acme <onboarding@yourdomain.com>",
to: [
"delivered@postwave.test"
],
subject: "Hello world",
html: "<p>It works!</p>"
}.to_json
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }
puts JSON.parse(res.body)package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
body := strings.NewReader(`{"from":"Acme <onboarding@yourdomain.com>","to":["delivered@postwave.test"],"subject":"Hello world","html":"<p>It works!</p>"}`)
req, _ := http.NewRequest("POST", "https://postwaves.online/emails", body)
req.Header.Set("Authorization", "Bearer pw_xxxxxxxxx")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
fmt.Println(string(out))
}curl -X POST 'https://postwaves.online/emails' \
-H 'Authorization: Bearer pw_xxxxxxxxx' \
-H 'Content-Type: application/json' \
-d '{"from":"Acme <onboarding@yourdomain.com>","to":["delivered@postwave.test"],"subject":"Hello world","html":"<p>It works!</p>"}'Try itPOST
/emailsNo key yet? Create one in the dashboard.