Skip to content
API PlatformDevelopers
GET/v1/contacts/countbeta

Count contacts

Needs
Read your data (mcp:read)
Plan
Any plan with API access
Limits
300 a minute per key
Undo
Nothing to undo: this only reads.

Counts contacts that match the same filters as List contacts, without listing them. Handy before a big sync.

Try it

Query (6)

Name or phone contains this text.

Contacts in ANY of these groups.

Contacts with ANY of these tags (repeat the parameter).

`true` = starred contacts only.

`true` = do-not-disturb on; `false` = can receive broadcasts.

`true` = contacts in no group.

This only reads. It uses your real data and changes nothing.

Code and response

curl -X GET 'https://mcp.wa-api.cloud/v1/contacts/count?dnd=true' \
  -H "Authorization: Bearer $API_KEY"

The code reads your key from $API_KEY.

Parameters

Parameters
FieldTypeWhat it is
querystring · queryName or phone contains this text.1–100 characters
group_idsarray of string | integer · queryContacts in ANY of these groups.0–50 items
tag_idsarray of string | integer · queryContacts with ANY of these tags (repeat the parameter).0–50 itemsSigned in? Pick one from your data with “My data”.
starredboolean · querytrue = starred contacts only.
dndboolean · querytrue = do-not-disturb on; false = can receive broadcasts.
not_in_any_groupboolean · querytrue = contacts in no group.

Headers

Headers
FieldTypeWhat it is
AuthorizationrequiredheaderBearer $API_KEY — your API key.
Api-VersionheaderThe API version to use, e.g. 2026-10-01. Default: the version your key is pinned to.one of: 2026-10-01 · pattern ^\d{4}-\d{2}-\d{2}$

Response 200

The count.

Response fields
FieldTypeWhat it is
countrequiredinteger-9007199254740991–9007199254740991
approximaterequiredbooleantrue when the count is an estimate.
resolved_datesarray of objectRelative or local dates in filter and the absolute instants they were run with.
pathrequiredstring
inputrequiredstring
valuerequiredstring
warningsarray of objectFilter conditions that may not mean what they look like: {path, message}.
pathstring
messagerequiredstring

Errors

Errors are application/problem+json. Branch on code.

StatusCodeWhen
400invalid_input

A field is missing or has the wrong format. errors[] points at each field.

401unauthenticated

The Authorization header is missing, the key is unknown, expired or revoked.

403entitlement_required

The workspace's plan does not include API access (api_access).

403insufficient_scope

The key does not have the permission this operation needs.

429rate_limited

The key or workspace went over its rate limit. Wait for Retry-After seconds.

503upstream_unavailable

A service behind the API is briefly unavailable. Safe to retry with backoff.

Examples

How many contacts opted out

Response 200

{
  "count": 312,
  "approximate": false
}

Operation path

The same operation is also at POST /v1/ops/crm_count_contacts, with every field in the JSON body.