VocalDocscontracts 1.65.0

Run analyzers again over a Call

POST /v1/calls/{call_id}/analyses

PropertyValue
Operationcreate_call_analysis
GroupOutcomes and analyses
Scopecalls:write
Route classcontrol
IdempotencyIdempotency-Key required: a retry with the same key replays the first answer
AuditAudited call.analysis.create (mutation)
Released in1.56.0
Phase 0 hostServed (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 '{}'

Parameters

NameInTypeRequiredDescription
call_idpathCallIdyesThe id of a Call: call_ and the row's UUIDv7 in 26 Crockford base32 characters. Opaque and safe to log.
idempotency-keyheaderstringyesA 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.

FieldTypeRequiredDescription
analyzersarray of AnalyzerKeynoThe 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

StatusContent typeShapeError codes
202application/jsonAnalysisRerun
400application/jsonErrorEnvelopeinvalid_request
401application/jsonErrorEnvelopeunauthenticated
402application/jsonErrorEnvelopespend_cap_reached
403application/jsonErrorEnvelopeforbidden, org_suspended
404application/jsonErrorEnvelopenot_found
409application/jsonErrorEnvelopetranscript_unavailable, idempotency_in_progress, idempotency_key_reused
422application/jsonErrorEnvelopevalidation_failed, capability_not_available
429application/jsonErrorEnveloperate_limited
500application/jsonErrorEnvelopeinternal_error

Fields of the 202 answer

The shape is AnalysisRerun.

FieldTypeRequiredDescription
analysesarray of AnalysisyesThe new runs, pending.
call_idCallIdyes
job_idJobIdyesThe call.analyze job that runs them.
object"analysis_rerun"yes