Skip to content

Webhooks and signatures

A webhook is an address of yours that the service calls when something happens: a job finishes, a monitor detects a change, a quota runs out. You register it with POST /v1/webhooks, or on the Webhooks page, choosing the event types it receives (* for all of them).

The request you receive

A delivery is a POST with a JSON body:

{"id": "evt_01J…", "type": "job.completed", "created_at": "2026-10-07T09:30:00Z", "data": {…}}

and these headers:

HeaderContent
Vaicrawl-Signaturet=<timestamp>,v1=<signature>: see below.
Vaicrawl-Event-IdThe identifier of the event; the same on every retry.
Vaicrawl-Event-TypeThe type of the event.
Vaicrawl-Delivery-IdThe identifier of this delivery.
User-AgentVaicrawlWebhooks/1.0 (+https://vaicrawl.com/bot)

Answer with any 2xx status within 10 seconds. Do the real work after answering: a slow endpoint is treated as a failed one. Redirects are followed, at most three.

The address must be public: an address that resolves to a private or local network is refused, when the webhook is created and again at every delivery.

Verifying the signature

Each webhook has a secret, which starts with whsec_ and is shown only once, when the webhook is created. The signature proves that a delivery comes from the service and has not been altered.

v1 is the HMAC-SHA256, in hexadecimal, of <timestamp>.<body> computed with the secret, where <timestamp> is the t of the header and <body> is the raw body of the request, byte for byte.

1. Read t and v1 from the Vaicrawl-Signature header. 2. Compute the HMAC-SHA256 of t, a dot and the raw body — before parsing the JSON — with your secret. 3. Compare it with v1 in constant time. 4. Refuse the delivery if t is more than five minutes away from your clock: whoever intercepted a delivery cannot replay it later.

In Python:

import hashlib, hmac, time

def is_authentic(secret: str, header: str, body: bytes) -> bool:
    parts = dict(item.split('=', 1) for item in header.split(','))
    timestamp = int(parts['t'])
    if abs(time.time() - timestamp) > 300:
        return False
    signed = str(timestamp).encode('ascii') + b'.' + body
    expected = hmac.new(secret.encode('utf-8'), signed, hashlib.sha256).hexdigest()
    return hmac.compare_digest(expected, parts['v1'])

The Python SDK does the same with vaicrawl_sdk.webhooks.verify_signature. If a new signature scheme is ever introduced it will be added next to v1 (v2=…), without removing v1.

Retries

A delivery that does not get a 2xx is retried with an increasing wait: after 1 minute, 5 minutes, 30 minutes, 2 hours and 12 hours. That is six attempts in a little less than fifteen hours.

When the last attempt fails:

Because of retries the same event can arrive more than once: use Vaicrawl-Event-Id (or id in the body) to recognise an event you have already handled.

Catching up

Every event is also kept by the service. GET /v1/events?since=<event id or ISO 8601 moment> returns the events after that point, oldest first, in the same shape as the body of a delivery: use it after an outage instead of waiting for retries. type= narrows it to one event type.

Event types

TypeWhen
job.startedA job has started downloading pages.
job.progressA job has made progress. At most once every 10 seconds per job.
job.completedA job has finished.
job.failedA job has stopped because of an error.
job.cancelledA job has been cancelled.
capture.createdA new capture (a page, or a new version of its text) has been archived.
change.detectedA monitor has detected a change.
monitor.failingA monitor has failed several times in a row.
quota.warningA quota of the plan is almost used up.
quota.exceededA quota of the plan has been used up.
connection.failingA connection to a third-party service has failed several times in a row.
notices.suspendedSending your notices from the Vaicrawl domain (mode service) has been suspended: too many complaints or hard bounces in the last days. The payload has cause (complaints or bounces) and the counts of the window; never an address. The notices stay queued.
credits.lowYour credit balance went below the threshold. The payload has balance and threshold. Sent once each time the balance goes below.
credits.depletedYour credit balance is used up: the usage beyond the quota stops. The payload has balance.
credits.purchasedCredits have been added to your balance (a pack, an automatic recharge). The payload has transaction_id, kind, credits, balance and pack.
promotion.grantedA promotion benefit has been granted to you (at sign-up, on first use, with a code, with a gift code or by the staff). The payload has source, origin and benefits (each with id, type and expires_at).
promotion.expiringA promotion benefit is about to end. Sent once per benefit. The payload has benefit_id, type, expires_at and remaining.
delivery.failedA webhook delivery has failed after all its retries.
webhook.testA test event, sent on request by POST /v1/webhooks/{id}/test to that webhook only.

Types are added over time, never removed. A webhook subscribed to * also receives the types added later: ignore the types you do not know.

What a delivery never contains

Identifiers in data are the public ones (job_01J…). A delivery never carries secrets, and never data of another customer.

Limits

A customer can have at most 20 webhooks. The log of the deliveries of a webhook, with the status and the duration of each attempt, is GET /v1/webhooks/{id}/deliveries.