Broadcasts
Create Broadcast
Create a campaign for a segment. Pass send: true to send straight away.
POST
/broadcastsBody Parameters
audience_idstringrequiredSegment to send to.
fromstringrequiredSender.
subjectstringrequiredSubject (merge tags allowed).
htmlstringBody. Use
{{{FIRST_NAME|fallback}}} and {{{RESEND_UNSUBSCRIBE_URL}}}.textstringPlain text.
namestringInternal name.
reply_tostringReply-to.
sendbooleanQueue immediately.
scheduled_atstringWith
send, when to send.import { Resend } from 'resend';
const client = new Resend('pw_xxxxxxxxx');
const { data, error } = await client.broadcasts.create({
audienceId: '78261eea-…',
from: 'Acme <news@yourdomain.com>',
subject: 'November update',
html: '<p>Hi {{{FIRST_NAME|there}}}</p>',
});import requests
res = requests.post(
"https://post-waves.com/broadcasts",
headers={"Authorization": "Bearer pw_xxxxxxxxx"},
json={
"audience_id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
"from": "Acme <news@yourdomain.com>",
"subject": "November update",
"html": "<p>Hi {{{FIRST_NAME|there}}}</p><a href=\"{{{RESEND_UNSUBSCRIBE_URL}}}\">Unsubscribe</a>"
},
)
print(res.json())<?php
$ch = curl_init('https://post-waves.com/broadcasts');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer pw_xxxxxxxxx',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'audience_id' => '78261eea-8f8b-4381-83c6-79fa7120f1cf',
'from' => 'Acme <news@yourdomain.com>',
'subject' => 'November update',
'html' => '<p>Hi {{{FIRST_NAME|there}}}</p><a href="{{{RESEND_UNSUBSCRIBE_URL}}}">Unsubscribe</a>',
]),
]);
$response = json_decode(curl_exec($ch), true);require "net/http"
require "json"
uri = URI("https://post-waves.com/broadcasts")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer pw_xxxxxxxxx"
req["Content-Type"] = "application/json"
req.body = {
audience_id: "78261eea-8f8b-4381-83c6-79fa7120f1cf",
from: "Acme <news@yourdomain.com>",
subject: "November update",
html: "<p>Hi {{{FIRST_NAME|there}}}</p><a href=\"{{{RESEND_UNSUBSCRIBE_URL}}}\">Unsubscribe</a>"
}.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(`{"audience_id":"78261eea-8f8b-4381-83c6-79fa7120f1cf","from":"Acme <news@yourdomain.com>","subject":"November update","html":"<p>Hi {{{FIRST_NAME|there}}}</p><a href=\"{{{RESEND_UNSUBSCRIBE_URL}}}\">Unsubscribe</a>"}`)
req, _ := http.NewRequest("POST", "https://post-waves.com/broadcasts", 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/broadcasts' \
-H 'Authorization: Bearer pw_xxxxxxxxx' \
-H 'Content-Type: application/json' \
-d '{"audience_id":"78261eea-8f8b-4381-83c6-79fa7120f1cf","from":"Acme <news@yourdomain.com>","subject":"November update","html":"<p>Hi {{{FIRST_NAME|there}}}</p><a href=\"{{{RESEND_UNSUBSCRIBE_URL}}}\">Unsubscribe</a>"}'Try itPOST
/broadcastsNo key yet? Create one in the dashboard.