Node.js
import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
const { data, error } = await resend.topics.create({
name: 'Weekly Newsletter',
defaultSubscription: 'opt_in',
});
import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
const { data, error } = await resend.topics.create({
name: 'Weekly Newsletter',
defaultSubscription: 'opt_in',
});
{
"object": "topic",
"id": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e"
}
Node.js
import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
const { data, error } = await resend.topics.create({
name: 'Weekly Newsletter',
defaultSubscription: 'opt_in',
});
import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
const { data, error } = await resend.topics.create({
name: 'Weekly Newsletter',
defaultSubscription: 'opt_in',
});
{
"object": "topic",
"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.
Body Parameters
The topic name. Max length is 50 characters.
The default subscription preference for new contacts. Possible values: opt_in or opt_out.
This value cannot be changed later.
The topic description. Max length is 200 characters.
The visibility of the topic on the unsubscribe page. Possible values: public or private.
private: only contacts who are opted in to the topic can see it on the unsubscribe page.public: all contacts can see the topic on the unsubscribe page.
If not specified, defaults to private.