API Reference
List segments
GET /segments — list a sending domain’s segments.
GET
/segmentsLists the segments on one sending domain. The domain query parameter is required, and the result always includes the domain’s auto-created General segment (all contacts).
Query parameters
domainstringrequiredThe sending domain whose segments to list.
limitnumberoptionalNumber of segments to retrieve. Optional; if omitted, all segments are returned in a single response. Minimum 1, maximum 100.
afterstringoptionalThe segment ID *after* which to retrieve more segments (for pagination). The ID is not included in the result. Cannot be combined with before.
beforestringoptionalThe segment ID *before* which to retrieve more segments (for pagination). The ID is not included in the result. Cannot be combined with after.
import { MailBlastr } from 'mailblastr';
const mb = new MailBlastr('mb_xxxxxxxxx');
const { data, error } = await mb.segments.list({ domain: 'yourdomain.com' });
console.log({ data, error });Response
{
"object": "list",
"has_more": false,
"data": [
{
"object": "segment",
"id": "seg_9a2f...",
"audience_id": "aud_3b1c...",
"name": "Gmail subscribers",
"filter": { "status": "subscribed", "email_contains": "@gmail.com", "property_filters": [] },
"created_at": "2026-06-23T10:00:00.000Z",
"updated_at": "2026-06-23T10:00:00.000Z"
}
]
}