Receive webhooks
Mountaya sends each event your webhook endpoint subscribes to as a signed POST. Verify the signature, then act on the typed event.
constructWebhookEvent checks the delivery's Mountaya-Signature against your endpoint's secret, then returns the event. Hand it the body exactly as it arrived:
Your framework's route calls it, and answers with the status it returns. Verify webhook signatures shows how the signature is computed.
Each event type is a class of its own, so a switch reads what each carries:
Mountaya delivers an event at least once and in no set order. Keep what you act on keyed by event.id.
An event this build cannot type still arrives, as UnknownWebhookEvent. Answer it with a 2xx like any other:
Rotate a secret in the Mountaya app, under Organization → Webhooks. Both secrets sign every delivery for up to 7 days, and either verifies, so deploy the new one before the overlap ends.
Check your code against the published test vectors. now: pins the clock each case is judged by:
To send a real test event to your endpoint, call mountaya.admin.webhooks.postOrganizationWebhookDelivery with test:, or use Send test event in the Mountaya app.