VocalDocscontracts 1.65.0

Close a capture window now

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

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

Closes a scheduled or open window at once (1.57.0): no later Call is made verbose by it, and Calls already admitted keep their capture. A window that is ended or closed answers 409 capture_window_closed.

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/cpw_.../close" \
  -H "Authorization: Bearer $VOCAL_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'

Parameters

NameInTypeRequiredDescription
agent_idpathAgentIdyesThe id of an Agent: agt_ and the row's UUIDv7 in 26 Crockford base32 characters. Opaque and safe to log.
capture_window_idpathCaptureWindowIdyesThe id of a verbose capture window on an Agent: cpw_ and the row's UUIDv7 in 26 Crockford base32 characters. Opaque and safe to log.
idempotency-keyheaderstringnoA client-chosen key, kept 24 hours per Organization, environment and route. A replay returns the stored response.

Request body

Content type application/json, required: CaptureWindowCloseRequest.

Responses

StatusContent typeShapeError codes
200application/jsonCaptureWindow
400application/jsonErrorEnvelopeinvalid_request
401application/jsonErrorEnvelopeunauthenticated
403application/jsonErrorEnvelopeforbidden, org_suspended
404application/jsonErrorEnvelopenot_found
409application/jsonErrorEnvelopecapture_window_closed
429application/jsonErrorEnveloperate_limited
500application/jsonErrorEnvelopeinternal_error

Fields of the 200 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