Run analyzers again over a Call
POST /v1/calls/{call_id}/analyses
| Property | Value |
|---|---|
| Operation | create_call_analysis |
| Group | Outcomes and analyses |
| Scope | calls:write |
| Route class | control |
| Idempotency | Idempotency-Key required: a retry with the same key replays the first answer |
| Audit | Audited call.analysis.create (mutation) |
| Released in | 1.56.0 |
| Phase 0 host | Served (the hosted api pins 1.65.0) |
Schedules a new run of the named analyzers, or of every analyzer the Call's Agent version binds, over the Call's stored transcript as a call.analyze job, and answers 202 with the analyses pending (1.56.0; workspace ADR 0052 decisions 8 and 9). A Call with no stored transcript, not finalized, scrubbed or of an Organization whose retention keeps none, is 409 transcript_unavailable with its reason. A reserved analyzer is 422 capability_not_available with analyzer_kind_not_available; the other issues are validation_failed, from 1.58.0 with the codes of AnalysisRerunIssueCode: analysis_none_bound when no analyzer is named and the Agent version binds none. A re-run is priced at the price in force when it is requested and checks the spend cap (402 spend_cap_reached), where scheduled analyses run past it. Each settled run emits analysis.completed or analysis.failed, and call.analyzed fires again once the re-run settles.
Request
Set VOCAL_API to the base URL of your API and VOCAL_API_KEY to an API key with the calls:write scope (Authentication and keys). Replace each placeholder, such as agt_... or <name>, with your own value.
curl -X POST "$VOCAL_API/v1/calls/call_.../analyses" \
-H "Authorization: Bearer $VOCAL_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{}'const response = await fetch(`${process.env.VOCAL_API}/v1/calls/call_.../analyses`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.VOCAL_API_KEY}`,
'Idempotency-Key': crypto.randomUUID(),
'Content-Type': 'application/json',
},
body: JSON.stringify({}),
});
console.log(response.status, await response.text());import os
import uuid
import requests
response = requests.post(
f"{os.environ['VOCAL_API']}/v1/calls/call_.../analyses",
headers={
"Authorization": f"Bearer {os.environ['VOCAL_API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={},
)
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. |
idempotency-key | header | string | yes | A client-chosen key, kept 24 hours per Organization, environment and route. A replay returns the stored response. |
Request body
Content type application/json, required: AnalysisRequest.
| Field | Type | Required | Description |
|---|---|---|---|
analyzers | array of AnalyzerKey | no | The analyzers to run again; every analyzer the Call's Agent version binds when omitted. A reserved analyzer is 422 capability_not_available (analyzer_kind_not_available); an unknown key analyzer_unknown, and outcomes on a version without an Outcome schema analysis_outcomes_without_schema. |
Responses
| Status | Content type | Shape | Error codes |
|---|---|---|---|
202 | application/json | AnalysisRerun | |
400 | application/json | ErrorEnvelope | invalid_request |
401 | application/json | ErrorEnvelope | unauthenticated |
402 | application/json | ErrorEnvelope | spend_cap_reached |
403 | application/json | ErrorEnvelope | forbidden, org_suspended |
404 | application/json | ErrorEnvelope | not_found |
409 | application/json | ErrorEnvelope | transcript_unavailable, idempotency_in_progress, idempotency_key_reused |
422 | application/json | ErrorEnvelope | validation_failed, capability_not_available |
429 | application/json | ErrorEnvelope | rate_limited |
500 | application/json | ErrorEnvelope | internal_error |
Fields of the 202 answer
The shape is AnalysisRerun.