API Reference

List Contact Segments

GET /contacts/:id/segments — retrieve the segments a contact is part of.

GET/contacts/:id/segments

Retrieve a list of segments that a contact is part of. 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.

Query parameters
limitnumberoptional

Number of segments to retrieve. Maximum value: 100. Minimum value: 1.

afterstringoptional

The ID *after* which we'll retrieve more segments (for pagination). This ID will *not* be included in the returned list. Cannot be used with the before parameter.

beforestringoptional

The ID *before* which we'll retrieve more segments (for pagination). This ID will *not* be included in the returned list. Cannot be used with the after parameter.

import { MailBlastr } from 'mailblastr';

const mb = new MailBlastr('mb_xxxxxxxxx');

const { data, error } = await mb.contacts.listSegments('e169aa45-1ecf-4183-9955-b1499d5701d3');
console.log({ data, error });

Response

{
  "object": "list",
  "has_more": false,
  "data": [
    {
      "id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
      "name": "Registered Users",
      "created_at": "2026-10-06T22:59:55.000Z"
    }
  ]
}