Skip to Content
Usage

Get workspace usage analytics

Permissionusage:readAuthentication
GET
/usage/analytics

Returns non-eval call, tool, webhook, and inference usage for the authenticated workspace. Defaults to the trailing 30 days. Supply range or from, never both; to is exclusive and cannot be in the future. Hour grain is limited to 45 days and every range is limited to 366 days. Series buckets are hour, day, week or month; week buckets start Monday. Custom from boundaries are exact, even when they fall inside a bucket. Call filters combine with AND across dimensions and OR within each comma-separated list (at most 50 values). Agent UUIDs include all historical versions. With call filters, tool/webhook counters and retained inference events are attributed through the selected sessions; unlinked requests and workspace-only request rollups are excluded. Phone filters cannot match anonymized calls after their phone fields are purged. Quota and live capacity endpoints always remain workspace-wide.

Authorization

bearerAuth
headerAuthorizationBearer <token>

Use a Voice API key or connected-app OAuth access token. Authentication.

Query Parameters

range?string
Default"30d"
Value in"24h""7d""30d""90d""12m"
from?string

Inclusive RFC3339 timestamp or YYYY-MM-DD. Mutually exclusive with range.

to?string

Exclusive RFC3339 timestamp or YYYY-MM-DD. Defaults to now and cannot be in the future.

grain?string

Bucket size for the series. Defaults according to the selected range (hour, day or month); week is available but never chosen for you, so an existing integration's buckets do not change shape. Week buckets start Monday.

Value in"hour""day""week""month"
agent_ids?array<>

Comma-separated agent UUIDs. Matches all versions of each agent.

Itemsitems <= 50
platform_numbers?array<>

Comma-separated exact platform phone numbers, including the leading plus.

Itemsitems <= 50
caller_number?string

Literal substring of the customer phone number; percent and underscore are not wildcards.

Length1 <= length <= 100
directions?array<>

Comma-separated allowed values; OR within this dimension.

Itemsitems <= 50
channels?array<>

Comma-separated allowed values; OR within this dimension.

Itemsitems <= 50
handled_by?array<>

Comma-separated allowed values; OR within this dimension.

Itemsitems <= 50
statuses?array<>

Comma-separated allowed values; OR within this dimension.

Itemsitems <= 50

Response Body

Eval-free analytics totals and time series for this workspace.

application/json
  1. response
from*string
Formatdate-time
to*string
Formatdate-time
grain*string
Value in"hour""day""week""month"
scope*
totals*
series*array<>
Example Request
curl -X GET 'https://api.kejue.co/v1/usage/analytics'
Example Response
{  "from": "2019-08-24T14:15:22Z",  "to": "2019-08-24T14:15:22Z",  "grain": "hour",  "scope": {    "kind": "org",    "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",    "org_name": "string"  },  "totals": {    "calls": 0,    "failed_calls": 0,    "answered_calls": 0,    "call_failure_rate": 0,    "call_minutes": 0,    "avg_minutes_per_call": 0,    "active_live_calls": 0,    "peak_concurrent_calls": 0,    "tool_calls": 0,    "tool_failures": 0,    "tool_failure_rate": 0,    "webhook_deliveries": 0,    "webhook_failures": 0,    "webhook_failure_rate": 0,    "usage_events": 0,    "usage_failures": 0,    "usage_failure_rate": 0,    "total_tokens": 0,    "audio_minutes": 0,    "tts_characters": 0,    "failover_events": 0,    "p95_usage_latency_ms": 0,    "p95_voice_response_latency_ms": 0,    "p95_voice_slm_ttft_ms": 0,    "avg_slm_duty_cycle": 0,    "avg_duty_cycle": 0  },  "series": [    {      "bucket_start": "2019-08-24T14:15:22Z",      "calls": 0,      "failed_calls": 0,      "call_minutes": 0,      "concurrent_calls": 0,      "slm_duty_cycle": 0,      "tool_calls": 0,      "tool_failures": 0,      "webhook_deliveries": 0,      "webhook_failures": 0,      "usage_events": 0,      "usage_failures": 0    }  ]}