Node.js
import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
// Update by contact id
const { data, error } = await resend.contacts.topics.update({
id: 'e169aa45-1ecf-4183-9955-b1499d5701d3',
topics: [
{
id: 'b6d24b8e-af0b-4c3c-be0c-359bbd97381e',
subscription: 'opt_out',
},
{
id: '07d84122-7224-4881-9c31-1c048e204602',
subscription: 'opt_in',
},
],
});
// Update by contact email
const { data, error } = await resend.contacts.topics.update({
email: 'steve.wozniak@gmail.com',
topics: [
{
id: '07d84122-7224-4881-9c31-1c048e204602',
subscription: 'opt_out',
},
{
id: '07d84122-7224-4881-9c31-1c048e204602',
subscription: 'opt_in',
},
],
});
import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
// Update by contact id
const { data, error } = await resend.contacts.topics.update({
id: 'e169aa45-1ecf-4183-9955-b1499d5701d3',
topics: [
{
id: 'b6d24b8e-af0b-4c3c-be0c-359bbd97381e',
subscription: 'opt_out',
},
{
id: '07d84122-7224-4881-9c31-1c048e204602',
subscription: 'opt_in',
},
],
});
// Update by contact email
const { data, error } = await resend.contacts.topics.update({
email: 'steve.wozniak@gmail.com',
topics: [
{
id: '07d84122-7224-4881-9c31-1c048e204602',
subscription: 'opt_out',
},
{
id: '07d84122-7224-4881-9c31-1c048e204602',
subscription: 'opt_in',
},
],
});
{
"id": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e"
}
PATCH
/
contacts
/
:contact_id
/
topics
Node.js
import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
// Update by contact id
const { data, error } = await resend.contacts.topics.update({
id: 'e169aa45-1ecf-4183-9955-b1499d5701d3',
topics: [
{
id: 'b6d24b8e-af0b-4c3c-be0c-359bbd97381e',
subscription: 'opt_out',
},
{
id: '07d84122-7224-4881-9c31-1c048e204602',
subscription: 'opt_in',
},
],
});
// Update by contact email
const { data, error } = await resend.contacts.topics.update({
email: 'steve.wozniak@gmail.com',
topics: [
{
id: '07d84122-7224-4881-9c31-1c048e204602',
subscription: 'opt_out',
},
{
id: '07d84122-7224-4881-9c31-1c048e204602',
subscription: 'opt_in',
},
],
});
import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
// Update by contact id
const { data, error } = await resend.contacts.topics.update({
id: 'e169aa45-1ecf-4183-9955-b1499d5701d3',
topics: [
{
id: 'b6d24b8e-af0b-4c3c-be0c-359bbd97381e',
subscription: 'opt_out',
},
{
id: '07d84122-7224-4881-9c31-1c048e204602',
subscription: 'opt_in',
},
],
});
// Update by contact email
const { data, error } = await resend.contacts.topics.update({
email: 'steve.wozniak@gmail.com',
topics: [
{
id: '07d84122-7224-4881-9c31-1c048e204602',
subscription: 'opt_out',
},
{
id: '07d84122-7224-4881-9c31-1c048e204602',
subscription: 'opt_in',
},
],
});
{
"id": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e"
}
Documentation Index
Fetch the complete documentation index at: https://resend.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Path Parameters
Either id or email must be provided.
Body Parameters
Array of topic subscription updates.
Hide properties
The subscription action. Must be either opt_in or opt_out.