Docs
OverviewPlatformPlatform APIA2P Messaging API
AI & MCP
Open dashboard
OverviewPlatformPlatform APIA2P Messaging API
AI & MCP
  • Overview
  • Introduction
  • Create an account
  • Choose your API
  • Authentication
  • AI & MCP
Product API
  • Guide
  • Quickstart
    • API tokens
    • Connected apps (OAuth)
    • Project readiness
    • Channel readiness
    • Senders
    • Attention
    • Recommendations
    • Overview
    • Contacts and attributes
    • Events
    • Query filter
    • Event query filter
    • Probes
    • Counting and retrieval
    • Segments
    • Overview
    • Creating a draft
    • Audience targeting
    • Message content
    • Dates and scheduling
    • Reading campaigns
    • Estimating and deleting
    • OverviewBeta
    • Templates
    • Creating and editing drafts
    • Triggers and exits
    • Nodes
    • Delays and waits
    • Overview
    • Statistics catalog
    • Building queries
    • Conversions & revenue
    • Reading results
    • Flow reports
    • Rate limits
    • Errors
  • Full API Reference
Ingest API
  • Guide
  • Quickstart
  • Authentication
  • Rate limits
  • Errors
  • Best practices
  • Full API Reference
Further reading
  • Query Filter
DashboardSupportinstasent.com

Platform API · Product API · Audience

Counting and retrieval

Which endpoint answers which question about the audience: the exact count of a filter, a quick search, a cursor traverse of a large result set, a single contact by id or identifier, and what the subscription plan lets each of them return.

On this page▾
  • Which endpoint for which question
  • Counting
  • Where a count drops: the ladder
  • Searching and scrolling
  • Retrieving one contact
  • Aggregations
  • What the plan lets you see
  • What's next

Once a filter selects the right people, there are four different things you might want back, and they are four different endpoints with four different costs and permissions. Picking the wrong one is the usual cause of a 403 you did not expect or a page-two that never arrives.

Which endpoint for which question

The questionEndpointWhat comes back
How many match this filter?POST /audience/countA single exact total, no contact rows
Show me a first pagePOST /audience/searchUp to 50 contacts, from the beginning
Give me all of themPOST /audience/scrollUp to 100 per page, cursor-paginated
All of them, inside a segmentPOST /audience/segment/{uid}/scrollSame, restricted to a segment
This one personGET /audience/{audienceId} and the identifier lookupsOne contact
A breakdown, not rowsPOST /audience/aggregationsAggregation results only

Counting

POST /project/{project}/audience/count takes the audience query filter and returns only the total. It is the endpoint whose number you may act on: exact, uncapped and live, with no sampling anywhere near it.

POST/project/{project}/audience/count

The exact number of contacts matching a filter.

curl -X POST "$BASE/audience/count" \
  -H "Authorization: Bearer $INSTASENT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "filterCompliance": { "sms": "no-opt-out" } }'

Four things worth knowing:

  • An empty body counts the whole audience. limit and offset are ignored.
  • It carries no contact data, which is why it stays available under the anonymized data policy mode, where /audience/search is disabled. For restricted credentials it is the supported way to answer "how many contacts match this".
  • To count who can actually receive, pass filterCompliance. Without it the total is the raw audience, not a sending figure. The consent and reach rules are the same ones a campaign estimate applies. See Counting who can receive.
  • It is the endpoint that settles any number a probe suggested. Probes report shape and may be sampled; this is the size.

Where a count drops: the ladder

A total on its own does not say why it is small. Add "ladder": true at the top level of the body and the same call also returns four counts, each one a subset of the one before, so you can see at which step the contacts fall away:

curl -X POST "$BASE/audience/count" \
  -H "Authorization: Bearer $INSTASENT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "ladder": true, "filterCompliance": { "sms": "no-opt-out" } }'
{
  "metadata": {
    "totalHits": 452,
    "ladder": {
      "audience": 1200,
      "matched": 1200,
      "reachable": 610,
      "consented": 452
    },
    "unknownSegments": []
  }
}
RungWho it counts
audienceEvery contact in the project.
matchedThe contacts your filter selects: the conditions in root plus the scoping keys (countries, data sources, required attributes). No reach and no consent yet.
reachableThose of matched the channel can reach: a valid mobile number and, for rcs and whatsapp, a device not known to lack support.
consentedThose of reachable the consent policy in filterCompliance allows. Always equal to totalHits.

