Emails · Sending
Send Batch Emails
Send up to 100 emails in one request. Attachments and scheduling aren't supported in batch.
POST
/emails/batchBody Parameters
(body)Email[]requiredAn array of 1–100 email objects, each with the same fields as Send Email.
import { Resend } from 'resend';
const client = new Resend('pw_xxxxxxxxx');
const { data, error } = await client.batch.send([
{ from: 'Acme <onboarding@yourdomain.com>', to: ['delivered@postwave.test'], subject: 'Hello 1', html: '<p>First</p>' },
{ from: 'Acme <onboarding@yourdomain.com>', to: ['delivered@postwave.test'], subject: 'Hello 2', html: '<p>Second</p>' },
]);import requests
res = requests.post(
"https://post-waves.com/emails/batch",
headers={"Authorization": "Bearer pw_xxxxxxxxx"},
json=[
{
"from": "Acme <onboarding@yourdomain.com>",
"to": [
"delivered@postwave.test"
],
"subject": "Hello 1",
"html": "<p>First</p>"
},
{
"from": "Acme <onboarding@yourdomain.com>",
"to": [
"delivered@postwave.test"
],
"subject": "Hello 2",
"html": "<p>Second</p>"
}
],
)
print(res.json())<?php
$ch = curl_init('https://post-waves.com/emails/batch');
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 1',
'html' => '<p>First</p>',
],
[
'from' => 'Acme <onboarding@yourdomain.com>',
'to' => [
'delivered@postwave.test',
],
'subject' => 'Hello 2',
'html' => '<p>Second</p>',
],
]),
]);
$response = json_decode(curl_exec($ch), true);require "net/http"
require "json"
uri = URI("https://post-waves.com/emails/batch")
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 1",
html: "<p>First</p>"
},
{
from: "Acme <onboarding@yourdomain.com>",
to: [
"delivered@postwave.test"
],
subject: "Hello 2",
html: "<p>Second</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 1","html":"<p>First</p>"},{"from":"Acme <onboarding@yourdomain.com>","to":["delivered@postwave.test"],"subject":"Hello 2","html":"<p>Second</p>"}]`)
req, _ := http.NewRequest("POST", "https://post-waves.com/emails/batch", 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://post-waves.com/emails/batch' \
-H 'Authorization: Bearer pw_xxxxxxxxx' \
-H 'Content-Type: application/json' \
-d '[{"from":"Acme <onboarding@yourdomain.com>","to":["delivered@postwave.test"],"subject":"Hello 1","html":"<p>First</p>"},{"from":"Acme <onboarding@yourdomain.com>","to":["delivered@postwave.test"],"subject":"Hello 2","html":"<p>Second</p>"}]'Try itPOST
/emails/batchNo key yet? Create one in the dashboard.