Skip to main content
Most of the integration is request/response. Webhooks cover everything that happens on Prescience’s side after your call returns: underwriting finalizing a large-group quote, a company activating to prod, an enrollment landing. Signatures follow the standard-webhooks scheme (the same one used by Svix and a growing list of providers), so you can verify with an off-the-shelf library or ~10 lines of code.

Setup

Register your HTTPS endpoint. The signing secret comes back once; store it like an API key:
Response (200)
One endpoint per mode (your test key registers the test endpoint; your live key, the live one). Calling PUT /webhook again replaces the URL and issues a fresh secret; that’s also the rotation mechanism. Then prove the loop works end to end:
This dispatches a signed ping event to your endpoint. If your handler verifies it and returns 2xx, you’re done with setup.

Delivery format

Every event is a POST with a JSON body and three signature headers:
The body is delivered compact (no whitespace). The signature above is the genuine HMAC of this exact example under the setup secret whsec_4f8a1c2b9d3e6f7a8b9c0d1e2f3a4b5c. Wire up your verifier against it as a unit test before touching production traffic.

Event catalog

Full payload schemas are in the API reference under Webhooks.

Verifying signatures

The signature is an HMAC-SHA256 over {webhook-id}.{webhook-timestamp}.{raw body}:
  1. Key: strip the whsec_ prefix from your secret and base64-decode the remainder; the resulting bytes are the HMAC key.
  2. Signed content: concatenate the webhook-id header, the webhook-timestamp header, and the raw request body, joined by .. Verify against the exact bytes you received, never a re-serialized parse.
  3. Compare: base64-encode the HMAC and compare (constant-time) against each space-separated v1,<base64> candidate in webhook-signature. Any match passes.
Reject anything that fails, and reject timestamps older than ~5 minutes to blunt replay.
The official standard-webhooks libraries (npm install standard-webhooks, pip install standardwebhooks) implement this exact verification: pass them the raw body, the headers, and your whsec_ secret.

Retries and reliability

Delivery is best-effort with 3 retries on exponential backoff (1s, 5s, 25s) after the initial attempt. A delivery counts as successful on any 2xx response. Exhausted deliveries are recorded on our side and surfaced to your partner engineer, but they are not queued durably in v1. Build your handler accordingly:
  • Return 2xx fast (under 10 seconds). Enqueue work; don’t do it inline.
  • Dedupe on event.id. Retries reuse the same id, and you should treat deliveries as at-least-once.
  • Don’t treat webhooks as the source of truth. They’re a prompt, not a ledger: on anything critical (or after downtime), reconcile by polling GET /groups, GET /quotes/{id}, and GET /enrollments/{id}. Every webhook-announced fact is readable from the API.