Webhooks

Heimdall can POST to your server the moment Shield blocks one of your agents, or when a wallet you run picks up a risky approval. Every event is signed.

Set up#

  1. Open API keys & webhook and sign in with the wallet that owns your API keys.
  2. Enter an HTTPS endpoint, pick the events, and list up to 20 wallets to watch (usually your agents' wallets).
  3. Copy the signing secret (whsec_…). It is shown once; New secret replaces it.
  4. Press Send test event. The last 20 deliveries are listed with their HTTP status.

Events#

TypeWhen
shield.denyA transaction or signature check made with one of your API keys returned DENY.
shield.warnThe same, for WARN.
wallet.risky_approvalA watched wallet gained a new Danger or Review approval (checked every 15 minutes).
testSent by the Send test event button.

Payload#

A JSON body with an id, type, createdAt (UTC) and data. Headers: heimdall-event, heimdall-delivery and heimdall-signature.

JSON
{
  "id": "evt_Qm3x…",
  "type": "shield.deny",
  "createdAt": "2026-11-23T14:02:11.402Z",
  "data": {
    "kind": "tx",
    "checkId": "0x9f…",
    "verdict": "DENY",
    "riskScore": 95,
    "summary": ["Sends funds to a known drainer."],
    "findings": [{ "code": "BLOCKLISTED_TARGET", "severity": "deny", "message": "…" }],
    "chainId": 4663,
    "from": "0xYourAgent…",
    "to": "0xDrainer…",
    "value": "0",
    "apiKeyId": "a1b2c3d4e5f6"
  }
}

wallet.risky_approval carries wallet, approvals (token, symbol, spender, risk, value at risk in USD) and reportUrl, the Wallet Check page where it can be revoked.

Verify the signature#

heimdall-signature is t=<unix seconds>,v1=<hex>, where the hex is HMAC-SHA256 of <t>.<raw body> with your secret. Check it against the raw body before parsing, and reject events older than five minutes. The SDK does both:

TypeScript
import { parseWebhook } from "@heimdallfund/sdk";

export async function POST(req: Request) {
  const body = await req.text(); // the raw body, not re-serialised JSON
  const event = await parseWebhook({ secret: process.env.HEIMDALL_WEBHOOK_SECRET!, body, signature: req.headers.get("heimdall-signature") });
  if (event.type === "shield.deny") await pauseAgent(event.data.from as string);
  return new Response("ok");
}

Delivery rules#

  • Answer with any 2xx within 5 seconds. Redirects are not followed.
  • Events are sent once and not retried; use id to drop duplicates if you add your own retries.
  • After 15 failed deliveries in a row the webhook is switched off. Saving it again switches it back on.
  • Endpoints must be public HTTPS: localhost, private networks and credentials in the URL are refused.
Webhooks tell you what Shield saw; they do not replace the check itself. An agent should still refuse to sign anything Shield denied.