VocalDocscontracts 1.65.0

Send a test event to a Webhook subscription

POST /v1/webhooks/{webhook_id}/test

PropertyValue
Operationtest_webhook
GroupWebhooks
Scopewebhooks:write
Route classcontrol
IdempotencyIdempotency-Key accepted: a retry with the same key replays the first answer
AuditAudited webhooks.subscription.test (mutation)
Released in1.63.0
Phase 0 hostServed (the hosted api pins 1.65.0)

Sends an obviously synthetic webhook.test event to this subscription through the production path, the same queue, signature, egress guard and delivery log, and answers 202 with the delivery pending (1.63.0; api.md section 7). The event reaches no other subscription and no event log. A subscription that is not active is 409 webhook_not_active, its status the detail's reason. From 1.64.0, stated as the api built it: since the test event takes no place in the log, its envelope carries the Organization's latest relayed sequence, at least 1, rather than one of its own, with livemode false and the delivery's event id and instant, so a receiver that discards stale updates by sequence must not treat a test as one.

Request

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

curl -X POST "$VOCAL_API/v1/webhooks/whk_.../test" \
  -H "Authorization: Bearer $VOCAL_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

Parameters

NameInTypeRequiredDescription
webhook_idpathWebhookIdyesThe id of a Webhook subscription: whk_ 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.

Responses

StatusContent typeShapeError codes
202application/jsonWebhookDelivery
400application/jsonErrorEnvelopeinvalid_request
401application/jsonErrorEnvelopeunauthenticated
403application/jsonErrorEnvelopeforbidden, org_suspended
404application/jsonErrorEnvelopenot_found
409application/jsonErrorEnvelopeidempotency_in_progress, idempotency_key_reused, webhook_not_active
429application/jsonErrorEnveloperate_limited
500application/jsonErrorEnvelopeinternal_error

Fields of the 202 answer

The shape is WebhookDelivery.

FieldTypeRequiredDescription
attemptintegeryesThe attempts made so far.
created_atTimestampyes
duration_msinteger or nullyesThe last attempt's duration, a measurement; null before the first.
environmentEnvironmentyes
error_codestring or nullyesWhy the last attempt did not succeed, a WebhookDeliveryErrorCode value; null after a success.
event_idEventIdyes
event_typestringyesThe type of the event sent.
idWebhookDeliveryIdyes
kindWebhookDeliveryKindyes
last_attempt_atTimestamp or nullyes
next_attempt_atTimestamp or nullyesWhen the next attempt is due.
object"webhook_delivery"yes
replay_job_idJobId or nullyesThe replay job; null for any other kind.
response_statusinteger or nullyesThe last attempt's HTTP status; null when no answer came.
statusWebhookDeliveryStatusyes
webhook_idWebhookIdyes