Overview
LeoKit webhooks push real-time event notifications to your server as swaps progress through their lifecycle. Discord and Slack webhook URLs are auto-detected and receive formatted embeds/blocks instead of raw JSON.Supported Events
Webhook Types
POST /leokit/webhooks
Register a new webhook endpoint.Authentication
RequiresApi-Key header.
Request Body
Response
Status Code:200 OK
secret is only returned on creation. Save it immediately — you’ll need it to verify webhook signatures.
GET /leokit/webhooks
List all webhooks for the authenticated client.Authentication
RequiresApi-Key header.
Response
DELETE /leokit/webhooks?id=
Delete a webhook by ID.Authentication
RequiresApi-Key header.
Query Parameters
Response
Webhook Payload (Standard)
Standard webhooks receive a JSON payload with HMAC-SHA256 signature headers.Headers
Body
Verifying Signatures
Compute HMAC-SHA256 of the raw request body using your webhooksecret, then compare to the X-LeoKit-Signature header:
Delivery & Retry
- Timeout: 10 seconds per delivery attempt
- Max attempts: 5
- Backoff schedule: 30s, 1m, 5m, 15m, 1h
- Final state: Marked as
failedafter 5 failed attempts
Rate Limits
- Webhooks per client: 20 active webhooks max
- Events per webhook: No per-event rate limit; high-volume clients may see deliveries batched within the same backoff window
- TLS required:
urlmust behttps://(Discord/Slack URLs are also enforced as HTTPS)
Discord Webhooks
Discord webhook URLs (discord.com/api/webhooks/...) automatically receive formatted embed payloads with color-coded event types:
- Green:
swap.success - Red:
swap.failed - Yellow:
swap.refunded - Blue:
quote.created,deposit.initiated,swap.pending
Slack Webhooks
Slack incoming webhook URLs (hooks.slack.com/services/...) automatically receive Block Kit formatted payloads with header blocks, mrkdwn fields, and contextual metadata.
Examples
Register a Discord webhook
"type": "discord" (auto-detected).