Create a broadcast
POST /broadcasts
A draft, or — with `send: true` — a broadcast queued straight through the gate.
Body
namestringA label for the dashboard. Not shown to recipients.
segment_idstringThe segment the broadcast goes to.
fromstringRequiredName <address>on one of your verified domains.subjectstringRequiredThe subject line. Merge variables are allowed.
reply_tostring[]Where replies go.
htmlstringThe HTML body. At least one of
htmlandtextbefore sending.textstringThe plain-text body.
sendbooleanSend now (or at
scheduled_at) instead of leaving a draft. Defaults tofalse.scheduled_atstringISO 8601 or a phrase such as "in 2 hours", read as UTC. Between one minute and thirty days out. Only with
send: true.
4 more fields (audience_id, preview_text, topic_id, template)
audience_idstringDeprecated alias of
segment_id, accepted for compatibility. Usesegment_id.preview_textstringThe inbox preview line.
topic_idstringScope the broadcast to a topic: only contacts opted in to it receive it.
templateobject{ id }of a published template to copy the content from, instead ofhtmlandtext.
Request
curl -X POST "https://api.rasket.com/broadcasts" \
-H "Authorization: Bearer $RASKET_API_KEY" \
-H "User-Agent: acme-billing/1.0" \
-H "Content-Type: application/json" \
-d '{
"name": "September product update",
"segment_id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
"from": "Acme <news@send.acme.example>",
"subject": "What shipped in September",
"reply_to": ["hello@acme.example"],
"html": "<p>Hi {{{FIRST_NAME|there}}},</p><p>Here is what shipped in September.</p><p><a href=\"{{{UNSUBSCRIBE_URL}}}\">Unsubscribe</a></p>"
}'const response = await fetch("https://api.rasket.com/broadcasts", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.RASKET_API_KEY}`,
"User-Agent": "acme-billing/1.0",
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "September product update",
segment_id: "78261eea-8f8b-4381-83c6-79fa7120f1cf",
from: "Acme <news@send.acme.example>",
subject: "What shipped in September",
reply_to: ["hello@acme.example"],
html: "<p>Hi {{{FIRST_NAME|there}}},</p><p>Here is what shipped in September.</p><p><a href=\"{{{UNSUBSCRIBE_URL}}}\">Unsubscribe</a></p>"
}),
});
const { id } = await response.json();import os
import requests
response = requests.post(
"https://api.rasket.com/broadcasts",
headers={
"Authorization": f"Bearer {os.environ['RASKET_API_KEY']}",
"User-Agent": "acme-billing/1.0",
},
json={
"name": "September product update",
"segment_id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
"from": "Acme <news@send.acme.example>",
"subject": "What shipped in September",
"reply_to": ["hello@acme.example"],
"html": "<p>Hi {{{FIRST_NAME|there}}},</p><p>Here is what shipped in September.</p><p><a href=\"{{{UNSUBSCRIBE_URL}}}\">Unsubscribe</a></p>"
},
)
id = response.json()["id"]Response 201
{
"object": "broadcast",
"id": "0199d2f1-4c4e-7a20-9c31-6f2b8a0e5d17"
}fromandsubjectare required; everything else can wait for an update. Sending needs a segment and a body.- Bodies may carry
{{{KEY}}}or{{{KEY|default}}}overFIRST_NAME,LAST_NAME,EMAIL, every contact property key,UNSUBSCRIBE_URLandPREFERENCES_URL, rendered per recipient. - A body with neither
{{{UNSUBSCRIBE_URL}}}nor{{{PREFERENCES_URL}}}gets a footer with an unsubscribe link and your postal address appended, so no broadcast leaves without one. - With
send: true, a gate refusal creates nothing.