Skip to content

Reference

Webhooks

Every change to a simulation - from your requests, the behaviour plan or a fast-forward - emits an event. Webhooks deliver them to you, signed.

Registering

Add a webhook in the dashboard or with POST /v1/simulations/{id}/webhooks. Filter with exact event names (task.created), prefixes (task.*) or everything (*). The response includes the signing secret, which starts whsec_.

  • Targets must be public https URLs. Private, loopback, link-local and cloud metadata addresses are refused, and re-checked when each connection is made.
  • Redirects are not followed. Respond with any 2xx within 10 seconds.
  • Your plan sets how many webhooks each simulation can have.

Request format

headers
POST /hooks/slurry HTTP/1.1
Content-Type: application/json
User-Agent: Slurry-Webhooks/1.0 (+https://slurry.io)
Slurry-Event: task.updated
Slurry-Delivery: 9b2d6c1e-3f7a-4e0b-8a55-1c4f2e7d9a10
Slurry-Signature: t=1790327472,v1=5f1c0b6e2a...
body
{
  "id": "e3b1f4a2-7c9d-4d6e-b8a1-2f5c6d7e8f90",
  "type": "task.updated",
  "created": "2026-09-25T09:41:12.000Z",
  "data": {
    "collection": "tasks",
    "id": "1204417763512",
    "object": {
      "gid": "1204417763512",
      "name": "Invoice sync drops line items over 250",
      "status": "in_review",
      "assignee": { "gid": "1204417760001", "name": "Priya Raman" },
      "modified_at": "2026-09-25T09:41:12.000Z"
    }
  }
}

data.object is the record as your code would see it from the API: a password in any common spelling, its hash and Slurry's internal fields are never in it, nor in the events feed, a delivery you read or a replay. On deletes it may be null, so use data.id. Use Slurry-Delivery or id to make your handler idempotent: a retry carries the same delivery id.

Verifying signatures

Slurry-Signature is t=<unix seconds>,v1=<hex>, where the hex is HMAC-SHA256(secret, t + "." + raw body). Compute it over the raw bytes you received, compare in constant time, and reject timestamps more than five minutes old to stop replays.

import crypto from 'node:crypto'

// Use the raw request body, exactly as received, before any JSON parsing.
export function verifySlurry(rawBody, header, secret, toleranceSec = 300) {
  const parts = Object.fromEntries(header.split(',').map((p) => p.split('=')))
  const t = Number(parts.t)
  if (!t || Math.abs(Date.now() / 1000 - t) > toleranceSec) return false
  const expected = crypto.createHmac('sha256', secret).update(`${t}.${rawBody}`).digest('hex')
  const a = Buffer.from(expected, 'hex')
  const b = Buffer.from(parts.v1 ?? '', 'hex')
  return a.length === b.length && crypto.timingSafeEqual(a, b)
}

Retries

Any non-2xx response, timeout or connection error is retried with backoff:

AttemptDelay after previous failure
1Immediate
21 minute
35 minutes
430 minutes
52 hours
612 hours
After the sixth failed attempt the delivery is marked failed. An endpoint that fails 50 deliveries in a row is switched off automatically; turn it back on in the dashboard once it is fixed.

Each delivery records why it failed, in plain words with the error code: DNS lookup failed: the host name does not resolve (ENOTFOUND), connection refused (ECONNREFUSED), TLS: the certificate has expired (CERT_HAS_EXPIRED), timed out after 10 seconds, blocked: the host resolves to a private or reserved address, or HTTP 302 (redirects are not followed). Read it with get_webhook_delivery over MCP or slurry webhooks delivery. The reason is fixed text: nothing from the network stack (resolved addresses, internal host names) is stored.

Delivery faults for testing a handler

Real vendors deliver at least once, in no fixed order, and now and then not at all. Turn the same on for a simulation to prove your handler copes. Off by default, and it applies to events from then on.

SettingWhat it does
duplicateRateThe share of events delivered twice, 0 to 1. The same payload and id, so a handler can tell.
delayMaxSecondsHold each delivery for a random time up to this, at most 3600. Events closer together than this arrive out of order.
dropRateThe share of events never sent, 0 to 1. The delivery is marked failed with the reason Dropped on purpose by a webhook fault, and you can still replay it.
forgedRateThe share of events that also get a forged delivery, 0 to 1: the same body, signed with a key made for that one send and thrown away, never your secret. A handler that checks signatures refuses it.
staleRateThe share of events that also get a stale delivery: signed with a throwaway key and dated an hour back. A handler that checks signatures refuses it already, so it does not separately prove a timestamp check.
seedThe same event on the same record draws the same way every run.
terminal
slurry webhooks faults acme-jira --duplicate-rate 0.2 --delay-max 30s --seed run-42
slurry webhooks deliveries acme-jira --since 10m --json   # eventId shows the duplicates
slurry webhooks faults acme-jira --off

Over REST: GET, PUT and DELETE /v1/simulations/{id}/webhook-faults. Over MCP: get_webhook_faults and set_webhook_faults. A fork inherits its parent's faults, a reset leaves them on, and each delivery still counts towards the per-destination limit.

Does the handler check signatures?

A handler that never checks Slurry-Signature passes every test, because every real delivery is signed correctly. Turn on forgedRate and staleRate and each event also gets planted deliveries that must be refused. The real delivery still goes, so a handler that refuses the planted ones loses nothing. A planted delivery is sent once, never retried, and never counts towards switching the webhook off. Deliveries show planted (forged or stale) and plantedResult: refused for a 4xx (right), accepted for a 2xx (the handler took a forgery), no_answer otherwise. Filter with planted=any, accepted or refused.

terminal
slurry webhooks faults acme-jira --forged-rate 1 --stale-rate 1
# run the test that makes changes, then
slurry webhooks forgery-check acme-jira --since 10m --wait 60s   # exit 1 if any was accepted, or none was sent
slurry webhooks deliveries acme-jira --planted accepted