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

# Webhooks

> Send real-time event data to external systems.

Webhooks let you send data to external systems whenever specific events occur in Juiced. When an event fires, the system sends a payload to your configured URL.

## Creating a webhook

1. Navigate to the webhooks settings page
2. Select the event you want to listen for
3. Click create
4. Configure the destination URL and payload

## Available events

| Event                         | Description                                                          |
| ----------------------------- | -------------------------------------------------------------------- |
| Customer Created              | A new customer account is created                                    |
| Lead Assigned                 | A single lead is assigned to a customer                              |
| Lead Created                  | A new lead is created                                                |
| Lead Not Assigned             | A lead fails to be assigned after exhausting all distribution stages |
| Lead Duplicated               | A lead is rejected as a duplicate                                    |
| Lead Posted                   | A lead is sent to an external system                                 |
| Transaction Updated           | A transaction is created or updated                                  |
| State Lead Type Stats Updated | Lead type statistics are updated at the state level                  |
| User Attached to Customer     | A user is added to a customer account                                |

## Payload templates

Webhook payloads are JSON. You can customize the payload structure using a template with merge fields in double curly braces: `{{ variable_name }}`.

Lead-based events (Lead Assigned, Lead Created, Lead Not Assigned, Leads Assigned, Lead Duplicated, and Lead Posted) all share the same payload structure. This includes a `{{ deliverable_fields }}` variable that dynamically expands to all deliverable fields for the lead category as raw JSON key-value pairs. The payload automatically adapts when fields are added or removed from a lead category—no template changes needed.

### Field access

Lead fields are available in two formats:

* **Flat**: `{{ first_name }}`, `{{ last_name }}`, `{{ email }}`, `{{ phone }}`
* **Nested**: `{{ lead.first_name }}`, `{{ lead.last_name }}`, `{{ lead.email }}`, `{{ lead.phone }}`

Both formats work identically. The nested format is useful when building complex templates or integrating with systems that expect a specific payload structure. Custom fields from the lead category are accessible via `{{ lead.details.field_name }}`.

These webhook payloads also include `lead_public_id` as a top-level field, which provides a human-readable identifier for the lead (e.g., `lead_01arz3ndektsv4rrffq69g5fav`).

Customer and transaction events include `{{ customer_public_id }}`—a stable, prefixed identifier for the customer (e.g., `cus_01arz3ndektsv4rrffq69g5fav`). For lead events, use `{{ buyer.customer_public_id }}` to reference the buyer's public ID. These identifiers are safe to use in external systems and won't change if internal database IDs shift.

For more details on customer-facing webhook configuration, see [Customer Portal > Notifications](/customer-portal/notifications#webhooks).

## How it works

When one of your configured events occurs, Juiced sends an HTTP request to your specified URL with the relevant payload. This allows you to:

* Sync data to your CRM
* Trigger automations in external tools
* Update dashboards or reporting systems
* Send notifications through your own channels

## Reliability

Juiced includes built-in reliability features to help ensure your webhooks are delivered:

* **Automatic retries** — If your endpoint returns a server error (5xx status code) or the connection fails, the system automatically retries the request up to 3 times with a brief delay between attempts.
* **Error isolation** — If you have multiple webhooks configured, a failure in one doesn't prevent others from being delivered. Each webhook is processed independently.
* **Timeouts** — Requests have a configurable timeout to prevent indefinitely hanging connections.

## Related guides

<Card title="Sending events to your webhook" icon="webhook" href="/guides/sending-events-to-your-webhook" horizontal>
  Register a webhook, wire it to an event, shape the payload, and test the delivery.
</Card>
