Skip to main content

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

Requires Api-Key header.

Request Body

Response

Status Code: 200 OK
Important: The 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

Requires Api-Key header.

Response


DELETE /leokit/webhooks?id=

Delete a webhook by ID.

Authentication

Requires Api-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 webhook secret, 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 failed after 5 failed attempts
Deliveries are processed by a background worker on the leader instance.

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: url must be https:// (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
No signature verification — Discord handles authentication via the webhook URL secret.

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

Response will show "type": "discord" (auto-detected).

Register for specific events only

List webhooks

Delete a webhook