Skip to main content

Setup

Create a Webhook Endpoint

Dashboard

Navigate to Webhooks in the dashboard to create, edit, and monitor webhook endpoints.

Events

This is the whole list the API accepts — events is validated against it, so subscribing to anything else is rejected at creation. Fetch it at runtime with GET /v1/webhooks/event-types (webhooks.listEventTypes() in the SDKs) rather than hard-coding it.

Payload Format

Verification

Every delivery carries an HMAC-SHA256 signature in the X-Moneyline-Signature header:
v1 is HMAC-SHA256 over <t>.<raw body>, keyed with the endpoint’s signing secret. Two things matter and are easy to get wrong:
  • The timestamp is part of the signed string. Signing the body alone lets anyone who captures one delivery replay it forever, because nothing in the signature says when it was made. Reject deliveries whose t is outside a tolerance window — five minutes is a reasonable default.
  • Verify the raw bytes. The signature covers exactly what was sent, so a handler that parses the body first has discarded the only thing it can check. Re-serializing a parsed object will not verify even for a genuine delivery.
Use the SDK rather than writing this yourself — it also does the constant-time comparison and the tolerance check.

Verify in Node.js

expressMiddleware(secret) and fastifyPlugin(secret) wrap the same check.

Verify in Python

Verify in Go

A runnable receiver for all of this — plus registering, triggering and replaying deliveries against a local stack — is in examples/webhooks.

Retry Logic

Each delivery gets three attempts, retried with exponential backoff starting at 10 seconds: A delivery fails if the endpoint returns a non-2xx status, or if the request does not complete within a 30 second timeout. Transport failures — DNS, refused connections, timeouts — are recorded as attempts just like HTTP errors. After the third attempt the delivery is marked failed and no further retries occur. The webhook itself stays active: Moneyline does not disable an endpoint after repeated failures, so monitor deliveries yourself. Inspect and re-send from the API:

Best Practices

  • Return 2xx quickly — Process webhook payloads asynchronously
  • Use idempotency — Events may be delivered more than once; use event.id to deduplicate
  • Verify signatures — Always validate the X-Moneyline-Signature header
  • Monitor delivery logs — Check the dashboard for failed deliveries