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

# Overview

> Introduction to webhooks

## What are Webhooks?

Webhooks are HTTP callbacks that notify your system when events occur on the Leavo platform.

## Webhook Types

<CardGroup cols={2}>
  <Card title="Inbound" icon="arrow-down">
    Receive notifications about events in your Leavo account (new leads, status changes, etc.)
  </Card>

  <Card title="Outbound" icon="arrow-up">
    Receive AI response callbacks when using debounce mode
  </Card>
</CardGroup>

## Supported Events

| Event                 | Description             |
| --------------------- | ----------------------- |
| `lead.created`        | New lead created        |
| `lead.updated`        | Lead data updated       |
| `lead.deleted`        | Lead deleted            |
| `lead.status_changed` | Lead status changed     |
| `message.received`    | New message received    |
| `message.sent`        | Message sent            |
| `ai.response`         | AI processing completed |

## Webhook Payload

```json theme={null}
{
  "event": "lead.created",
  "timestamp": "2024-01-15T10:30:00Z",
  "data": {
    "id": "lead-uuid",
    "name": "John Smith",
    "phone": "+15551234567",
    "email": "john@example.com"
  }
}
```

## Best Practices

<Steps>
  <Step title="Respond Quickly">
    Return HTTP 200 as fast as possible. Process in background.
  </Step>

  <Step title="Handle Duplicates">
    Implement idempotency - the same event may be sent multiple times.
  </Step>

  <Step title="Verify Origin">
    Validate that the request actually came from Leavo.
  </Step>

  <Step title="Log Everything">
    Keep logs of all received events for debugging.
  </Step>
</Steps>
