Webhooks
With a webhook, RiskPilot POSTs each newly released signal in your package to an HTTPS endpoint you run, a few seconds after its release. Every delivery is signed with your account's secret and retried with backoff until your endpoint accepts it.
Set it up
Webhooks are part of the packages whose delivery includes them (desk and firm as standard); on another package
you can save a URL, but nothing is sent to it. You need the live key or a signed-in owner (a named key gets
403 key_not_allowed); the portal's Delivery page does the same.
-
Set the URL. It must be
https://, on a public host, without a user name or password in it.CodeAn
http://URL,localhost, or an address in a private, loopback or link-local range is refused with 400. Names are resolved again at every delivery, and a name that then points at a private address is not called. An empty string removes the webhook. -
Get the signing secret (
whsec_…). The first call creates it; later calls return the same one.CodeStore it like a password, next to your endpoint.
-
Send a test (below) and check your endpoint answers 2xx.
From then on, every signal released while the URL is set is delivered. Signals released before you set it are not sent afterwards: read those over REST.
Events
event | When |
|---|---|
signal.published | A signal of a class your package includes is released (live), inside your history window and families. Once per filing. |
test | You (or support) asked for a test delivery. |
A filing an operator holds back is not sent while it is held; it is sent when the hold is lifted. A signal is sent
once: if it is later re-released, no second signal.published follows. The sandbox key never causes a delivery.
The request
Code
| Field | Meaning |
|---|---|
event | signal.published or test |
signal | The signal as it was when the delivery was queued: the same fields as GET /customer/signals |
deliveryId | The delivery's id; also in the RiskPilot-Delivery header (header names are case-insensitive). The same on every retry |
attempt | 1 for the first try, up to 7 |
sentAt | When this attempt was sent |
The signal.label is a snapshot (usually PENDING); read the signal again later for its realized label. A test
delivery is { "event": "test", "deliveryId": "test_1762790400412", "sentAt": "…" }.
Verify the signature
RiskPilot-Signature is t=<unix seconds>,v1=<signature>, where the signature is the lowercase hex
HMAC-SHA256 of the string t + "." + body, keyed with your whsec_… secret. To verify:
- Take the raw bytes of the body as received. Do not parse and re-serialise the JSON first: any change of spacing or key order breaks the signature.
- Compute HMAC-SHA256 over
t, a., and those bytes, with the secret. - Compare with
v1in constant time. - Reject a
tmore than 5 minutes from your clock: that stops a captured request being replayed later. Each retry carries a fresht.
Answer 400 or 401 when the check fails. That delivery is then retried, which is what you want during a secret rotation (below).
Both functions are tested against the API's own signing code. The Python one needs 3.10 or later.
Answer quickly
- Any 2xx status means delivered. Anything else (including 3xx: redirects are not followed, and 4xx), no answer within 10 seconds, or no connection counts as a failure.
- Store the delivery and answer; do slow work (database writes to other systems, notifications) afterwards.
Retries and backoff
A failed delivery is tried again with the same deliveryId, re-signed with a fresh t:
| Attempt | Sent |
|---|---|
| 1 | at release (the queue is read every few seconds) |
| 2 | 1 minute after attempt 1 failed |
| 3 | 5 minutes after attempt 2 |
| 4 | 30 minutes after attempt 3 |
| 5 | 2 hours after attempt 4 |
| 6 | 6 hours after attempt 5 |
| 7 | 24 hours after attempt 6 |
After the seventh failure the delivery is failed and is not tried again by itself; RiskPilot support can queue
failed deliveries again once your endpoint is fixed (they keep their deliveryId). A delivery is also marked failed,
without being sent, when at its turn the account is suspended, the webhook was switched off, or the subscription no
longer allows access.
GET /api/v1/customer/delivery/log (and the portal's Delivery page) shows the latest 50 deliveries with their
status (pending, delivered, failed), attempts, next attempt, last HTTP status and last error, and the totals.
Idempotency and order
- Deduplicate on
deliveryId. You may receive the same delivery more than once: when your endpoint processed it but the answer was lost or late, or when failed deliveries are queued again. Record eachdeliveryIdyou accept and skip repeats. - RiskPilot queues at most one
signal.publishedper filing for your account, sosignal.filingIdis also a safe business key. - Order is not guaranteed. Deliveries are sent several at a time and retries interleave with new ones. Use
signal.filedAtto order, not arrival time.
Test it
- Test delivery:
POST /api/v1/customer/delivery/test(or Send test on the Delivery page) sends a signedtestevent to your URL at once and answers with the result, for example{ "kind": "test", "ok": true, "status": 204, "error": null }. A test is not retried. - Locally: expose your development endpoint through an HTTPS tunnel and set that URL; a plain
http://or private address is refused. - Unit tests: sign a sample body yourself with the functions above (compute
tandv1with your test secret) and post it to your handler; also check that a changed body, a wrong secret and an oldtare rejected.
Rotate the secret
POST /api/v1/customer/delivery/rotate-secret (or Rotate secret on the Delivery page) returns a new whsec_… and
signs every delivery from then on with it; the old secret stops at once. To switch without losing anything:
- Make your endpoint accept either of two secrets (try the new one, then the old one).
- Rotate and deploy the new secret.
- Deliveries that failed the check in between are retried a minute later and pass.
- Remove the old secret.
RiskPilot records each rotation in its audit log.