Preview conditions
POST
/v1/segments/previewSecret key — sk_… or sk_test_… · Base URL https://api.volanea.com
Live member-count preview for a condition tree (used while building a segment). Returns the count and a small sample of matching contacts.
Body
Required · application/json
conditionsobjectrequiredNested condition tree evaluated against contacts, their custom `data`, and their activity.
logicenumrequiredandorgroupsobject[]requiredfiltersobject[]required
Response
Match count and sample.
countintegerrequiredsampleobject[]requiredcontactIdstringrequiredprojectIdstringemailemailrequiredfirstNamestring | 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/preview \
-X POST \
-H "Authorization: Bearer sk_..." \
-H "Content-Type: application/json" \
-d '{
"conditions": {
"logic": "and",
"groups": [
{
"filters": []
}
]
}
}'Response
200 · application/json
{
"success": true,
"data": {
"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