consented is the number of contacts who would actually receive the message. Quote it as the reach of a send; matched alone overstates it. The gaps between rungs tell you what to fix: a big drop from matched to reachable is missing or unusable phone numbers, a big drop from reachable to consented is the consent policy at work. Without filterCompliance (or the explicit consent and reach keys it expands to) there is no reach or consent to apply, so matched, reachable and consented come back equal.

unknownSegments lists any segment uid in root that matches no segment in the project. Such a condition selects nobody, so a zero with an entry here is a typo in the filter, not an empty audience.

Searching and scrolling

Both take the same filter. They differ in how much they will give you and what it costs.

POST/project/{project}/audience/search

A first page of matching contacts, up to 50.

/audience/search uses offset/limit pagination, but the offset is always forced to 0: it is built for a quick look from the beginning, not for walking a result set. Its ceiling is 50 contacts per request and it needs PROJECT_AUDIENCE_READ.

POST/project/{project}/audience/scroll

A cursor traverse of the whole result set, 100 contacts at a time.

/audience/scroll is the one for large traverses. It returns a cursor in the response metadata that you pass back to get the next page, up to 100 contacts per request. The cursor is a base64 string holding the internal query state and expires after one minute of inactivity, so a traverse has to keep moving: a job that fetches a page, spends five minutes processing it and comes back will find the cursor gone.

It needs PROJECT_AUDIENCE_LIST, which is gated by the subscription plan. That is the usual reason a call that works for one organization is refused for another with the same code.

Scroll rather than paginate. It is the endpoint designed for volume: one hit per page, generous page size and no offset arithmetic. Reserve /audience/search for the interactive "show me a few" case.

Retrieving one contact

When you already know who you are looking for, four direct lookups skip the filter entirely.

GET/project/{project}/audience/{audienceId}

By audience contact id.

GET/project/{project}/audience/user/{userId}

By the _user_id your systems use.

GET/project/{project}/audience/search/phone/{userPhone}

By phone number. URL-encode the leading plus as %2B.

GET/project/{project}/audience/search/email/{userEmail}

By email address.

The id these return is the one every other per-contact call takes, including the contact's events and direct messaging.

Aggregations

POST /audience/aggregations runs your aggregations over the filtered audience and returns results only, with no contact rows and the limit pinned to zero. It needs PROJECT_AGGREGATIONS, which is not generally available and is granted manually by Instasent.

If what you want is a distribution over an attribute rather than a bespoke aggregation, /audience/coverage gives you one with the ordinary read scope, at the cost of being a probe: shape, possibly sampled, never a size.

What the plan lets you see

Two gates decide the fields on a returned contact, and both have to be open: the scopes on your token and the subscription plan of the organization.

LevelScopeFields returned
DefaultPROJECT_AUDIENCE_READFull name and user id only
BasicPROJECT_AUDIENCE_DATA_BASICPhone, email, country, name, boolean fields
FullPROJECT_AUDIENCE_DATA_FULLFull contact data including PII

A field missing from a response is far more often a plan or scope limit than an empty value. Before concluding the data is not there, check the level you are actually getting: contact data is redacted down, silently and by design, not refused. /audience/count is unaffected, because it returns no contact data at all.

What's next

  • Query filter: the filter these endpoints take, including cursor mechanics and aggregation shapes.
  • Segments: scrolling a saved segment, and reading its cached size.
  • Probes: check the filter is selecting on something real before you count it.

Last updated October 14, 2026

PreviousProbesNextSegments
  • Which endpoint for which question
  • Counting
  • Where a count drops: the ladder
  • Searching and scrolling
  • Retrieving one contact
  • Aggregations
  • What the plan lets you see
  • What's next

© 2026 Instasent

Privacy PolicyTerms & ConditionsCookie PolicyLegal Notice
All systems operational