[Documentation
](/docs/introduction)[API Reference
](/docs/api-reference/introduction)[Build with AI
](/docs/ai-onboarding)[Knowledge Base
](/docs/knowledge-base/introduction)[Webhooks
](/docs/webhooks/introduction)
Node.js
import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
const { data, error } = await resend.segments.create({
name: 'Registered Users',
});
import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
const { data, error } = await resend.segments.create({
name: 'Registered Users',
});
{
"object": "segment",
"id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
"name": "Registered Users"
}
POST
/
segments
Node.js
import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
const { data, error } = await resend.segments.create({
name: 'Registered Users',
});
import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
const { data, error } = await resend.segments.create({
name: 'Registered Users',
});
{
"object": "segment",
"id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
"name": "Registered Users"
}
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)
Body Parameters
[
](#param-name)
name
string
required
The name of the segment you want to create.
Was this page helpful?
[
Delete Contact Property
Previous
](/docs/api-reference/contact-properties/delete-contact-property)[
Retrieve Segment
Next
](/docs/api-reference/segments/get-segment)
Ctrl+I