Preview conditions

POST/v1/segments/preview

Secret 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

  • conditionsobjectrequired

    Nested condition tree evaluated against contacts, their custom `data`, and their activity.

    • logicenumrequired
      andor
    • groupsobject[]required
      • filtersobject[]required

Response

Match count and sample.

  • countintegerrequired
  • sampleobject[]required
    • contactIdstringrequired
    • projectIdstring
    • emailemailrequired
    • firstNamestring | null
    • lastNamestring | null
    • subscribedbooleanrequired
    • dataobject | null

      Arbitrary custom fields.

    • localestring | null
    • createdAtdate-timerequired
    • updatedAtdate-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