Catch up on what you missed
Subscriptions. Once the webhook is registered, the key gets a subscription for each of its lines. GET /subscriptions/ lists them: subscription_id, channel_id, state (active, paused, revoked) and watermark — the number of the latest event in that subscription. Every delivery carries X-Wahub-Subscription-ID and X-Wahub-Sequence headers: store the last processed sequence per subscription.
Catch up. If your service was down longer than retries last, or you spot a gap in sequence, read GET /subscriptions/<subscription_id>/events/?after_sequence=<last processed>&limit=100 (limit up to 500). deliveries come in ascending sequence: delivery_id, event_id, sequence and body — the same JSON the webhook carried. Pass next_cursor as after_sequence until has_more is false. Reading does not acknowledge a delivery and does not cancel retries.
curl "https://dialogs.tehprof.kz/api/v1/gw/subscriptions/0b6f…/events/?after_sequence=120&limit=100" \
-H "Authorization: Bearer gw_xxx"
200 {
"subscription_id": "0b6f…", "channel_id": "32",
"state": "active", "ack_mode": "legacy_2xx", "watermark": 124,
"deliveries": [
{ "delivery_id": "9c1e…", "event_id": "5a7d…", "sequence": 121,
"body": { "messages": [ { "event": "message.created", "message_id": "8841" } ] },
"acked_at": null, "stop_reason": "" }
],
"next_cursor": 124,
"has_more": false
}Replay a delivery. POST /deliveries/<delivery_id>/replay/ resends a failed delivery with the same delivery_id, so your duplicate guard works as usual. The response is 202. If the delivery is not in the failed state or access to the line is gone — 409 replay_unavailable.
Pause and revoke. PATCH /subscriptions/<subscription_id>/ with { "state": "paused" } pauses delivery for the line: events pile up and go out after { "state": "active" }. { "state": "revoked" } switches the subscription off for good; to receive the line's events again, create a new one: POST /subscriptions/grant/ with { "channel_id": 32 }. ack_mode: legacy_2xx — any 2xx accepts a delivery; receipt_v1 — only a 200 with JSON { "delivery_id": …, "body_sha256": … }, where body_sha256 is the hex sha256 of the raw body.