Docs / Core Concepts

Testing Webhooks

Test webhook delivery, retries, timeouts and the dead-letter queue with the built-in Echo Sandbox (/v1/sandbox/sink/:workspaceId), without third-party request bins or tunnels.

Updated 2026-12-03~4 min readEcho Sandbox

The Echo Sandbox is a webhook receiver built into the KestrelMQ API. It records what your workspace sends, answers with the status you choose, and checks the HMAC-SHA256 signature — no external webhook.site request bin or local tunnel (ngrok, cloudflared) is needed.

Echo Sandbox URLs
{API_ORIGIN}/v1/sandbox/sink/:workspaceId
{API_ORIGIN}/v1/sandbox/sink/:workspaceId/:mode

Response modes

ModeSink behaviourWhat the delivery does
200 (default)200 OKDELIVERED
500500 Internal Server ErrorRETRYING, then FAILED and dead-lettered
429429 with Retry-After: 5RETRYING on the KestrelMQ backoff schedule, then FAILED
timeoutWaits 12s before answeringThe worker gives up at 10s, then retries

Choose a mode per URL with /v1/sandbox/sink/:workspaceId/:mode (for example /v1/sandbox/sink/:workspaceId/500) or ?simulate=500. Without either, the sink uses the mode saved for the workspace in the dashboard (GET / PATCH /v1/sandbox/sink/:workspaceId/config with {"mode":"500"}, OWNER or ADMIN), which expires after 24 hours.

Create the integration

In the dashboard, click Test with Echo Sandbox on Deliveries or open Routing Rules and click Create Sandbox Endpoint in the Echo Sandbox panel, then route an event to that integration. With the API:

POST /v1/integrations
{
  "name": "Echo Sandbox (500)",
  "channel": "WEBHOOK",
  "provider": "CUSTOM_WEBHOOK",
  "credentials": { "url": "http://localhost:8080/v1/sandbox/sink/<workspaceId>?simulate=500" }
}

Add a routing rule for the integration and send an event.

Self-hosted: the sink URL must match PUBLIC_API_URL

A workspace can reach its own sink only on the origin in PUBLIC_API_URL (http://localhost:8080 by default in docker-compose.selfhost.yml). If the worker cannot connect to that origin, set SANDBOX_INTERNAL_URL to one it can. The Compose file already sets it to http://core-api:8080.

Inspect requests and signatures

The sink's diagnostic JSON response, and GET /v1/sandbox/sink/:workspaceId/requests (Access JWT), include receivedAt, method, headers, body, and signatureValid:

Diagnostic JSON · Echo Sandbox
{
  "receivedAt": "2026-12-03T12:00:01.142Z",
  "method": "POST",
  "headers": {
    "content-type": "application/json",
    "user-agent": "KestrelMQ-Webhook/1.0",
    "x-kestrelmq-timestamp": "1764763201",
    "x-kestrelmq-signature": "v1=9c4e2b8f01d7a63e54b109c8a72f6d41e80b3c529a14f7d603e8b2c1a490f512"
  },
  "body": { "orderId": "ord_9812", "amount": 4900 },
  "signatureValid": true
}
  • signatureValid: true or false from checking X-KestrelMQ-Signature against the workspace signing secret (and the previous secret during rotation); null when the request has no signature headers.
  • headers and body as received. Authorization, cookies and other credential headers are redacted, and bodies are cut at 16,384 characters.

The last 20 requests are kept for 24 hours. For deliveries, the response is also stored on the attempt in the Delivery Inspector, where the Verify Signature tab generates ready-to-run Node.js, Python, and Go HMAC-SHA256 verification snippets from the attempt's x-kestrelmq-signature and x-kestrelmq-timestamp headers.

Retry and DLQ timing

A delivery gets 5 attempts. The delays between them are 10s, 1m, 5m and 30m (±10% jitter), so with default settings a 500 reaches the dead-letter queue after about 36 minutes. The first failure and the RETRYING status show up right away.

On a local or test stack, shrink the schedule on the worker:

.env.selfhost
BACKOFF_SCALE_FACTOR=0.01

The delays become about 0.1s, 0.6s, 3s and 18s. Restart the worker, and remove the variable before production.

Limits

The sink URL needs no API key, so treat it as publicly writable and do not send real customer data to it. It accepts 300 requests per minute per workspace.