Skip to navigation

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. days sets the rolling window ending now (a missing or out-of-range value becomes 30). campaignId and agentId scope all three blocks to one campaign or to the agent that handled each call. direction and timezone do not change the result (the response is already split by direction and has no day buckets), but they are still validated. A malformed query is refused with 400, never answered with unfiltered numbers: an unknown direction, a campaignId or agentId that is not a UUID, or a timezone over 50 characters.

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, window, campaign and agent. 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.
  • Plan: Available on every plan. Requires an active subscription (active, trialing or past_due); without one the request is refused with 403 BILLING_ERROR (metadata.kind: subscription_required).

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.

ScopeGET / HEADPOST / PUT / PATCH / DELETEAdmin-only routes
readYesNoNo
writeYesYesNo
fullYesYesYes

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.

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.

campaignIdstringOptionalformat: "uuid"
Scope every number to one campaign of the workspace. Omit it to aggregate across all campaigns and manual calls.
agentIdstringOptionalformat: "uuid"

Scope every number to one agent — the agent that served each call, so manual (campaign-less) calls count. Omit it to aggregate across agents.

Response

Metrics per direction and combined.
dataobjectOptional

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

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
429
Too Many Requests Error