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

# Receive events and recover missed delivery

> Configure signed webhook delivery, deduplicate attempts, inspect failures, and recover retained event history through authenticated feeds.

Webhooks notify an HTTPS receiver about source or destination events, or periodic digests. Delivery requires the hosted environment's transport configuration. Read [capability status](/capability-status) before expecting an endpoint to send.

## Prepare the receiver

1. Accept the raw HTTP request body before JSON parsing.
2. Verify `Linktrail-Signature` against the raw body and `Linktrail-Timestamp` using the documented signing procedure and an allowed timestamp window.
3. Deduplicate by `Linktrail-Delivery-Id`.
4. Persist accepted work before acknowledging success, then process it outside the request when needed.

[Webhook reference](/reference/webhooks) defines the signed bytes, headers, payloads and recovery notices. Re-encoding parsed JSON before verification changes the signed input.

## Create and verify the subscription

Call [create\_webhook](/reference/commands/create_webhook) with your HTTPS URL, intended project scope, feeds and delivery mode. Store the returned signing secret in the receiver's secret store: it appears once. A new endpoint starts at the current sequence, so retrieve earlier retained events through their authenticated feeds.

Generate an authorized event in the selected scope and inspect [list\_webhook\_deliveries](/reference/commands/list_webhook_deliveries). Confirm your receiver accepted the signature and stored the delivery identifier. Endpoint creation alone proves no delivery.

## Recover after a failure

Delivery is at least once. Use [list\_webhooks](/reference/commands/list_webhooks) to inspect state and disable reason, and delivery history for HTTP status and attempt details. A receiver response of 410 disables delivery. Correct the receiver before [reactivating the endpoint](/reference/commands/set_webhook_state).

Read missed [source events](/reference/commands/list_link_events) and [destination events](/reference/commands/list_target_events) with separate cursors. If retention expired, follow the returned snapshot recovery procedure and record the history gap. A history-gap notice requires authenticated recovery; it cannot reconstruct deleted event history.

Rotate with [rotate\_webhook\_secret](/reference/commands/rotate_webhook_secret). During overlap, both active secrets sign requests. Update and verify the receiver before retiring the older secret. Use [sync and export](/guides/sync-and-export) for ledger recovery and [troubleshooting](/guides/troubleshooting) for persistent failures.
