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

# Webhook Events

> Complete catalog of webhook event types and their payloads

# Webhook Events

Subscribe to these events to receive real-time notifications. All payloads are wrapped in the standard [webhook format](/api-reference/webhooks#payload-format).

## CRM Events

### lead.created

Fired when a new lead is created.

```json theme={null}
{
  "event": "lead.created",
  "timestamp": "2025-01-15T10:30:00.000Z",
  "payload": {
    "id": "ld_abc123",
    "name": "Jane Smith",
    "mobile": "+1234567890",
    "email": "jane@example.com",
    "secondaryMobile": null,
    "title": "Product Demo Request",
    "value": 5000,
    "source": "Website",
    "createdAt": "2025-01-15T10:30:00.000Z",
    "website": null,
    "archived": false,
    "stage": "New",
    "stageId": 1,
    "customFields": {},
    "ownerId": 42,
    "ownerName": "John Doe"
  }
}
```

### lead.updated

Fired when a lead is updated (any field change).

Payload structure is the same as `lead.created` with the updated values.

### lead.deleted

Fired when a lead is deleted.

Payload contains the lead data as it was before deletion.

### lead.stageChanged

Fired when a lead moves to a different stage. This event fires in addition to `lead.updated`.

Payload structure is the same as `lead.created` with the new stage values.

***

### deal.created

Fired when a new deal is created.

```json theme={null}
{
  "event": "deal.created",
  "timestamp": "2025-01-15T10:30:00.000Z",
  "payload": {
    "id": "dl_def456",
    "title": "Enterprise License",
    "number": "DL-0001",
    "price": 25000,
    "status": "ACTIVE",
    "priority": "HIGH",
    "expectedCloseDate": "2025-03-15T00:00:00.000Z",
    "createdAt": "2025-01-15T10:30:00.000Z",
    "client": {
      "id": "cl_xyz789",
      "name": "Acme Inc.",
      "number": "CL-0001",
      "taxNumber": null,
      "website": null,
      "customFields": {},
      "type": "company",
      "firstName": null,
      "lastName": null,
      "email": "info@acme.com",
      "phone": "+1234567890"
    },
    "stage": "Proposal",
    "stageId": 11,
    "pipelineId": 1,
    "source": "Referral",
    "leadId": "ld_abc123",
    "leadName": "Jane Smith",
    "ownerId": 42,
    "ownerName": "John Doe",
    "customFields": {}
  }
}
```

### deal.updated

Fired when a deal is updated. Payload structure is the same as `deal.created`.

### deal.deleted

Fired when a deal is deleted. Payload contains the deal data before deletion.

### deal.stageChanged

Fired when a deal moves to a different pipeline stage. Fires in addition to `deal.updated`.

***

### client.created

Fired when a new client is created.

```json theme={null}
{
  "event": "client.created",
  "timestamp": "2025-01-15T10:30:00.000Z",
  "payload": {
    "id": "cl_xyz789",
    "name": "Acme Inc.",
    "number": "CL-0001",
    "taxNumber": "TAX123456",
    "website": "https://acme.com",
    "customFields": {},
    "type": "company",
    "firstName": null,
    "lastName": null,
    "email": "info@acme.com",
    "phone": "+1234567890"
  }
}
```

### client.updated

Fired when a client is updated. Payload structure is the same as `client.created`.

### client.deleted

Fired when a client is deleted. Payload contains the client data before deletion.

***

<Note>
  Contact webhook events (`contact.created`, `contact.updated`,
  `contact.deleted`) are planned but not yet implemented. They will be available
  in a future release.
</Note>

### contact.created

Fired when a new contact is created.

```json theme={null}
{
  "event": "contact.created",
  "timestamp": "2025-01-15T10:30:00.000Z",
  "payload": {
    "id": "ct_qrs567",
    "firstName": "Jane",
    "lastName": "Smith",
    "email": "jane@acme.com",
    "mobile": "+1234567890",
    "designation": "CTO",
    "clientId": "cl_xyz789",
    "createdAt": "2025-01-15T10:30:00.000Z"
  }
}
```

### contact.updated

Fired when a contact is updated.

### contact.deleted

Fired when a contact is deleted.

### contact.stageChanged

Fired when a contact lifecycle stage changes.

***

## Sales Events

### invoice.created

Fired when a new invoice is created.

```json theme={null}
{
  "event": "invoice.created",
  "timestamp": "2025-01-15T10:30:00.000Z",
  "payload": {
    "id": "inv_ghi012",
    "number": "INV-0001",
    "clientId": "cl_xyz789",
    "clientName": "Acme Inc.",
    "status": "SENT",
    "total": 25000,
    "dueDate": "2025-02-15T00:00:00.000Z",
    "salesPersonId": 42,
    "createdAt": "2025-01-15T10:30:00.000Z"
  }
}
```

### invoice.updated

Fired when an invoice is updated.

### invoice.paid

Fired when an invoice is marked as paid.

### invoice.deleted

Fired when an invoice is deleted.

### invoice.statusChanged

Fired when an invoice status changes.

***

### quotation.created

Fired when a new quotation is created.

```json theme={null}
{
  "event": "quotation.created",
  "timestamp": "2025-01-15T10:30:00.000Z",
  "payload": {
    "id": "qt_jkl345",
    "number": "QT-0001",
    "clientId": "cl_xyz789",
    "clientName": "Acme Inc.",
    "status": "DRAFT",
    "total": 25000,
    "dealId": "dl_def456",
    "createdAt": "2025-01-15T10:30:00.000Z"
  }
}
```

### quotation.updated

Fired when a quotation is updated.

### quotation.deleted

Fired when a quotation is deleted.

### quotation.statusChanged

Fired when a quotation status changes.

### payment.received

Fired when a payment is received.

***

### form.response.created

Fired when a new form response is submitted.

```json theme={null}
{
  "event": "form.response.created",
  "timestamp": "2025-01-15T10:30:00.000Z",
  "payload": {
    "id": "rec_mno678",
    "formId": "frm_pqr901",
    "data": {
      "name": "Jane Smith",
      "email": "jane@example.com",
      "message": "I'd like to learn more about your services."
    },
    "createdAt": "2025-01-15T10:30:00.000Z"
  }
}
```

***

## Event summary

| Event                     | Category | Description                                  |
| ------------------------- | -------- | -------------------------------------------- |
| `lead.created`            | CRM      | New lead created                             |
| `lead.updated`            | CRM      | Lead fields updated                          |
| `lead.deleted`            | CRM      | Lead deleted                                 |
| `lead.stageChanged`       | CRM      | Lead moved to a different stage              |
| `deal.created`            | CRM      | New deal created                             |
| `deal.updated`            | CRM      | Deal fields updated                          |
| `deal.deleted`            | CRM      | Deal deleted                                 |
| `deal.stageChanged`       | CRM      | Deal moved to a different pipeline stage     |
| `client.created`          | CRM      | New client created                           |
| `client.updated`          | CRM      | Client fields updated                        |
| `client.deleted`          | CRM      | Client deleted                               |
| `contact.created`         | CRM      | New contact created                          |
| `contact.updated`         | CRM      | Contact fields updated                       |
| `contact.deleted`         | CRM      | Contact deleted                              |
| `contact.stageChanged`    | CRM      | Contact moved to a different lifecycle stage |
| `invoice.created`         | Sales    | New invoice created                          |
| `invoice.updated`         | Sales    | Invoice fields updated                       |
| `invoice.paid`            | Sales    | Invoice marked as paid                       |
| `invoice.deleted`         | Sales    | Invoice deleted                              |
| `invoice.statusChanged`   | Sales    | Invoice status changed                       |
| `quotation.created`       | Sales    | New quotation created                        |
| `quotation.updated`       | Sales    | Quotation fields updated                     |
| `quotation.deleted`       | Sales    | Quotation deleted                            |
| `quotation.statusChanged` | Sales    | Quotation status changed                     |
| `payment.received`        | Sales    | Payment received                             |
| `form.response.created`   | CRM      | New form response submitted                  |

## Payload design

Webhook payloads follow these conventions:

* **IDs included** for all related entities (e.g., `ownerId`, `leadId`, `stageId`)
* **Key scalar fields** for immediate identification (e.g., `ownerName`, `leadName`)
* **Related entity objects** may be included for convenience (e.g., `client` in deal events)
* **Public IDs** used for entities that support them (leads, clients, deals)

Use the [REST API](/api-reference/introduction) to fetch additional details not included in the webhook payload.
