/v1/contacts/countbetaCount contacts by filter
- 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 the contacts an advanced filter (the Search contacts format) or a saved filter matches, without listing them. approximate is true when the number is an estimate.
Try it
This only reads. It uses your real data and changes nothing.
Code and response
curl -X POST 'https://mcp.wa-api.cloud/v1/contacts/count' \
-H "Authorization: Bearer $API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"filter": {
"broadcasts": {
"some": {
"id": {
"eq": "88"
},
"message_status": {
"eq": "not_responded"
}
}
}
}
}'The code reads your key from $API_KEY.
Body
| Field | Type | What it is |
|---|---|---|
| filter | object | The advanced filter (see Search contacts). |
| saved_filter_id | string | integer | Count the contacts of a saved contact filter.pattern ^[1-9]\d{0,18}$ |
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. |
| 403 | entitlement_required | The workspace's plan does not include API access ( |
| 403 | forbidden | The filter or sort compares phone numbers, which are hidden from this staff member ( |
| 403 | insufficient_scope | The key does not have the permission this operation needs. |
| 404 | not_found | A saved filter it names does not exist in your workspace ( |
| 429 | rate_limited | The key or workspace went over its rate limit. Wait for |
| 502 | upstream_error | The contacts service could not run this filter ( |
| 503 | service_unconfigured | Advanced filters are switched off on this server ( |
| 503 | upstream_unavailable | A service behind the API is briefly unavailable. Safe to retry with backoff. |
| 504 | timeout | The filter took too long to run ( |
Examples
Contacts that read broadcast 88 but did not reply
Request body
{
"filter": {
"broadcasts": {
"some": {
"id": {
"eq": "88"
},
"message_status": {
"eq": "not_responded"
}
}
}
}
}Response 200
{
"count": 412,
"approximate": false
}Operation path
The same operation is also at POST /v1/ops/crm_count_contacts, with every field in the JSON body.