List segments
GET /segments — list a sending domain’s segments.
/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).
domainstringrequiredThe sending domain whose segments to list.
limitnumberoptionalNumber of segments to retrieve. An integer between 1 and 100. Optional; if omitted, every segment on the domain is returned in a single response up to a ceiling of 1,000, and has_more is true when that ceiling truncated the page — keep walking with after.
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": "4c1f8b2e-9a2f-4d71-8f0c-2b5d7e6a1c93",
"audience_id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
"name": "Gmail subscribers",
"filter": { "status": "subscribed", "email_contains": "@gmail.com", "property_filters": [], "engagement": null },
"created_at": "2026-06-23T10:00:00.000Z",
"updated_at": "2026-06-23T10:00:00.000Z"
}
]
}