Skip to main content
POST
https://api.resend.com
/
broadcasts
import { Resend } from 'resend';

const resend = new Resend('re_xxxxxxxxx');

// Create a draft broadcast
const { data, error } = await resend.broadcasts.create({
  segmentId: '78261eea-8f8b-4381-83c6-79fa7120f1cf',
  from: 'Acme <[email protected]>',
  subject: 'hello world',
  html: 'Hi {{{FIRST_NAME|there}}}, you can unsubscribe here: {{{RESEND_UNSUBSCRIBE_URL}}}',
});

// Create and send immediately
const { data, error } = await resend.broadcasts.create({
  segmentId: '78261eea-8f8b-4381-83c6-79fa7120f1cf',
  from: 'Acme <[email protected]>',
  subject: 'hello world',
  html: 'Hi {{{FIRST_NAME|there}}}, you can unsubscribe here: {{{RESEND_UNSUBSCRIBE_URL}}}',
  send: true,
});

// Create and schedule
const { data, error } = await resend.broadcasts.create({
  segmentId: '78261eea-8f8b-4381-83c6-79fa7120f1cf',
  from: 'Acme <[email protected]>',
  subject: 'hello world',
  html: 'Hi {{{FIRST_NAME|there}}}, you can unsubscribe here: {{{RESEND_UNSUBSCRIBE_URL}}}',
  send: true,
  scheduledAt: 'in 1 hour',
});
{
  "id": "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794"
}

Body Parameters

from
string
required
Sender email address.To include a friendly name, use the format "Your Name <[email protected]>".
subject
string
required
Email subject.
html
string
The HTML version of the message. You can include Contact Properties in the body of the Broadcast. Learn more about Contact Properties.
text
string
The plain text version of the message. You can include Contact Properties in the body of the Broadcast. Learn more about Contact Properties.
If not provided, the HTML will be used to generate a plain text version. You can opt out of this behavior by setting value to an empty string.
react
React.ReactNode
The React component used to write the message. Only available in the Node.js SDK.
name
string
The friendly name of the broadcast. Only used for internal reference.
send
boolean
Send the broadcast immediately after creation. Defaults to false.
When set to true, the broadcast will be sent or scheduled (if scheduled_at is provided) without requiring a separate call to the Send Broadcast endpoint.
import { Resend } from 'resend';

const resend = new Resend('re_xxxxxxxxx');

// Create a draft broadcast
const { data, error } = await resend.broadcasts.create({
  segmentId: '78261eea-8f8b-4381-83c6-79fa7120f1cf',
  from: 'Acme <[email protected]>',
  subject: 'hello world',
  html: 'Hi {{{FIRST_NAME|there}}}, you can unsubscribe here: {{{RESEND_UNSUBSCRIBE_URL}}}',
});

// Create and send immediately
const { data, error } = await resend.broadcasts.create({
  segmentId: '78261eea-8f8b-4381-83c6-79fa7120f1cf',
  from: 'Acme <[email protected]>',
  subject: 'hello world',
  html: 'Hi {{{FIRST_NAME|there}}}, you can unsubscribe here: {{{RESEND_UNSUBSCRIBE_URL}}}',
  send: true,
});

// Create and schedule
const { data, error } = await resend.broadcasts.create({
  segmentId: '78261eea-8f8b-4381-83c6-79fa7120f1cf',
  from: 'Acme <[email protected]>',
  subject: 'hello world',
  html: 'Hi {{{FIRST_NAME|there}}}, you can unsubscribe here: {{{RESEND_UNSUBSCRIBE_URL}}}',
  send: true,
  scheduledAt: 'in 1 hour',
});
{
  "id": "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794"
}