# Call counts by state, outcome and direction

> GET /calls/stats. HeyRik API parameters and documented request and response examples.

Source: https://www.heyrik.com/docs/api-reference/analytics/get-calls-stats-call-counts-by-state-outcome-and-direction

GET https://server.heyrik.com/api/v1/calls/stats

## Headers

Authorization: Bearer $HEYRIK_API_KEY (required). Keep your key on your server.

## Request example

```sh
curl https://server.heyrik.com/api/v1/calls/stats \
  -H "Authorization: Bearer $HEYRIK_API_KEY"
```

## Response example

```json
{
  "data": {
    "total": 412,
    "connected": 355,
    "disconnected": 33,
    "byState": { "ENDED": 388, "FAILED": 24 },
    "byOutcome": { "resolved": 240, "callback": 88 },
    "byDirection": { "inbound": 210, "outbound": 202 }
  }
}
```
