> For the complete documentation index, see [llms.txt](https://docs.antivamp.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.antivamp.io/partners/06_webhooks.md).

# Webhooks

## Register

Console (`/integrations` → Webhooks) or `POST /v1/webhooks { url, events? }`. The signing secret is returned once. HTTPS required (localhost allowed for tests). Omit `events` to receive all.

## Events

`reservation.created`, `reservation.expiring`, `reservation.expired`, `identity.protected`, `identity.extended`, `identity.blocked_attempt`, `launch.authorized`, `launch.blocked`, `launch.reported`, `token.bonded`, `token.graduated`, `milestone.verified`, `identity.cleared`, `chain.degraded`.

## Envelope

```json
{ "id": "<deliveryId>", "type": "token.bonded", "createdAt": "…Z", "data": { … } }
```

## Signature

Header `X-AntiVamp-Signature: t=<unix>,v1=<hex>` where `v1 = HMAC_SHA256(secret, "<t>.<rawBody>")`. Verify against the **raw** body (do not re-serialize) and reject timestamps outside your tolerance (≤5 min).

```ts
import { verifyWebhook, parseWebhook } from "@antivamp/sdk";
app.post("/webhooks/antivamp", express.raw({ type: "*/*" }), (req, res) => {
  const raw = req.body.toString("utf8");
  const sig = req.header("X-AntiVamp-Signature") ?? "";
  if (!verifyWebhook(process.env.WH_SECRET, raw, sig)) return res.sendStatus(400);
  const evt = parseWebhook(process.env.WH_SECRET, raw, sig);
  // handle evt.type / evt.data ; respond 2xx quickly
  res.sendStatus(200);
});
```

## Delivery, retries, replay

Deliveries are recorded with status + attempts. AntiVamp attempts a bounded in-request retry; failed deliveries stay in history and can be **replayed** from the console (or `POST /v1/webhooks/deliveries/:id/replay`). A durable exponential-backoff queue with dead-lettering is a documented roadmap item.

## Idempotency

Process by `id` (deliveryId) and ignore duplicates — retries/replays reuse it.

## Secret rotation & test

Rotate: `PATCH /v1/webhooks/:id { rotateSecret: true }` (new secret shown once). Send a signed test event: `POST /v1/webhooks/test` or the console "Send test event" button.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.antivamp.io/partners/06_webhooks.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
