API Reference

Remove Contact from Segment

DELETE /contacts/:id/segments/:segment_id — remove an existing contact from a segment.

DELETE/contacts/:id/segments/:segment_id

Remove an existing contact from a segment. The contact is identified in the path by either its ID or its email address.

Either id or email must be provided.

Path parameters
idstringoptional

The Contact ID.

emailstringoptional

The Contact Email.

segment_idstringrequired

The Segment ID.

import { MailBlastr } from 'mailblastr';

const mb = new MailBlastr('mb_xxxxxxxxx');

const { data, error } = await mb.contacts.removeFromSegment('e169aa45-1ecf-4183-9955-b1499d5701d3', '78261eea-8f8b-4381-83c6-79fa7120f1cf');
console.log({ data, error });

Response

{
  "id": "e169aa45-1ecf-4183-9955-b1499d5701d3",
  "audienceId": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
  "deleted": true
}