VocalDocscontracts 1.65.0

Open a verbose capture window on an Agent

POST /v1/agents/{agent_id}/capture-windows

PropertyValue
Operationcreate_capture_window
GroupCapture windows and reveal grants
Scopeagents:write
Route classcontrol
IdempotencyIdempotency-Key required: a retry with the same key replays the first answer
AuditAudited capture_window.create (mutation)
Released in1.57.0
Phase 0 hostServed (the hosted api pins 1.65.0)

Opens a window during which dispatch makes each admitted Call of the Agent (one version of it, when named) in the window's environment verbose, inbound Calls included, until the window ends or has captured max_calls Calls (1.57.0). Refused with 403 capture_not_allowed when the Compliance profile's verbose_capture is off, or test_only for a live window, and with 404 not_found for an Agent of another Organization or an agent_version the Agent has not published. The Audit event capture_window.create records the window, never its reason.

Request

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

curl -X POST "$VOCAL_API/v1/agents/agt_.../capture-windows" \
  -H "Authorization: Bearer $VOCAL_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{ "environment": "live", "reason": "<reason>" }'

Parameters

NameInTypeRequiredDescription
agent_idpathAgentIdyesThe id of an Agent: agt_ 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: CaptureWindowCreateRequest.

FieldTypeRequiredDescription
agent_versionintegernoOnly Calls pinned to this published version; every version of the Agent when absent.
duration_minutesintegernoHow long the window stays open: 1 to 1,440 minutes (24 hours, a target), 60 when absent.
environmentEnvironmentyesThe environment whose Calls the window captures. A developer opens test windows only (forbidden, detail owner_or_admin_required); from 1.58.0 the contracts state that an API key opens one in its own environment only (forbidden, detail environment_not_grantable), as it starts Calls there.
max_callsintegernoThe most Calls the window captures: 1 to 200 (a target), 200 when absent.
reasonstringyesWhy the window is opened, for the access review: free text, stored as a content pair and scrubbed at retention_days.
starts_atRequestTimestampnoWhen the window starts; now when absent. An instant in the past is now.

Responses

StatusContent typeShapeError codes
201application/jsonCaptureWindow
400application/jsonErrorEnvelopeinvalid_request
401application/jsonErrorEnvelopeunauthenticated
403application/jsonErrorEnvelopeforbidden, org_suspended, capture_not_allowed
404application/jsonErrorEnvelopenot_found
409application/jsonErrorEnvelopeidempotency_in_progress, idempotency_key_reused
422application/jsonErrorEnvelopevalidation_failed
429application/jsonErrorEnveloperate_limited
500application/jsonErrorEnvelopeinternal_error

Fields of the 201 answer

The shape is CaptureWindow.

FieldTypeRequiredDescription
agent_idAgentIdyes
agent_versioninteger or nullyesThe one version the window captures; null for every version.
calls_capturedintegeryesThe Calls the window made verbose so far.
closed_atTimestamp or nullyesWhen a Member closed the window early.
closed_byActorRef or nullyes
created_atTimestampyes
created_byActorRefyes
ends_atTimestampyesstarts_at plus the duration; at most 24 hours later.
environmentEnvironmentyes
idCaptureWindowIdyes
max_callsintegeryes
object"capture_window"yes
reasonstring or nullnoWhy the window is opened, for the access review: free text, stored as a content pair and scrubbed at retention_days. Answered only by GET /v1/agents/{agent_id}/capture-windows/{capture_window_id}, an audited content read; null once scrubbed.
starts_atTimestampyes
statusCaptureWindowStatusyes