Skip to navigation

Get traffic split metrics

Beta

Per-assistant-version call metrics over a time window: call counts, configured vs actual traffic share, duration, cost per minute, latency, ended reasons, a bucketed timeseries, and optional structured output aggregations. Calls with no assistant version are reported as an ‘unversioned’ row. Traffic splitting is in beta, rolling out to select organizations; requests from organizations without access receive a 403.

Authentication

AuthorizationBearer

Authenticate server-side requests with a private Vapi API key. Create or copy a key from the Vapi Dashboard and send it in the Authorization header as Bearer <token>. Keep private API keys out of client-side code and public repositories.

Query parameters

assistantIdstringRequired

The assistant whose per-version traffic metrics to return.

fromdatetimeRequired

Start of the metrics window (inclusive), ISO 8601 datetime.

todatetimeRequired

End of the metrics window (exclusive), ISO 8601 datetime. Must be later than from, and the window may hold at most 2000 buckets of the requested width.

bucketenumOptional
Bucket size for the timeseries. Defaults to 'day'.
Allowed values:
structuredOutputIdslist of anyOptional

Structured output ids to aggregate per version, as an array or a comma-separated string. At most 5.

Response

windowobject
totalCallsdouble
All calls for the assistant in the window, every version.
versionslist of objects

One row per version with calls in the window, plus the unversioned row when it has any. Ordered by calls descending, then by version label (numeric-aware), the unversioned row last among equals.

currentAllocationobject or nullOptional
The allocation currently governing the assistant. Null when traffic splitting was never configured.

Errors

400
Bad Request Error
403
Forbidden Error