Skip to main content
Live since 2026-06-11. Registration, signing, test events, replay, and production delivery to public endpoints are all active. Calibration v1 shipped on 2026-06-10; the public-alerts gate flipped on 2026-06-11.
Webhooks deliver state transitions to your URL within seconds of the engine detecting them. Every payload is signed with Ed25519 so you can verify authenticity without trusting the transport.

Why webhooks (vs WebSocket)

  • WebSocket — you hold a connection. Best for read-only consumers with strict freshness needs (dashboards, agent runtimes).
  • Webhooks — we push to your URL. Best for fire-and-forget reactions (notifications, automated risk pauses, audit logging). No connection to maintain.
For most B2B integrations (lending protocol pausing collateral, insurance trigger, prediction-market settlement) webhooks are the right fit.

Quickstart

  1. Register a webhook via the dashboard at pegana.xyz/account/webhooks. Telegram Login required.
  2. Implement signature verification at your endpoint (see signing).
  3. Test with the dashboard’s “Send test event” button.
Or via API:

Payload shape

The body is JSON, exactly:

HTTP headers we send

Note the ed25519: prefix on the signature value — your verifier strips it before base64-decoding. See signing for the full algorithm. We do not ship the public key in a header on every request. Active keys are published at https://api.pegana.xyz/v1/meta/webhook-keys; your verifier should cache that list or read it from an env override.

URL requirements

  • Must be https:// — we refuse HTTP
  • We SSRF-guard the URL: rejects private IP ranges (10.x, 172.16.x, 192.168.x), localhost, *.local, *.internal, and metadata endpoints
  • Returns must be 2xx for the delivery to count as successful. 3xx redirects are not followed
  • We expect a response within 5 seconds. Beyond that, treated as failed and retried

What to do in your handler

A robust receiver does three things, in order:
  1. Verify the signature (webhooks-signing)
  2. Check x-pegana-timestamp is within ±300 seconds of now (replay protection)
  3. Idempotency: check x-pegana-event-id against your local record — if seen already, return 200 OK without re-acting
After those three, your business logic can act on the payload — pause collateral, fire a notification, settle a position.

Retry policy

Failures (non-2xx, timeout, TLS error) trigger retries. Dispatcher config (crates/dispatcher-rs/src/main.rs): max_attempts: 6, backoffs [5s, 30s, 5m, 30m, 2h]. After the 6th failure (~2h35m total), the delivery is logged as failed and written to the webhook dead-letter queue. Your endpoint can inspect delivery history or manually replay missed events. See retry policy.

Example receivers

We ship reference receivers in three languages, each with full verification logic (production code, not docs prose):

TypeScript / Cloudflare Worker

Web Crypto API. Works on edge, Vercel functions, Node 18+.

Rust / axum

ed25519-dalek strict-mode verification.

Python / FastAPI

cryptography library.

Listing and managing webhooks

The dashboard UI at pegana.xyz/account/webhooks exposes the same actions plus delivery history.

Next

Signing details

Ed25519 algorithm, signing input format, public key.

Retry policy

Failure modes, backoff schedule, and replay.