Create a segment
/v1/segmentsSecret key — sk_… or sk_test_… · Base URL https://api.volanea.com
Dynamic segments require conditions and are computed immediately; static segments start empty and are managed via the members endpoints.
Pass dryRun: true to preview instead of create — identical to POST /v1/segments/preview, and name is not required. The alias exists because the MCP create_segment tool takes dryRun and tells agents to run one first: until this was honoured, carrying that parameter into the REST call created a live segment on every "preview", and deleting it afterwards did not undo the segment.entered activity it had already written onto contacts.
Body
Required · application/json
namestringRequired unless `dryRun` is true.
descriptionstringtypeenumdynamicstaticconditionsobjectNested condition tree evaluated against contacts, their custom `data`, and their activity.
logicenumrequiredandorgroupsobject[]requiredfiltersobject[]required
dryRunbooleanPreview only — nothing is created. Returns the same shape as `POST /v1/segments/preview`.
Response
Preview, when `dryRun` is true.
dryRunenumrequiredtruesegmentIdnullAlways null — a dry run creates nothing.
countintegerrequiredsampleobject[]contactIdstringrequiredprojectIdstringemailemailrequiredfirstNamestring | nulllastNamestring | nullsubscribedbooleanrequireddataobject | nullArbitrary custom fields.
localestring | nullcreatedAtdate-timerequiredupdatedAtdate-timerequired
Errors
Every failure returns the standard envelope — branch on `code`, never on the wording of `error`.
401Missing or invalid API key.422Request validation failed (code `validation_error`, 422).
Request
curl https://api.volanea.com/v1/segments \
-X POST \
-H "Authorization: Bearer sk_..." \
-H "Content-Type: application/json" \
-d '{
"name": "Welcome",
"description": "What this is for",
"type": "dynamic"
}'Response
200 · application/json
{
"success": true,
"data": {
"dryRun": true,
"segmentId": "seg_4a71",
"count": 1,
"sample": [
{
"contactId": "con_5e90",
"projectId": "<projectId>",
"email": "ada@example.com",
"firstName": "Ada",
"lastName": "Lovelace",
"subscribed": true,
"data": {},
"locale": "en",
"createdAt": "2026-01-01T09:00:00.000Z",
"updatedAt": "2026-01-01T09:00:00.000Z"
}
]
}
}92 endpoints · OpenAPI document