Get Call Count
Revision as of 15:38, 21 July 2026 by Ashley DeBon (talk | contribs) (Created page with "== Get Call Count == === Base URL === https://apimobile.callproof.com === Endpoint === /api/ai/chat-bot/get-call-count === Purpose === Returns call statistics for a user wi...")
Contents
Get Call Count
Base URL
https://apimobile.callproof.com
Endpoint
/api/ai/chat-bot/get-call-count
Purpose
Returns call statistics for a user within a date range. You can request Twilio calls only, native device calls only, or overall totals broken down by call type (incoming, outgoing, missed, unknown).
HTTP Method
POST
Headers
| Header | Required | Description |
|---|---|---|
| Authorization | Yes | Bearer access token |
Security
- Yes – Requires Bearer Token authentication.
Parameters
Path Parameters
None.
Query Parameters
None.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| userId | integer | Yes | User whose calls should be counted |
| companyId | integer | Yes | Company identifier used to scope the call records |
| startDate | string | Yes | Start date in Y-m-d format
|
| endDate | string | Yes | End date in Y-m-d format
|
| callType | string | No | Call source filter: TWILIO, NORMAL, or ALL (default: ALL)
|
Successful Response (200)
Returns call counts for the requested range.
| Field | Type | Description |
|---|---|---|
| clientStatusCode | integer | Status indicator for the client (for example, 200) |
| user_id | integer | Identifier of the authenticated user |
| company_id | integer | Identifier of the authenticated user’s company |
| data | integer/object | Call count payload (shape depends on callType)
|
| uri | string | Requested resource URI |
data when callType is TWILIO or NORMAL
| Field | Type | Description |
|---|---|---|
| (integer) | integer | Total number of matching calls |
data when callType is ALL (default)
| Field | Type | Description |
|---|---|---|
| twilio | integer | Total Twilio calls |
| native | integer | Total native/device calls |
| incomming | object | Incoming call counts by source (twilio, native, total)
|
| outgoing | object | Outgoing call counts by source (twilio, native, total)
|
| missed | object | Missed call counts by source (twilio, native, total)
|
| unknown | object | Unknown call-type counts by source (twilio, native, total)
|
| total | integer | Combined Twilio + native call total |
Error Responses
| Status Code | Meaning |
|---|---|
| 200 | Validation failed – response body uses clientStatusCode 422 with the first validation error message
|
| 400 | Bad Request – call counts could not be retrieved |
| 401 | Unauthorized – missing, invalid, or expired Bearer token |
- Validation (HTTP 200, clientStatusCode 422) – Missing/invalid
userId,companyId,startDate,endDate, or invalidcallType. - 400 – Invalid parameters ("Invalid input parameters.") or failure fetching counts ("Failed to fetch call count.").
- 401 – Authentication failed or the access token is missing/expired.