import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
const { data, error } = await resend.broadcasts.list();
{
"object": "list",
"has_more": false,
"data": [
{
"id": "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794",
"audience_id": "78261eea-8f8b-4381-83c6-79fa7120f1cf", // now called segment_id
"segment_id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
"status": "draft",
"created_at": "2024-11-01T15:13:31.723Z",
"scheduled_at": null,
"sent_at": null,
"topic_id": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e"
},
{
"id": "559ac32e-9ef5-46fb-82a1-b76b840c0f7b",
"audience_id": "78261eea-8f8b-4381-83c6-79fa7120f1cf", // now called segment_id
"segment_id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
"status": "sent",
"created_at": "2024-12-01T19:32:22.980Z",
"scheduled_at": "2024-12-02T19:32:22.980Z",
"sent_at": "2024-12-02T19:32:22.980Z",
"topic_id": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e"
}
]
}
Retrieve a list of broadcast.
import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
const { data, error } = await resend.broadcasts.list();
{
"object": "list",
"has_more": false,
"data": [
{
"id": "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794",
"audience_id": "78261eea-8f8b-4381-83c6-79fa7120f1cf", // now called segment_id
"segment_id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
"status": "draft",
"created_at": "2024-11-01T15:13:31.723Z",
"scheduled_at": null,
"sent_at": null,
"topic_id": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e"
},
{
"id": "559ac32e-9ef5-46fb-82a1-b76b840c0f7b",
"audience_id": "78261eea-8f8b-4381-83c6-79fa7120f1cf", // now called segment_id
"segment_id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
"status": "sent",
"created_at": "2024-12-01T19:32:22.980Z",
"scheduled_at": "2024-12-02T19:32:22.980Z",
"sent_at": "2024-12-02T19:32:22.980Z",
"topic_id": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e"
}
]
}
status types in the Broadcasts
overview.limit parameter is optional. If you do not provide a limit, all broadcasts will be returned in a single response.1001before parameter.after parameter.after or before parameter, not both. See our pagination guide for more information.import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
const { data, error } = await resend.broadcasts.list();
{
"object": "list",
"has_more": false,
"data": [
{
"id": "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794",
"audience_id": "78261eea-8f8b-4381-83c6-79fa7120f1cf", // now called segment_id
"segment_id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
"status": "draft",
"created_at": "2024-11-01T15:13:31.723Z",
"scheduled_at": null,
"sent_at": null,
"topic_id": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e"
},
{
"id": "559ac32e-9ef5-46fb-82a1-b76b840c0f7b",
"audience_id": "78261eea-8f8b-4381-83c6-79fa7120f1cf", // now called segment_id
"segment_id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
"status": "sent",
"created_at": "2024-12-01T19:32:22.980Z",
"scheduled_at": "2024-12-02T19:32:22.980Z",
"sent_at": "2024-12-02T19:32:22.980Z",
"topic_id": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e"
}
]
}
Was this page helpful?