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

# Webhook events

## Webhook Events

Seleqt can POST an event to your own URL when something happens in your workspace: a lead is added, replies, is tagged Interested, changes status, or a campaign completes.

Webhook endpoints are set up by an Admin in the app under **Settings › Public API › Webhook events**: add an `https://` URL, pick the events it receives and copy its signing secret. Use **Send test** there to receive a sample of any event (sent with `"test": true` and placeholder values).

### Events

| Event | When it is sent |
| - | - |
| `lead.added` | A lead is added to a campaign. |
| `lead.replied` | A lead replies on any channel. |
| `lead.interested` | A reply is tagged Interested (by AI or by hand). |
| `campaign.completed` | Every lead in a campaign has finished its sequence. |
| `lead.status_changed` | A lead's [status](https://docs.seleqt.ai/api-reference/public/lead-status.md) changes — Stopped stops all outreach. |

### Delivery

Every event is a `POST` with a JSON body:

```json theme={null}
{
  "id": "evt_5f0c3a9e2b7d4c1f8a6e0b9d2c4f7a13",
  "event": "lead.status_changed",
  "created_at": "2026-11-24T10:05:11.482113+00:00",
  "workspace_id": 12,
  "test": false,
  "data": { }
}
```

| Field | Type | Description |
| - | - | - |
| `id` | string | Event ID. The same across retries — use it to ignore duplicates. |
| `event` | string | The event name. |
| `created_at` | string | When the event happened (ISO 8601). |
| `workspace_id` | integer | The workspace it happened in. |
| `test` | boolean | `true` for a test sent from the app. |
| `data` | object | The event's payload, below. |

Headers:

```http theme={null}
Content-Type: application/json
User-Agent: Seleqt-Webhooks/1.0
X-Seleqt-Event: lead.status_changed
X-Seleqt-Delivery: evt_5f0c3a9e2b7d4c1f8a6e0b9d2c4f7a13
X-Seleqt-Timestamp: 1795514711
X-Seleqt-Signature: t=1795514711,v1=3b1f0e9c...
```

* Reply with any `2xx` status within 10 seconds. Otherwise Seleqt retries 5 times, after 1, 2, 4, 8 and 16 minutes.
* **Verify the signature:** `v1` is the hex HMAC-SHA256 of `"<timestamp>.<raw body>"` with your endpoint's signing secret. Compute it over the raw request body (not re-serialized JSON) and reject old timestamps (e.g. older than 5 minutes) to stop replays.

```javascript theme={null}
import crypto from "crypto";

function verify(rawBody, header, secret) {
  const { t, v1 } = Object.fromEntries(header.split(",").map((p) => p.split("=")));
  if (Math.abs(Date.now() / 1000 - Number(t)) > 300) return false;
  const expected = crypto.createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex");
  return crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(v1));
}
```

### The lead object

The `lead` in each lead event:

```json theme={null}
{
  "id": 2001,
  "first_name": "Alex",
  "last_name": "Doe",
  "email": "alex@acme.com",
  "linkedin_url": "https://www.linkedin.com/in/alex-doe/",
  "job_title": "Head of Sales",
  "company": "Acme Inc",
  "status": "CONTACTED",
  "score": 82,
  "campaign": { "id": 456, "name": "Q4 founders" }
}
```

`campaign` is `null` for a lead that is only in a lead list.

***

### lead.added

A lead is added to a campaign.

```json theme={null}
{
  "lead": {
    "id": 2001, "first_name": "Alex", "last_name": "Doe", "email": "alex@acme.com",
    "linkedin_url": "https://www.linkedin.com/in/alex-doe/", "job_title": "Head of Sales",
    "company": "Acme Inc", "status": "IN_REVIEW", "score": null,
    "campaign": { "id": 456, "name": "Q4 founders" }
  }
}
```

### lead.replied

A lead replies on any channel.

```json theme={null}
{
  "lead": { "id": 2001, "first_name": "Alex", "last_name": "Doe", "...": "the lead object" },
  "message": {
    "id": 98012,
    "text": "Thanks — happy to talk next week.",
    "subject": null,
    "channel": "LINKEDIN",
    "sent_at": "2026-11-24T09:58:40+00:00"
  }
}
```

### lead.interested

A reply is tagged Interested, by Seleqt's reply classification or by hand in the inbox.

```json theme={null}
{
  "lead": { "id": 2001, "first_name": "Alex", "last_name": "Doe", "...": "the lead object" },
  "classification": { "intent": "INTERESTED", "confidence": 93, "method": "LLM" },
  "message": {
    "id": 98012,
    "text": "Thanks — happy to talk next week.",
    "subject": null,
    "channel": "LINKEDIN",
    "sent_at": "2026-11-24T09:58:40+00:00"
  }
}
```

### campaign.completed

Every lead in a campaign has finished its sequence. Sent once per campaign; sent again only if new leads were added and finished too.

```json theme={null}
{
  "campaign": { "id": 456, "name": "Q4 founders" },
  "stats": { "leads": 120, "completed": 97, "replied": 18, "failed": 3, "unsubscribed": 2 }
}
```

### lead.status\_changed

A lead's [status](https://docs.seleqt.ai/api-reference/public/lead-status.md) changed — set by Seleqt, by a person, by a Google Sheet or CRM sync, or through the API. Sent once per change of the person (not once per campaign they are in).

```json theme={null}
{
  "lead": {
    "id": 2001,
    "first_name": "Alex",
    "last_name": "Doe",
    "email": "alex@acme.com",
    "linkedin_url": "https://www.linkedin.com/in/alex-doe/",
    "job_title": "Head of Sales",
    "company": "Acme Inc",
    "status": "CONTACTED",
    "score": 82,
    "campaign": { "id": 456, "name": "Q4 founders" },
    "lead_status": "STOPPED"
  },
  "previous_status": "ACTIVE",
  "status": "STOPPED",
  "source": "SHEET",
  "integration_type": "GOOGLE_SHEETS",
  "stopped_campaigns": 1
}
```

| Field | Type | Description |
| - | - | - |
| `lead.lead_status` | string | The new status (same as `status`). |
| `previous_status` | string \| null | The status before; `null` for a lead's first status. |
| `status` | string | The new status: `ACTIVE`, `REPLIED`, `INTERESTED`, `MEETING_BOOKED`, `NOT_INTERESTED`, `BOUNCED`, `UNSUBSCRIBED` or `STOPPED`. |
| `source` | string | `SELEQT` (automatic), `MANUAL` (a person in the app), `SHEET` (Google Sheet sync), `CRM` (CRM sync) or `API` (API key or MCP connector). |
| `integration_type` | string \| null | For `SHEET` / `CRM`: `GOOGLE_SHEETS`, `HUBSPOT`, `PIPEDRIVE`, ... |
| `stopped_campaigns` | integer | How many campaign sequences this change stopped. `0` when the status doesn't stop outreach. |

`lead.status` is the lead's row status in its list or campaign (`IN_REVIEW`, `CONTACTED`, ...), not the lead status.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.