Skip to main content
Instead of polling, register an HTTPS endpoint and Relettr will POST events to it.

Register an endpoint

The response includes the endpoint’s signing secret (whsec_…). It is shown only once; store it securely.
  • URLs must be https on port 443 or 8443. Redirects are not followed.
  • Live and test endpoints are separate. An endpoint registered with a test key gets only test events.
  • If you leave out events, the endpoint gets every type except chapter.step_completed, which is opt-in.
  • Send a signed ping with POST /v1/webhook_endpoints/{id}/test.

Event types

New event types may be added; ignore types you don’t handle.

Payload

Events are deliberately thin. data.object is a snapshot of the chapter’s status, progress, quote, credits, warnings, review and your metadata. It never contains translated text or image URLs: fetch /result and /regions for those.

Verify the signature

Deliveries are signed with the Standard Webhooks scheme:
  • webhook-id: the event id
  • webhook-timestamp: Unix seconds
  • webhook-signature: v1,<base64 HMAC-SHA256> of "{webhook-id}.{webhook-timestamp}.{raw body}", keyed with the base64-decoded part of your secret after whsec_. While a secret is being rotated there are several space-separated signatures; accept the delivery if any one matches.
Always verify against the raw request body, before parsing JSON, and reject deliveries whose timestamp is more than 5 minutes from your clock.
The official standardwebhooks libraries work as they are:

Delivery and retries

  • Respond with any 2xx within 10 seconds. Do slow work after responding.
  • Anything else (non-2xx, redirects, timeouts, TLS errors) is retried with exponential backoff and jitter for up to 3 days: roughly 1 min, 5 min, 30 min, 2 h, 5 h, then every 10 h.
  • After 3 days of consecutive failures the endpoint is disabled and you’re emailed. Re-enable it with PATCH /v1/webhook_endpoints/{id} ("enabled": true).
  • Delivery is at least once and unordered. Deduplicate on webhook-id, and use the chapter’s status in the payload (or a fresh GET) rather than the order events arrive in.

Catching up

Missed some deliveries? GET /v1/events lists recent events, newest first, filterable by type and chapter_id. Page through it with the usual cursor.

Rotating the secret

POST /v1/webhook_endpoints/{id}/rotate_secret returns a new secret (shown once). The old secret keeps working for 24 hours, and deliveries during that time carry one signature per active secret, so you can deploy the new secret without dropping events.