import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
const { data, error } = await resend.contacts.segments.list({
id: 'e169aa45-1ecf-4183-9955-b1499d5701d3',
});
{
"object": "list",
"data": [
{
"id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
"name": "Registered Users",
"created_at": "2023-10-06T22:59:55.977Z"
}
],
"has_more": false
}
Retrieve a list of segments that a contact is part of.
import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
const { data, error } = await resend.contacts.segments.list({
id: 'e169aa45-1ecf-4183-9955-b1499d5701d3',
});
{
"object": "list",
"data": [
{
"id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
"name": "Registered Users",
"created_at": "2023-10-06T22:59:55.977Z"
}
],
"has_more": false
}
id or email must be provided.
limit parameter is optional. If you do not provide a limit, all segments 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.contacts.segments.list({
id: 'e169aa45-1ecf-4183-9955-b1499d5701d3',
});
{
"object": "list",
"data": [
{
"id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
"name": "Registered Users",
"created_at": "2023-10-06T22:59:55.977Z"
}
],
"has_more": false
}
Was this page helpful?