VocalDocscontracts 1.65.0

Stage percentiles and ended reasons over the Calls of a window

GET /v1/analytics/latency

PropertyValue
Operationget_latency_report
GroupCall trace and analytics
Scopecalls:read
Route classread
IdempotencyNo Idempotency-Key
AuditNot audited: A metadata read; the report carries counts and timings only.
Released in1.9.0
Phase 0 hostServed (the hosted api pins 1.65.0)

Stage percentiles, ended reasons and per-Agent timings over the caller Turns of the ended Calls of a window (ADR 0063). From 1.57.0 (workspace ADR 0048, observability-and-analytics.md section 5) it reads the latency rollups: window=custom with from and to reads a range, hourly rows up to 35 days and daily rows beyond, at most 760 days (range_too_long); the filters narrow it; group_by groups by the fixed dimensions of ANALYTICS_DIMENSIONS_BY_REPORT.latency, any other answering 422 validation_failed and the issue dimension_not_supported; and the answer adds every stage with p50, p90, p95 and p99 computed from bucket counts, its Turn count, whether it is significant and its adherence to the target, with the bucket counts under include_buckets=true. Verbose and test Calls are left out unless selected. A request of 1.56.0 answers as before; the route keeps calls:read.

Request

Set VOCAL_API to the base URL of your API and VOCAL_API_KEY to an API key with the calls:read scope (Authentication and keys). Replace each placeholder, such as agt_... or <name>, with your own value.

curl "$VOCAL_API/v1/analytics/latency" \
  -H "Authorization: Bearer $VOCAL_API_KEY"

Parameters

NameInTypeRequiredDescription
windowqueryAnalyticsWindowno
fromqueryRequestTimestampnoWith window=custom, the start of the range, inclusive (1.57.0).
toqueryRequestTimestampnoWith window=custom, the end of the range, exclusive (1.57.0).
agent_idqueryAgentIdno
transportqueryCallTransportno
agent_versionqueryintegernoOnly the Calls pinned to this version of agent_id (1.57.0).
directionqueryCallDirectionnoOnly inbound or outbound Calls (1.57.0).
languagequeryLanguageTagnoOnly the Calls in this language (1.57.0).
environmentqueryEnvironmentnoOnly the Calls of this environment (1.57.0). Absent: the API key's environment, or live for a Member session; an API key reads its own environment only. test Calls are rated as live ones and never billed or counted.
providerqueryProviderIdnoOnly the Turns whose stage this Provider served (1.57.0).
stagequeryLatencyStagenoOnly this stage (1.57.0).
group_byqueryarray of stringnoThe fixed dimensions to group by, comma-separated, at most three (1.57.0). A dimension the route does not take is refused with 422 validation_failed and the issue dimension_not_supported.
include_bucketsqueryQueryFlagnotrue adds the sparse bucket counts of each stage (1.57.0).
include_verbosequeryQueryFlagnotrue counts verbose Calls too, which are left out by default (1.57.0).

Responses

StatusContent typeShapeError codes
200application/jsonLatencyReport
400application/jsonErrorEnvelopeinvalid_request
401application/jsonErrorEnvelopeunauthenticated
403application/jsonErrorEnvelopeforbidden
422application/jsonErrorEnvelopevalidation_failed
429application/jsonErrorEnveloperate_limited
500application/jsonErrorEnvelopeinternal_error

Fields of the 200 answer

The shape is LatencyReport.

FieldTypeRequiredDescription
by_agentarray of objectyes
callsintegeryesEnded Calls in the window.
ended_reasonsmap of integeryesThe number of ended Calls of the window by ended reason. Every reason is present, so the api fills 0 for a reason no Call ended with, the reasons added in 1.19.0 (canceled, worker_lost), in 1.21.0 (finalize_failed), in 1.22.0 (refused_concurrency, refused_suspended, refused_spend_cap, refused_no_route), in 1.32.0 (recording_announcement_failed, disclosure_failed) in 1.38.0 (refused_unpriced, stage_unpriced) in 1.48.0 (policy_load_failed) in 1.58.0 (workflow_complete, prompt_compose_failed, max_turns) and in 1.61.0 (refused_opted_out, refused_destination, refused_compliance, schedule_expired, busy) included; a reader on an older version that knows fewer reasons must take this version first.
endpoint_fallback_turnsintegeryes
fromstringyesThe start of the window, RFC 3339.
granularityAnalyticsGranularitynoThe rollup rows read. Added in 1.57.0 (roadmap slice 2.11); absent from an older api, which a reader treats as unknown.
groupsarray of LatencyGroupnoOne item per group of group_by; empty when the read named none. Added in 1.57.0 (roadmap slice 2.11); absent from an older api, which a reader treats as unknown.
interrupted_turnsintegeryes
object"latency_report"yes
stage_statsarray of LatencyStageStatsnoEvery stage with p50, p90, p95 and p99 from bucket counts, its Turn count and its adherence to the target. Added in 1.57.0 (roadmap slice 2.11); absent from an older api, which a reader treats as unknown.
stagesobjectyes
stages.endpoint_msPercentilesyes
stages.leading_silence_msPercentilesyes
stages.model_first_token_msPercentilesyes
stages.stt_final_msPercentilesyes
stages.tts_first_byte_msPercentilesyes
stages.voice_to_voice_internal_msPercentilesyes
tostringyesThe end of the window, RFC 3339.
turnsintegeryesCaller Turns with stage metrics.
verbose_includedbooleannoTrue when the read counted verbose Calls (include_verbose=true). Added in 1.57.0 (roadmap slice 2.11); absent from an older api, which a reader treats as unknown.
windowAnalyticsWindowyes