Count an audience before creating a campaign

POST/v1/campaigns/audience-count

Secret key — sk_… or sk_test_… · Base URL https://api.volanea.com

How many contacts the given targeting would reach right now — subscribed, non-suppressed, resolved exactly the way a real send resolves it. Powers the live recipient count in the campaign builder.

Body

Required · application/json

  • audienceenum
    allsegmentfilter
  • segmentIdstring

    Required when `audience` is `"segment"`.

  • filterobject

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

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

Response

The live recipient count.

  • countintegerrequired

Errors

Every failure returns the standard envelope — branch on `code`, never on the wording of `error`.

  • 401Missing or invalid API key.
  • 404Not found.
  • 422Request validation failed (code `validation_error`, 422).

Request

curl https://api.volanea.com/v1/campaigns/audience-count \
  -X POST \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{
    "audience": "all",
    "segmentId": "seg_4a71",
    "filter": {
      "logic": "and",
      "groups": [
        {
          "filters": []
        }
      ]
    }
  }'

Response

200 · application/json

{
  "success": true,
  "data": {
    "count": 1
  }
}

92 endpoints · OpenAPI document