Replay the events of a time window to a Webhook subscription
POST /v1/webhooks/{webhook_id}/replay
| Property | Value |
|---|---|
| Operation | replay_webhook |
| Group | Webhooks |
| Scope | webhooks:write |
| Route class | control |
| Idempotency | Idempotency-Key required: a retry with the same key replays the first answer |
| Audit | Audited webhooks.replay (mutation) |
| Released in | 1.52.0 |
| Phase 0 host | Served (the hosted api pins 1.65.0) |
Creates a webhook.replay job (1.52.0, ADR 0051 rule 6) that re-sends, in sequence order, every event of the 30-day log created in [from, to) that the subscription matches now, narrowed by types; each delivery keeps its event id and carries Vocal-Replay: true, and no effect inside Vocal runs again. Answers 202 with the job and its Location. The window is checked first (ReplayWindowIssueCode): replay_window_inverted, replay_window_out_of_range and, past 10,000 matching events (a target), replay_window_too_large. A second replay while one is queued or running is 409 replay_in_progress. The Audit event webhooks.replay records the subscription, the window and the types. The subscription is a resource of slice 2.5: until it exists every webhook_id is not_found, and slice 2.5 adds the event_id form of the body. From 1.63.0 the subscriptions exist (create_webhook), the body may instead name one event_id, a job of that one event that re-sends it under its own id, at most ten times per event and subscription (WebhookReplayEventIssueCode), and a subscription that is not active is refused with 409 webhook_not_active.
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_.../replay" \
-H "Authorization: Bearer $VOCAL_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{ "from": "2026-10-07T14:02:11.408Z", "to": "2026-10-07T14:02:11.408Z" }'const response = await fetch(`${process.env.VOCAL_API}/v1/webhooks/whk_.../replay`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.VOCAL_API_KEY}`,
'Idempotency-Key': crypto.randomUUID(),
'Content-Type': 'application/json',
},
body: JSON.stringify({
"from": "2026-10-07T14:02:11.408Z",
"to": "2026-10-07T14:02:11.408Z"
}),
});
console.log(response.status, await response.text());import os
import uuid
import requests
response = requests.post(
f"{os.environ['VOCAL_API']}/v1/webhooks/whk_.../replay",
headers={
"Authorization": f"Bearer {os.environ['VOCAL_API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"from": "2026-10-07T14:02:11.408Z",
"to": "2026-10-07T14:02:11.408Z",
},
)
print(response.status_code, response.text)Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
webhook_id | path | WebhookId | yes | The id of a Webhook subscription: whk_ and the row's UUIDv7 in 26 Crockford base32 characters. Opaque and safe to log. |
idempotency-key | header | string | yes | A client-chosen key, kept 24 hours per Organization, environment and route. A replay returns the stored response. |
Request body
Content type application/json, required: WebhookReplayRequest.
Responses
| Status | Content type | Shape | Error codes |
|---|---|---|---|
202 | application/json | Job | |
400 | application/json | ErrorEnvelope | invalid_request |
401 | application/json | ErrorEnvelope | unauthenticated |
403 | application/json | ErrorEnvelope | forbidden, org_suspended |
404 | application/json | ErrorEnvelope | not_found |
409 | application/json | ErrorEnvelope | replay_in_progress, webhook_not_active, idempotency_in_progress, idempotency_key_reused |
422 | application/json | ErrorEnvelope | validation_failed |
429 | application/json | ErrorEnvelope | rate_limited |
500 | application/json | ErrorEnvelope | internal_error |
Fields of the 202 answer
The shape is Job.
| Field | Type | Required | Description |
|---|---|---|---|
created_at | Timestamp | yes | |
created_by | ActorRef | yes | |
error | JobError or null | yes | Why the job failed, a code and a message; null otherwise. |
finished_at | Timestamp or null | yes | |
has_result_file | boolean | yes | True when the result is a file, fetched through POST /v1/jobs/{job_id}/result-url. |
id | JobId | yes | |
object | "job" | yes | |
progress | JobProgress | yes | |
resource | JobResource or null | yes | |
result | JobResult or null | yes | A small result inline once succeeded, typed by the job type (WebhookReplayJobResult for webhook.replay, from 1.53.0 KnowledgeEvaluationJobResult for knowledge.evaluation, from 1.55.0 PromptEvalRunJobResult for prompt.evaluation and agent.conversation_test, from 1.56.0 AnalysisJobResult for call.analyze); null before. |
started_at | Timestamp or null | yes | |
status | JobStatus | yes | |
type | JobType | yes |