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

# Webhooks and events

The five Lid webhook events, the three signature headers, and how to verify a delivery with HMAC-SHA256.

Lid calls a URL you own when something happens. Register the URL with `create_webhook` or in the app under **Settings → Development → New webhook**. The signing secret is shown only once. Store it. From an agent, `create_webhook` needs the **Catalog** permission on the key.

## The events

| Event                       | Fires when                                                              |
| --------------------------- | ----------------------------------------------------------------------- |
| `purchase.completed`        | A sale settled.                                                         |
| `conversion.approved`       | A campaign conversion passed review and is payable.                     |
| `prize.claimed`             | A prize holder claimed a challenge prize.                               |
| `subscription.created`      | Someone subscribed to a membership. It fires on the first payment only. |
| `bounty.submission.created` | Someone entered one of your challenges.                                 |

A sixth type, `webhook.test`, is the test event you send yourself.

{% hint style="info" %}
A sale of a product with a refund window is held, and a held sale never fires `purchase.completed`. To follow it, use `my_sales`: each sale shows its `kind` (`purchase` or `hold`) and, for a hold, its `status`: held, released, refunded or disputed.
{% endhint %}

## Verify a delivery

Every delivery carries three headers:

```
x-lid-event      · the event type
x-lid-timestamp  · unix time of the delivery
x-lid-signature  · sha256=HMAC_SHA256(secret, timestamp + '.' + body)
```

Recompute the HMAC over `timestamp + '.' + raw body` with your secret and compare. Reject on mismatch or a stale timestamp. The helper in the Lid SDK rejects deliveries older than 5 minutes.

## When a delivery does not arrive

`webhook_deliveries` lists the recent attempts for one endpoint with the status code and the error. It is the first place to look when Lid is not calling you. An endpoint switches itself off after 20 failed deliveries in a row. To send yourself a test event, call the REST route `POST /api/v1/agent/webhooks/{id}/test`.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.lid.pro/agents/webhooks.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
