Skip to main content
Lago generates several events that you can listen to and use to trigger workflows. Every event appears in the webhook logs of the Lago app, where you can inspect it, detect errors and retry it.

Adding a webhook URL

To add a webhook endpoint via the Lago app, follow these steps:
  1. Go to the Developers section via the sidebar;
  2. Open the Webhooks tab;
  3. Click Add an endpoint;
  4. Enter the webhook name and URL;
  5. Choose the webhook signature between HMAC and JWT;
  6. Define the events you want to listen to by selecting the relevant checkboxes; and
  7. Click Create endpoint to confirm.
You can add up to 10 webhook endpoints.

The webhook signature

When you create a webhook endpoint, you choose between two signature options. Lago uses JWT when you do not choose one.
  • JWT embeds the payload in the signature header, so the header can grow large and some servers reject it;
  • HMAC sends a short signature header, so header size is never an issue.
Webhook endpoint settings with the HMAC and JWT signature options

Webhook endpoint signature

Locate your HMAC signature token

To find your HMAC signature token, go to Developers > Webhooks and locate the HMAC signature token. Then reveal and copy the key.
HMAC signature token in the Webhooks tab, with the reveal option open

Locate your HMAC signature token

Accessing the webhook logs

Once a webhook is registered in the app, you can access the webhook logs:
  1. Go to the Developers section via the sidebar;
  2. Open the Webhooks tab;
  3. Click the webhook endpoint, then open the Deliveries tab to see the list of events;
  4. Filter events by dates, types, HTTP status and status; and
  5. Click Refresh to load new events (optional).
List of webhook deliveries with the filters panel open

Webhook logs

Accessing a specific event

Click an event to see its details. Depending on the event status, Lago shows two or three main blocks:
  1. A list of properties, including:
    1. Timestamp: the timestamp of the event;
    2. Webhook URL: the URL used to listen to events;
    3. Unique key: idempotency key associated with the event;
    4. Webhook type: the webhook type used to understand the action triggered;
    5. Response: the response code (i.e. acknowledgment of receipt);
    6. Number of retries: if the event failed, the number of retries attempted;
  2. A JSON snippet with the arguments sent by Lago; and
  3. The error response, when the event failed.

Errors and retries

Your webhook server should respond with a 200, 201, 202, or 204 status code to acknowledge receipt of the event. Lago marks any other response as failed. If your server does not acknowledge an event, Lago displays an error status in the webhook logs. Lago makes up to 3 delivery attempts per event: the initial call plus 2 retries. On self-hosted instances, set the total number of attempts with LAGO_WEBHOOK_ATTEMPTS (default: 3) and the request timeout with LAGO_WEBHOOK_TIMEOUT_SECONDS (default: 30 seconds).