Create Broadcast
Create a new broadcast. A broadcast is an email campaign sent to a segment of contacts. After creating a broadcast, call Send Broadcast to deliver it.
POST
/broadcastsRequires a full_access API key.
Body Parameters
segment_idstringrequiredThe segment ID (UUID) of contacts to send this broadcast to.
fromstringrequiredSender email address. Use "Name <email@example.com>" format for a friendly name.
subjectstringrequiredEmail subject.
htmlstringHTML content of the broadcast. Either html or text is required.
textstringPlain text content of the broadcast. Either html or text is required.
reply_tostring | string[]Reply-to email address(es).
namestringA friendly internal name for the broadcast (not visible to recipients).
topic_idstringOptional topic ID (UUID) to scope the broadcast. Only contacts subscribed to this topic will receive it.
Response Fields
idstringThe ID of the newly created broadcast.
curl -X POST 'https://api.postflare.app/broadcasts' \
-H 'Authorization: Bearer re_xxxxxxxxx' \
-H 'Content-Type: application/json' \
-d '{
"segment_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"from": "Acme <newsletter@acme.com>",
"subject": "Our Monthly Newsletter",
"html": "<p>Hello!</p>",
"name": "April Newsletter"
}'const response = await fetch('https://api.postflare.app/broadcasts', {
method: 'POST',
headers: {
'Authorization': 'Bearer re_xxxxxxxxx',
'Content-Type': 'application/json',
},
body: JSON.stringify({
segment_id: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
from: 'Acme <newsletter@acme.com>',
subject: 'Our Monthly Newsletter',
html: '<p>Hello!</p>',
name: 'April Newsletter',
}),
});
const data = await response.json();Response
{
"id": "d4e5f6a7-b8c9-0123-defa-234567890123"
}