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

# Event Types

> Complete reference of all webhook event types you can subscribe to.

## Available Events

Subscribe to any combination of these event types when creating or updating a webhook.

Every delivery is a POST request whose JSON body has four top-level fields: `id` (the event ID), `type` (the event type), `payload` (event-specific data, shown per event below), and `timestamp` (ISO 8601 creation time). The examples below omit `id` for brevity.

### Email Events

<ResponseField name="email.sent" type="event">
  Fired when an email is successfully sent from a campaign sequence.

  ```json theme={null}
  {
    "type": "email.sent",
    "timestamp": "2025-01-15T10:30:00Z",
    "payload": {
      "emailLogId": "cel_123",
      "campaignId": "cmp_456",
      "leadId": "cld_789",
      "toEmail": "john@example.com",
      "fromEmail": "you@company.com",
      "subject": "Quick question",
      "sequenceStep": 1
    }
  }
  ```
</ResponseField>

<ResponseField name="email.failed" type="event">
  Fired when an email fails to send (SMTP error, authentication issue, etc.).

  ```json theme={null}
  {
    "type": "email.failed",
    "timestamp": "2025-01-15T10:30:00Z",
    "payload": {
      "emailLogId": "cel_123",
      "campaignId": "cmp_456",
      "leadId": "cld_789",
      "toEmail": "john@example.com",
      "error": "SMTP connection timeout"
    }
  }
  ```
</ResponseField>

<ResponseField name="email.bounced" type="event">
  Fired when a sent email bounces back.

  ```json theme={null}
  {
    "type": "email.bounced",
    "timestamp": "2025-01-15T10:30:00Z",
    "payload": {
      "emailLogId": "cel_123",
      "campaignId": "cmp_456",
      "leadId": "cld_789",
      "toEmail": "john@example.com",
      "bounceType": "hard"
    }
  }
  ```
</ResponseField>

<ResponseField name="email.opened" type="event">
  Fired when a recipient opens a tracked email.

  ```json theme={null}
  {
    "type": "email.opened",
    "timestamp": "2025-01-15T14:22:00Z",
    "payload": {
      "emailLogId": "cel_123",
      "campaignId": "cmp_456",
      "leadId": "cld_789",
      "toEmail": "john@example.com"
    }
  }
  ```
</ResponseField>

### Reply Events

<ResponseField name="reply.received" type="event">
  Fired when a reply is received and matched to a lead/campaign.

  ```json theme={null}
  {
    "type": "reply.received",
    "timestamp": "2025-01-15T15:00:00Z",
    "payload": {
      "replyId": "crp_123",
      "campaignId": "cmp_456",
      "leadId": "cld_789",
      "fromEmail": "john@example.com",
      "subject": "Re: Quick question",
      "bodyPreview": "Thanks for reaching out..."
    }
  }
  ```
</ResponseField>

<ResponseField name="reply.categorized" type="event">
  Fired when a reply is categorized (by AI or manually).

  ```json theme={null}
  {
    "type": "reply.categorized",
    "timestamp": "2025-01-15T15:01:00Z",
    "payload": {
      "replyId": "crp_123",
      "category": "interested",
      "previousCategory": "uncategorized"
    }
  }
  ```
</ResponseField>

### Campaign Events

<ResponseField name="campaign.started" type="event">
  Fired when a campaign transitions to active status.

  ```json theme={null}
  {
    "type": "campaign.started",
    "timestamp": "2025-01-15T09:00:00Z",
    "payload": {
      "campaignId": "cmp_456",
      "name": "Q1 Outreach",
      "totalLeads": 500
    }
  }
  ```
</ResponseField>

<ResponseField name="campaign.paused" type="event">
  Fired when a campaign is paused.

  ```json theme={null}
  {
    "type": "campaign.paused",
    "timestamp": "2025-01-15T16:00:00Z",
    "payload": {
      "campaignId": "cmp_456",
      "name": "Q1 Outreach"
    }
  }
  ```
</ResponseField>

<ResponseField name="campaign.completed" type="event">
  Fired when all leads in a campaign have been processed.

  ```json theme={null}
  {
    "type": "campaign.completed",
    "timestamp": "2025-02-01T12:00:00Z",
    "payload": {
      "campaignId": "cmp_456",
      "name": "Q1 Outreach",
      "totalSent": 1500,
      "totalReplied": 45,
      "totalBounced": 12
    }
  }
  ```
</ResponseField>

### Lead Events

<ResponseField name="lead.created" type="event">
  Fired when a new lead is created (via API, CSV import, or manually).

  ```json theme={null}
  {
    "type": "lead.created",
    "timestamp": "2025-01-15T10:00:00Z",
    "payload": {
      "leadId": "cld_789",
      "email": "john@example.com",
      "firstName": "John",
      "lastName": "Doe",
      "source": "api"
    }
  }
  ```
</ResponseField>

<ResponseField name="lead.updated" type="event">
  Fired when a lead's information is updated.

  ```json theme={null}
  {
    "type": "lead.updated",
    "timestamp": "2025-01-15T10:05:00Z",
    "payload": {
      "leadId": "cld_789",
      "updatedFields": ["company", "title"]
    }
  }
  ```
</ResponseField>

## Listing Available Events

You can also retrieve the list of supported event types programmatically:

```bash theme={null}
curl https://api.foxreach.io/api/v1/webhooks/events \
  -H "X-API-Key: otr_your_key"
```
