POST /v1/webhooks; the response returns a signingSecret once — store it now.
Events
Event catalog
Subscribe to one or more events per webhook (the
events array at creation).
Subscribing to events
Pass anevents array when registering a webhook to choose exactly which events it receives. Each
delivery’s type tells you which event fired, so a single endpoint can handle the whole lifecycle.
PATCH /v1/webhooks/{id} and a new events array.
Event envelope
Every webhook POST body is a JSON envelope.id is stable across redeliveries — dedupe on it.
data carries the event’s business object — for scribe_session.* events, a snapshot of the
session:
data object for scribe_session.* events:
The same
data shape is sent for every scribe_session.* event; status reflects the actual
session state and completedAt is null when the session did not complete.
Verifying the signature
Each request carries anX-Scribe-Api-Signature header (Stripe-style):
t is the Unix timestamp the request was signed at; v1 is the hex HMAC-SHA256 of
"{t}." + raw_request_body, keyed by your signing secret. Verify over the raw request body
before parsing — re-serializing JSON can change the bytes and break the comparison. Use a
constant-time compare and reject timestamps outside a 5-minute window to blunt replay attacks.
X-Scribe-Api-Event-Id (equal to the envelope id) for quick logging.
Retry & delivery
- Return a
2xxquickly to acknowledge. Do slow work asynchronously. - A
5xx, network error, or timeout is retried with exponential backoff (≈2s up to ≈2min between attempts) for up to 6 attempts across ~15 minutes. - Any
4xx(including408and429) is treated as permanent — the delivery is not retried. - Retries reuse the same envelope
id, so dedupe on it to stay idempotent.
Rotating the signing secret
CallPOST /v1/webhooks/{id}/rotate-secret to generate a new secret. The response returns the new
signingSecret once and bumps signingSecretVersion. The previous secret stops verifying
immediately, so roll the new value out to your endpoint before rotating.