Skip to main content
DELETE
/
contacts
/
:contact_id
/
segments
/
:segment_id
import { Resend } from 'resend';

const resend = new Resend('re_xxxxxxxxx');

// Update by contact id
const { data, error } = await resend.contacts.segments.remove({
  id: 'e169aa45-1ecf-4183-9955-b1499d5701d3',
  segmentId: '78261eea-8f8b-4381-83c6-79fa7120f1cf',
});

// Update by contact email
const { data, error } = await resend.contacts.segments.remove({
  email: 'steve.wozniak@gmail.com',
  segmentId: '78261eea-8f8b-4381-83c6-79fa7120f1cf',
});
{
  "id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
  "deleted": true
}
Segments are currently in private beta and only available to a limited number of users. APIs might change before GA.To use the methods on this page, you must upgrade your Resend SDK:
npm install resend@6.3.0-canary.0
Get in touch if you’re interested in testing this feature.

Path Parameters

Either id or email must be provided.
id
string
The Contact ID.
email
string
The Contact Email.
import { Resend } from 'resend';

const resend = new Resend('re_xxxxxxxxx');

// Update by contact id
const { data, error } = await resend.contacts.segments.remove({
  id: 'e169aa45-1ecf-4183-9955-b1499d5701d3',
  segmentId: '78261eea-8f8b-4381-83c6-79fa7120f1cf',
});

// Update by contact email
const { data, error } = await resend.contacts.segments.remove({
  email: 'steve.wozniak@gmail.com',
  segmentId: '78261eea-8f8b-4381-83c6-79fa7120f1cf',
});
{
  "id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
  "deleted": true
}