VocalDocscontracts 1.65.0

Update a pre-call hook

PATCH /v1/pre-call-hooks/{hook_id}

PropertyValue
Operationupdate_pre_call_hook
GroupPre-call hooks
Scopehooks:write
Route classcontrol
IdempotencyNo Idempotency-Key
AuditAudited dispatch.pre_call_hook.update (mutation)
Released in1.52.0
Phase 0 hostServed (the hosted api pins 1.65.0)

Replaces the named fields at the revision If-Match names (1.52.0); the next Call reads them, within the 10-second cache of the api processes (a target). The scope never changes. The URL passes the egress guard (egress_denied with its reason), and every issue is a detail of 422 validation_failed (PreCallHookIssueCode).

Request

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

curl -X PATCH "$VOCAL_API/v1/pre-call-hooks/pch_..." \
  -H "Authorization: Bearer $VOCAL_API_KEY" \
  -H 'If-Match: "1"' \
  -H "Content-Type: application/json" \
  -d '{}'

Parameters

NameInTypeRequiredDescription
hook_idpathPreCallHookIdyesThe id of a pre-call hook: pch_ and the row's UUIDv7 in 26 Crockford base32 characters. Opaque and safe to log.
if-matchheaderstringyesThe revision the change was made against, quoted as the ETag returns it, or * to overwrite.

Request body

Content type application/json, required: PreCallHookUpdateRequest.

FieldTypeRequiredDescription
allowed_agent_idsarray of AgentIdno
defaultPreCallHookAcceptInput or nullno
directionsarray of PreCallHookDirectionno
on_failurePreCallHookOnFailureno
statusone of "active", "paused"nodegraded is set by the platform.
timeout_msinteger or nullno
urlstring (uri)noThe endpoint: https, a public name, no IP literal and no embedded credentials, checked by the egress guard at save and at every request.

Responses

StatusContent typeShapeError codes
200application/jsonPreCallHook
400application/jsonErrorEnvelopeinvalid_request
401application/jsonErrorEnvelopeunauthenticated
403application/jsonErrorEnvelopeforbidden, org_suspended
404application/jsonErrorEnvelopenot_found
412application/jsonErrorEnveloperevision_mismatch
422application/jsonErrorEnvelopevalidation_failed
428application/jsonErrorEnvelopeprecondition_required
429application/jsonErrorEnveloperate_limited
500application/jsonErrorEnvelopeinternal_error

Fields of the 200 answer

The shape is PreCallHook.

FieldTypeRequiredDescription
allowed_agent_idsarray of AgentIdyesAgents besides the routed one whose published versions a response may select; empty allows only versions of the routed Agent.
consecutive_failuresintegeryes
created_atTimestampyes
defaultPreCallHookDefault or nullyes
directionsarray of PreCallHookDirectionyes
idPreCallHookIdyes
object"pre_call_hook"yes
on_failurePreCallHookOnFailureyes
phi_attested_atTimestamp or nullyesWhen an owner attested the endpoint for PHI; null before.
phi_attested_byMemberId or nullyes
previous_secret_expires_atTimestamp or nullyes
previous_secret_hintstring or nullyes
revisionintegeryes
scopePreCallHookScopeyes
secret_hintstringyesThe last four characters of the current secret.
statusPreCallHookStatusyes
timeout_msinteger or nullyesThe deadline of a request; null for the default of each direction.
updated_atTimestampyes
urlstringyesThe endpoint.