/v1/contacts/countbetaCount 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://api.wa-api.cloud/v1/contacts/count?dnd=true' \ -H "Authorization: Bearer $API_KEY"
The code reads your key from $API_KEY.
Parameters
| Field | Type | What it is |
|---|---|---|
| query | string · query | Name or phone contains this text.1–100 characters |
| group_ids | array of string | integer · query | Contacts in ANY of these groups.0–50 items |
| tag_ids | array of string | integer · query | Contacts with ANY of these tags (repeat the parameter).0–50 itemsSigned in? Pick one from your data with “My data”. |
| starred | boolean · query | true = starred contacts only. |
| dnd | boolean · query | true = do-not-disturb on; false = can receive broadcasts. |
| not_in_any_group | boolean · query | true = contacts in no group. |
Headers
| Field | Type | What it is |
|---|---|---|
| Authorizationrequired | header | Bearer $API_KEY — your API key. |
| Api-Version | header | The 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.
| Field | Type | What it is |
|---|---|---|
| countrequired | integer | -9007199254740991–9007199254740991 |
| approximaterequired | boolean | true when the count is an estimate. |
| resolved_dates | array of object | Relative or local dates in filter and the absolute instants they were run with. |
| pathrequired | string | |
| inputrequired | string | |
| valuerequired | string | |
| warnings | array of object | Filter conditions that may not mean what they look like: {path, message}. |
| path | string | |
| messagerequired | string |
Errors
Errors are application/problem+json. Branch on code.
| Status | Code | When |
|---|---|---|
| 400 | invalid_input | A field is missing or has the wrong format. |
| 401 | unauthenticated | The Authorization header is missing, the key is unknown, expired or revoked, or the request came from an address outside the key's IP allowlist (checked on every operation, before anything runs). |
| 403 | entitlement_required | The workspace's plan does not include API access ( |
| 403 | insufficient_scope | The key does not have the permission this operation needs. Checked before the body and headers: without the permission, this is the answer whatever was sent. |
| 429 | rate_limited | The key or workspace went over its rate limit, or a service behind the API asked to slow down. Wait for |
| 503 | upstream_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.