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

# Webhooks

> Receive events from external platforms in Sagepilot or send Sagepilot events to a client-owned endpoint.

Webhooks allow Sagepilot and external systems to exchange events automatically. The webhook you need depends on which system produces the event and which system receives it.

| Requirement                                                           | Webhook to use             | Direction                      |
| --------------------------------------------------------------------- | -------------------------- | ------------------------------ |
| Receive events from a platform with a native Sagepilot integration    | Native integration webhook | Native integration → Sagepilot |
| Receive events from a platform without a native Sagepilot integration | Custom webhook             | Client system → Sagepilot      |
| Send Sagepilot events to a client-owned system                        | Event webhook              | Sagepilot → Client system      |

## Native integration webhooks

Use a native integration webhook when Sagepilot already supports the external platform. After you install the integration, Sagepilot generates a webhook URL for that workspace and integration.

Add this URL to the provider's webhook settings and select the events the provider should send. Sagepilot processes these events and makes supported events available for analytics and journey automation.

For example, after installing ClickPost, open **Settings → Integrations → ClickPost → Webhook**, copy the generated URL, and add it in ClickPost to receive events such as shipment picked up, in transit, out for delivery, delivered, failed delivery, delayed, return-to-origin, return, exchange, and refund updates.

## When to use a custom webhook

Use a Custom Webhook when a client needs to send events from a system that does not have a native Sagepilot integration.

Common examples include:

* A proprietary order-management system sending `order_created`
* A payment system sending `payment_failed`
* A CRM sending `lead_created`
* A client backend sending subscription, appointment, or account events

For each event, create a custom trigger using a representative JSON payload. Sagepilot uses the payload to identify the customer, define journey variables, and generate a unique webhook URL.

After creating the Custom Webhook integration, go to **Settings → Integrations → Custom Webhook → Configure**. Open the required trigger to find its **Webhook URL** and sample `curl` request.

The client system must send an HTTP `POST` request containing a JSON object to this URL whenever the event occurs. Sagepilot can use the event to start a journey, continue a journey waiting for that event, or stop a journey configured with it as a termination event.

<Card title="Configure a custom webhook" href="/api-reference/webhooks/custom-webhooks">
  Create a trigger, map customer identity fields, and send JSON events to Sagepilot.
</Card>

## Send Sagepilot events to a client

Use an Event Webhook when a client wants to receive events produced by Sagepilot.

Go to **Settings → Event Webhooks** and click **Add webhook**. Select **Own backend**, enter the client's destination URL, choose the applicable channels, and select the events Sagepilot should deliver.

Available Sagepilot events include:

* WhatsApp message sent, delivered, read, and failed
* New customer message
* New support-agent message
* Conversation status changed
* Conversation assignee changed

Sagepilot sends the selected events to the client's endpoint as signed HTTP requests. The receiving service should verify the Sagepilot signature before processing each payload.

<Card title="Configure event webhooks" href="/settings/event-webhooks">
  Send Sagepilot message, delivery, and conversation events to a client-owned endpoint.
</Card>

## Choose the correct webhook

Use a native integration webhook when Sagepilot supports the provider. Use a Custom Webhook when an unsupported system needs to send events into Sagepilot. Use an Event Webhook when Sagepilot needs to send its events to a client.
