Preview Campaign Audience

Returns the total audience size, an opt-out / undeliverable breakdown, and a 10-row sample for the audience block you would send to POST /v2.0/campaigns. Nothing is persisted — use this freely to tune filters before launching.

POST/v2.0/campaigns/preview

Authentication

Bearer token + brandNumber.

Audience modes (mutually exclusive)

Choose one of the two modes:

  • Segment / tag / filter mode — pass any combination of segmentIds, excludeSegmentIds, tags, excludeTags, and filters. The query is the union of include segments AND-ed with extra filters, with excludes subtracted.
  • Raw contacts mode — pass audience.contacts (an array of { phone, name?, email?, custom? }). Sendiee upserts each phone into your Contact directory before counting.

Request Body

Body

ParameterTypeDescription
brandNumberstringYour WhatsApp Business phone number
audience.segmentIdsstring[]Include contacts matching ANY of these segments
audience.excludeSegmentIdsstring[]Exclude contacts matching ANY of these segments
audience.tagsstring[]Tag IDs — include contacts with any of these tags
audience.excludeTagsstring[]Tag IDs — exclude contacts with any of these tags
audience.filtersobjectAdditional filters: { source, hasEmail, optedOut, ignoreUndeliverableContacts, advancedFilters }
audience.contactsobject[]Raw list { phone, name?, email?, custom? }. Mutually exclusive with the segment-mode fields above
audience.ignoreUndeliverablebooleanDefault true — exclude contacts marked wa_undeliverable

Examples

By segments + tags

cURL
curl -X POST https://api.sendiee.com/v2.0/campaigns/preview \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "brandNumber": "917012345678",
    "audience": {
      "segmentIds": ["66a1...", "66a2..."],
      "excludeTags": ["churned"],
      "filters": { "optedOut": false }
    }
  }'

By raw contacts

cURL
curl -X POST https://api.sendiee.com/v2.0/campaigns/preview \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "brandNumber": "917012345678",
    "audience": {
      "contacts": [
        { "phone": "919876543210", "name": "Surya" },
        { "phone": "918765432109", "name": "Ravi", "custom": { "city": "Chennai" } }
      ]
    }
  }'

Response

{
  "success": true,
  "data": {
    "mode": "segment",
    "totalContacts": 1234,
    "breakdown": {
      "whatsappEligible": 1230,
      "optedOut": 4,
      "undeliverable": 0
    },
    "sample": [
      {
        "phone": "919876543210",
        "name": "Surya",
        "email": null,
        "optedOut": false
      }
    ],
    "segmentsUsed": [
      {
        "id": "66a1...",
        "name": "VIPs"
      }
    ]
  }
}