Configure a destination
capture.completed and capture.failed to distinguish terminal outcomes. The payload contains job_id, request_id, ok, data or error, result timing, delivery_id, and delivery_generation. The full shape appears in the API reference under the capture-result webhook.
Verify the signature before parsing
Thex-screenshotapi-signature header has the form t=UNIX_SECONDS,v1=HEX_DIGEST. The digest is HMAC-SHA256 of the timestamp, a period, and the exact raw request body, using your webhook secret.
This Node.js verifier accepts a UTF-8 raw body and applies a five-minute timestamp tolerance:
delivery_id and delivery_generation; also deduplicate your business action by job ID if it should happen once across manual redeliveries. A valid signature alone does not prevent replay within the timestamp window.
Acknowledge quickly
Persist the verified event or enqueue your own work, then return a 2xx response. The delivery consumer has a bounded timeout and retries transient failures, including 429, 5xx, and transport errors, with backoff. Other non-2xx HTTP responses are treated as terminal delivery failures. Redirects are not followed. The current default consumer attempts delivery up to five times, with a maximum ten-second timeout per attempt. Deployment settings can change these values. Design your handler for duplicate delivery even when your first response was successful.Inspect and redeliver
state (pending, delivered, or failed), attempts, generation, and the last HTTP status. The response has an ETag header. Copy its exact quoted value into If-Match:
"0" is an example; use the ETag from your status response. Redelivery requires screenshot:write. It returns 202 when accepted, or 409 if the delivery is unavailable, already pending, or its generation changed. Redelivery sends the existing capture result; it does not render again or charge for another capture.
If webhooks are unavailable on your deployment, use job polling until durable delivery is configured.