Attach a webhook
The webhook is a single message: aurl, an events list, and a status. The
two legal events are run.completed and run.failed, and the list must name
at least one.
run.completed fires whenever any search request succeeded, so it covers a
partial run too; only a run where every request failed sends run.failed, and a
skipped run sends nothing. Read the run’s status to tell which — see
Reference.
status may be omitted at create time; the server sets the webhook active.
Deliveries
The request body is{"event": ..., "run": ...}. It carries the run, not the
records — fetch those with the record cursor described in
Read records. The run is the same object
GET /v1/monitors/{monitor_id}/runs/{run_id} returns; the example below shows
only some of its fields.
run_id.
Deliveries are signed following the
Standard Webhooks specification. Each one
carries three headers:
Verify a delivery
Verify before trusting the payload. Use the Standard Webhooks library for your language — one exists for Python, JavaScript, Go, Rust, Java, Kotlin, Ruby, PHP, C# and Elixir — and pass it the secret, the raw request body and the headers. Verification runs in your handler, so there is no cURL form.401 and do not process the payload.
Pass the raw body — the bytes as received. A framework that hands you a
parsed object has already discarded what the signature covers, so reach for the
raw-body accessor yours provides.
When deliveries keep failing
Failed deliveries are retried with backoff. A webhook that keeps failing is set todisabled.
What is disabled is the webhook, not the monitor. The monitor keeps running
on its cadence and keeps collecting records; you read them with the record
cursor, and re-enable the webhook with an ordinary update once your endpoint is
healthy. There is no notification when this happens — check webhook.status if
deliveries stop arriving.
Disable, enable and remove
Disabling and enabling a webhook are ordinaryupdate calls that set its
status. The whole Webhook message is replaced, so resend url and
events alongside the new status — omitting them does not preserve them.
null:
Removing the webhook does not retire the secret, and re-adding one does not
issue a new one. Omitting
webhook on an update keeps it; null removes it —
see Reference.