> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tensorlake.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Webhooks

> Receive signed, project-scoped notifications for sandbox, application, and application-request lifecycle events.

Tensorlake webhooks send signed HTTPS notifications when sandboxes,
applications, and application requests change state. Use them to react to
lifecycle changes without polling an API.

Each webhook belongs to one project. It receives only events produced by that
project and only the event types selected for that destination.

## Supported events

| Resource            | Events                                                       |
| ------------------- | ------------------------------------------------------------ |
| Sandbox             | Created, running, suspended, resumed, terminated, and failed |
| Application         | Created, updated, and deleted                                |
| Application request | Created, completed, and failed                               |

See the [event reference](./events) for event names, payload
fields, and examples.

## Create a webhook

<Steps>
  <Step title="Prepare an HTTPS endpoint">
    Your endpoint must accept `POST` requests over HTTPS. Before processing an
    event, verify its Svix signature using the destination's signing secret.
  </Step>

  <Step title="Open your project's Webhooks page">
    In [Tensorlake Cloud](https://cloud.tensorlake.ai), select an organization
    and project, then select **Webhooks** in the project navigation.
  </Step>

  <Step title="Add the destination">
    Select **Create webhook**, enter a name and absolute HTTPS endpoint URL,
    then select at least one lifecycle event.
  </Step>

  <Step title="Verify delivery">
    Open the webhook details page, copy the signing secret, and send a
    synthetic event with **Test webhook**.
  </Step>
</Steps>

Only organization administrators and project administrators can create or
edit webhook destinations. Project members can view destinations for projects
they can access.

## Delivery contract

Webhook delivery is **at least once** and is not ordered. The same event can be
delivered more than once, and a later lifecycle event can arrive before an
earlier one.

Design your receiver to:

* verify the signature before parsing or processing the payload;
* deduplicate events by the stable `event_id`;
* use `source_revision` and `source_ordinal` when ordering events from the same
  producer is necessary;
* durably record accepted work before returning a `2xx` response; and
* process expensive or failure-prone work asynchronously.

Tensorlake uses Svix to sign messages and deliver them to your endpoint. Svix
retries failed endpoint attempts. A successful response from your endpoint
acknowledges that delivery attempt; it does not change the underlying
Tensorlake resource.

## Next steps

* [Configure and manage a destination](./configuration)
* [Understand event payloads](./events)
* [Verify webhook signatures](./signature-verification)
* [Send a test event](./testing)
