import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
// Get by contact id
const { data, error } = await resend.contacts.topics.list({
id: 'e169aa45-1ecf-4183-9955-b1499d5701d3',
});
// Get by contact email
const { data, error } = await resend.contacts.topics.list({
email: 'steve.wozniak@gmail.com',
});
{
"object": "list",
"has_more": false,
"data": [
{
"id": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e",
"name": "Product Updates",
"description": "New features, and latest announcements.",
"subscription": "opt_in"
}
]
}
Retrieve a list of topics subscriptions for a contact.
import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
// Get by contact id
const { data, error } = await resend.contacts.topics.list({
id: 'e169aa45-1ecf-4183-9955-b1499d5701d3',
});
// Get by contact email
const { data, error } = await resend.contacts.topics.list({
email: 'steve.wozniak@gmail.com',
});
{
"object": "list",
"has_more": false,
"data": [
{
"id": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e",
"name": "Product Updates",
"description": "New features, and latest announcements.",
"subscription": "opt_in"
}
]
}
id or email must be provided.
limit parameter is optional. If you do not provide a limit, all topics 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');
// Get by contact id
const { data, error } = await resend.contacts.topics.list({
id: 'e169aa45-1ecf-4183-9955-b1499d5701d3',
});
// Get by contact email
const { data, error } = await resend.contacts.topics.list({
email: 'steve.wozniak@gmail.com',
});
{
"object": "list",
"has_more": false,
"data": [
{
"id": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e",
"name": "Product Updates",
"description": "New features, and latest announcements.",
"subscription": "opt_in"
}
]
}
Was this page helpful?