Compare inbound and outbound calls

View as Markdown
Returns total calls, success rate, average duration and average sentiment separately for inbound calls, outbound calls and both together. Use it for the "inbound vs outbound" comparison; for the full KPI set of one direction call `GET /api/analytics/overview?direction=inbound`. **Filters.** Only `days` is honoured (rolling window ending now; a missing or out-of-range value becomes 30). `direction`, `campaignId`, `agentId` and `timezone` are ignored. This endpoint never answers `400`: if any query parameter fails validation (an unknown `direction`, a malformed `campaignId`, a `timezone` over 50 characters), the whole query is discarded and the window silently becomes **90** days. **How `total` is computed.** `totalCalls` is inbound + outbound. `successRate`, `avgDuration` and `avgSentiment` are weighted by the calls that carry each measurement, not averaged across the two directions. `avgDuration` covers completed calls on voice campaigns and calls without a campaign. **No data.** A direction without calls comes back as `totalCalls: 0`, `successRate: 0`, `avgDuration: null`, `avgSentiment: null`, `sentimentCallCount: 0`. **Idempotency.** Safe to retry: this is a read. **Consistency.** Cached for 120 seconds per workspace and window. No ETag. **Access** - **Required scope:** `read`. Signed-in users need the owner, admin, member or viewer role. - **Rate limit:** Analytics — 30 requests/min per workspace, in addition to the general API budget of your plan. See [Rate limits](/rate-limits). - **Plan:** Available on every plan. A workspace without an active subscription (active, trialing or past due) gets `403 BILLING_ERROR`.

Authentication

AuthorizationBearer
Workspace API key: `jl_` followed by 64 lowercase hex characters, created by the workspace owner in the dashboard (**Settings → API Keys**) and sent as `Authorization: Bearer jl_...`. The plaintext is shown once, at creation; Jelliu stores only a SHA-256 hash. A workspace can hold up to 25 active keys. | Scope | GET / HEAD | POST / PUT / PATCH / DELETE | Admin-only routes | | --- | --- | --- | --- | | `read` | Yes | No | No | | `write` | Yes | Yes | No | | `full` | Yes | Yes | Yes | Operations restricted to admins or owners reject keys without the `full` scope with `403`, and say so in their description. No key, whatever its scope, can mint or revoke API keys or rotate a webhook secret — that requires a signed-in owner session. A revoked key stops authenticating within about 10 seconds. See [Authentication](/authentication).

Query parameters

daysintegerOptional1-365Defaults to 30

Size of the reporting window in days, ending now. On most analytics routes a missing or out-of-range value falls back to 30 instead of being rejected; the operation says when it is strict.

Response

Metrics per direction and combined.
dataobjectOptional

Inbound, outbound and combined metrics. total weights each average by the calls that carry the measurement.

Errors

401
Unauthorized Error
403
Forbidden Error
429
Too Many Requests Error