Compare a Call with another Call or with its baseline
GET /v1/calls/{call_id}/compare
| Property | Value |
|---|---|
| Operation | compare_calls |
| Group | Call trace and analytics |
| Scope | calls:read |
| Route class | read |
| Idempotency | No Idempotency-Key |
| Audit | Not audited: A metadata read; a comparison carries numbers and ids only. |
| Released in | 1.57.0 |
| Phase 0 host | Served (the hosted api pins 1.65.0) |
Aligns this finalized Call with with, another finalized Call of the Organization, Turn by Turn, and answers each pair's stage, Provider, Policy and cost deltas (1.57.0); with=baseline compares each Turn with the trailing 7-day percentiles of the Call's Agent version, from the rollups. A Call of another Organization, or one not yet finalized, is not found. align=state was refused with 422 capability_not_available and the detail align_state_not_available in 1.57.0; from 1.58.0 (roadmap slice 2.12) it pairs the Turns of two Calls by the speaker state each ran in, and only with=baseline&align=state is refused that way, because the rollups keep no state. The cost deltas need usage:read and are null without it.
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/calls/call_.../compare?with=call_..." \
-H "Authorization: Bearer $VOCAL_API_KEY"const response = await fetch(`${process.env.VOCAL_API}/v1/calls/call_.../compare?with=call_...`, {
headers: {
Authorization: `Bearer ${process.env.VOCAL_API_KEY}`,
},
});
console.log(response.status, await response.text());import os
import requests
response = requests.get(
f"{os.environ['VOCAL_API']}/v1/calls/call_.../compare",
params={
"with": "call_...",
},
headers={
"Authorization": f"Bearer {os.environ['VOCAL_API_KEY']}",
},
)
print(response.status_code, response.text)Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
call_id | path | CallId | yes | The id of a Call: call_ and the row's UUIDv7 in 26 Crockford base32 characters. Opaque and safe to log. |
with | query | CallId or "baseline" | yes | Another finalized Call of the Organization, or baseline for the trailing 7-day percentiles of this Call's Agent version. |
align | query | CompareAlign | no |
Responses
| Status | Content type | Shape | Error codes |
|---|---|---|---|
200 | application/json | CallComparison | |
400 | application/json | ErrorEnvelope | invalid_request |
401 | application/json | ErrorEnvelope | unauthenticated |
403 | application/json | ErrorEnvelope | forbidden |
404 | application/json | ErrorEnvelope | not_found |
422 | application/json | ErrorEnvelope | capability_not_available |
429 | application/json | ErrorEnvelope | rate_limited |
500 | application/json | ErrorEnvelope | internal_error |
Fields of the 200 answer
The shape is CallComparison.
| Field | Type | Required | Description |
|---|---|---|---|
align | CompareAlign | yes | |
baseline | CompareBaseline or null | yes | The baseline; null against a Call. |
call_id | CallId | yes | |
object | "call_comparison" | yes | |
other_call_id | CallId or null | yes | The other Call; null against the baseline. |
turns | array of ComparedTurn | yes |