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

# Webhooks

> Receive real-time notifications when interviews are updated

Classet can send HTTP POST requests to your server when events happen — like an interview completing or a candidate's status changing.

Classet sends two kinds of event to the same webhook URL:

* **[Interview events](#interview-events)** (`candidate.interview.updated`) are on for every organization with a webhook URL.
* **[v2 events](#v2-events-beta)** (`interview.completed`, `application.stage_changed` and six more) arrive in a signed, versioned envelope. They are in beta and enabled per organization.

Once v2 events are on for your organization, most interview events stop, but not all: during the beta your endpoint can receive both formats. Tell them apart by the top-level keys. A v2 event has `type` and `api_version`; an interview event has `event`.

> [!WARNING]
>
> v2 events are a limited beta. Configuring or testing a URL does not opt an organization into them. Until they are enabled for yours, rely on interview events, or poll [Get Interview](/docs/api-reference/candidates/get-interview.md).

## Webhook URL management

You can add, update, and manage your webhook URLs through the [Developer Settings](https://app.classet.ai/settings/developers) page or via the [Webhooks API](/docs/api-reference/webhooks/get-config.md).

From the dashboard, you can:

* **Register** new webhook URLs
* **Edit** or **delete** existing webhook URLs
* **View** recent webhook delivery logs and retry attempts

***

## Verifying webhook requests

Classet supports two methods for verifying webhook requests:

### Method 1: Webhook signature (recommended)

Each webhook request includes an `x-classet-webhook-signature` header containing an HMAC-SHA256 signature of the request body.

**Setup:**

1. Navigate to **Developer Settings** in the Classet dashboard
2. Scroll to the **Interview Events Webhook** section
3. Click **Generate Signature** to create a webhook signing secret
4. Copy and store the secret securely — you won't be able to view it again

**Verification example (Node.js):**

```javascript theme={null}
const crypto = require('crypto');

function verifyWebhookSignature(rawBody, headers, webhookSecret) {
  const signatures = (headers['x-classet-webhook-signature'] || '').split(',');

  const expectedSignature = crypto
    .createHmac('sha256', webhookSecret)
    .update(rawBody, 'utf8')
    .digest('base64url');

  return signatures.some(
    (sig) => sig.length === expectedSignature.length &&
      crypto.timingSafeEqual(Buffer.from(sig), Buffer.from(expectedSignature))
  );
}

app.post('/webhooks/classet', express.raw({ type: 'application/json' }), (req, res) => {
  const rawBody = req.body.toString('utf8');
  if (!verifyWebhookSignature(rawBody, req.headers, process.env.CLASSET_WEBHOOK_SECRET)) {
    return res.status(401).json({ error: 'Invalid signature' });
  }
  const event = JSON.parse(rawBody);
  // Process the webhook...
  res.status(200).json({ received: true });
});
```

> [!NOTE]
>
> * The signature uses **base64url encoding** (URL-safe base64)
> * Compute the HMAC over the **raw request body** exactly as received. Re-serializing a parsed body can reorder keys or change whitespace, and the signature won't match. With Express, read the body with `express.raw({ type: 'application/json' })`.
> * On [v2 events](#v2-events-beta), during a secret rotation the header carries two signatures separated by a comma, one per secret. Accept the request if either one matches.
> * Use **constant-time comparison** (`timingSafeEqual`) to prevent timing attacks
> * Store your webhook secret in environment variables or a secrets manager

### Replay protection (v2 events)

[v2 events](#v2-events-beta) also carry `X-Classet-Timestamp` (Unix seconds) and `X-Classet-Signature-V2`, an HMAC-SHA256 of `{timestamp}.{raw body}`, base64url-encoded. Because the timestamp is signed, you can reject a captured request that is replayed long after it was sent.

The timestamp is set once, when the event is first sent, and every retry reuses it. Retries can arrive hours later, so a window of a few minutes rejects legitimate retries after an outage. Use a window that covers the whole retry period, such as 24 hours, and deduplicate on `event_id` to drop replays inside it:

```javascript theme={null}
function verifyV2(rawBody, headers, webhookSecret) {
  const timestamp = headers['x-classet-timestamp'];
  const signatures = (headers['x-classet-signature-v2'] || '').split(',');
  const MAX_AGE_SECONDS = 24 * 60 * 60; // covers the full retry period
  if (!timestamp || Math.abs(Date.now() / 1000 - Number(timestamp)) > MAX_AGE_SECONDS) return false;

  const expected = crypto
    .createHmac('sha256', webhookSecret)
    .update(`${timestamp}.${rawBody}`, 'utf8')
    .digest('base64url');

  return signatures.some(
    (sig) => sig.length === expected.length &&
      crypto.timingSafeEqual(Buffer.from(sig), Buffer.from(expected))
  );
}
```

v2 events still send `x-classet-webhook-signature` (and its alias `X-Classet-Signature`), computed as in Method 1, so an existing signature verifier keeps working.

> [!WARNING]
>
> v2 events are signed only when a webhook signing secret is configured, and they never send `x-classet-key`. If you verify with the API key (Method 2), generate a signing secret before v2 events are enabled for your organization.

### Method 2: API key verification (legacy)

If you haven't configured a webhook signature, Classet sends your API key in the `x-classet-key` header as a fallback.

```javascript theme={null}
const apiKey = request.headers['x-classet-key'];
if (!apiKey || !isValidApiKey(apiKey)) {
  return response.status(401).json({ error: 'Unauthorized' });
}
```

> [!WARNING]
>
> We recommend migrating to webhook signature verification for improved security.

***

## Interview events

The **Interview Events** webhook triggers when an interview has been updated. It is on for every organization with a webhook URL, until [v2 events](#v2-events-beta) are enabled for it.

### Event: `candidate.interview.updated`

Fires when an interview's details change — typically when a call completes or an outcome is determined.

### Payload format

| Field | Type | Description |
| - | - | - |
| `event` | string | Always `candidate.interview.updated` |
| `changes` | object | Key-value pairs showing what changed, with `from` and `to` values |
| `data` | object | The updated interview object |

### Data fields

| Field | Type | Description |
| - | - | - |
| `candidate_id` | string | Unique candidate identifier |
| `interview_completed_at` | string / null | ISO 8601 timestamp of completion |
| `interview_sent_at` | string / null | ISO 8601 timestamp of when interview was sent |
| `interview_outcome` | string / null | Final interview outcome (see below) |
| `interview_summary` | string / null | AI-generated summary of the interview |
| `interview_custom_data` | object / null | Custom metadata extracted during the interview |

### Interview outcomes

`interview_outcome` takes one of these values. Only the first three mean an interview took place.

| Outcome | Meaning | When it is set |
| - | - | - |
| `qualified` | The candidate passed the script's qualifying questions | After a completed call whose result is qualified. `interview_completed_at` is set |
| `unqualified` | The candidate failed one or more qualifying questions | After a call whose result is unqualified. `interview_completed_at` is set |
| `completed` | The interview finished and produced no qualified/unqualified result, typically because the script has no qualifying questions | After a completed call. `interview_completed_at` is set |
| `candidate_not_interested` | The candidate said they aren't interested in the role | During a call, from an SMS or email reply, or from a `STOP` text. What else changes depends on the path; see below |
| `ai_opt_out` | The candidate doesn't want to continue with the AI recruiter | During a call or from a message reply. `ai_opt_out` is set to `true` on the candidate. Don't message them |
| `candidate_not_responsive` | The candidate never responded to outreach | When the outreach sequence ends with no response. The candidate moves to the `Future Leads` stage |
| `ai_stopped_override` | The interview was stopped before it finished | When a recruiter stops it, or on [Stop Interview](/docs/api-reference/candidates/stop-interview.md) |
| `not_sent_duplicate` | Not sent: the same person already has an interview in flight from another application | When outreach would start. No interview is sent |
| `not_sent_already_completed` | Not sent: the same person recently completed an interview for another application | When outreach would start. No interview is sent |
| `not_sent_unreachable` | Not sent: the candidate has no phone or email, or sending to them failed | When outreach would start or fails to deliver. No interview takes place |

**What `candidate_not_interested` changes on the candidate.** It depends on how the candidate said it:

* **SMS or email reply:** `disqualified` becomes `true` with `disqualification_reason` "not interested". The stage doesn't change.
* **During a call:** the stage becomes `Future Leads`. For candidates created through the API, and on legacy Workable and Dayforce integrations, the candidate is also disqualified (`disqualified: true`, with a "not interested" reason). For other organizations they are not disqualified.
* **`STOP` text:** the stage becomes `Future Leads` and the candidate is not disqualified. They are also unsubscribed from texts.

Check `disqualified` and `stage` rather than inferring them from the outcome.

### Example payload

```json theme={null}
{
  "event": "candidate.interview.updated",
  "changes": {
    "interview_completed_at": {
      "from": null,
      "to": "2026-04-15T16:00:00Z"
    },
    "interview_outcome": {
      "from": null,
      "to": "qualified"
    }
  },
  "data": {
    "candidate_id": "Xk3pQ9vT2mLr8bNc4Hd1s",
    "interview_completed_at": "2026-04-15T16:00:00Z",
    "interview_sent_at": "2026-04-14T12:00:00Z",
    "interview_outcome": "qualified",
    "interview_summary": "Candidate has 5 years of commercial HVAC experience and holds EPA 608 certification. Available to start immediately.",
    "interview_custom_data": {
      "years_of_experience": 5,
      "has_epa_certification": true,
      "available_start_date": "2026-04-20"
    }
  }
}
```

***

## v2 events (beta)

v2 events are sent to the same URL, in one envelope for every event type:

```json theme={null}
{
  "event_id": "5f0c6b1e-8d2a-4a57-9c0e-2b7f3d1a9e44",
  "type": "application.stage_changed",
  "created_at": "2026-11-03T18:22:05.114Z",
  "org_id": "4f6d2a1e-8b3c-4e5f-9a7d-1c2b3e4f5a6b",
  "api_version": "v2",
  "data": {
    "application_id": "Xk3pQ9vT2mLr8bNc4Hd1s",
    "candidate_id": "Xk3pQ9vT2mLr8bNc4Hd1s",
    "job_id": "k7Hq2xVbN",
    "stage": "Interview",
    "previous_stage": "Applied",
    "changed_at": "2026-11-03T18:22:04.980Z"
  }
}
```

Route on `type`, and ignore types you don't handle: new types are added without a version change. Use `event_id` to deduplicate, since a retry delivers the same `event_id` again.

In Classet an application and its candidate are one record, so `application_id` and `candidate_id` always carry the same value.

> [!NOTE]
>
> Except for `interview.completed`, v2 events fire only for changes made through the v2 API. Changes made in the Classet dashboard or synced from your ATS don't emit them yet. Use `updated_since` on [List Applications](/docs/api-reference/applications/list-all-applications.md) to catch those.

| Type | Fires when | `data` |
| - | - | - |
| `interview.completed` | An interview finishes | The same object as [Get Interview](/docs/api-reference/candidates/get-interview.md) |
| `application.created` | A candidate is added to a job | `candidate_id` (also the application ID), `job_id`, `job_title`, name, `email`, `phone`, `location`, `resume_url`, `disqualified`, `disqualification_reason`, `stage`, `created_at` |
| `application.stage_changed` | An application moves stage | `application_id`, `candidate_id`, `job_id`, `stage`, `previous_stage`, `changed_at` |
| `application.rejected` | An application is disqualified | `application_id`, `candidate_id`, `job_id`, `rejection_reason`, `rejected_at` |
| `candidate.hired` | An application moves into a stage named `Hired` (any case). A hire after an un-hire fires again. | `application_id`, `candidate_id`, `job_id`, `stage`, `hired_at` |
| `candidate.updated` | A candidate's profile changes | `candidate_id`, `job_id`, name, `email`, `phone`, `location`, `stage`, `disqualified`, `updated_at`, `changed_fields` |
| `job.created` | A job is created | `job_id`, `external_id`, `title`, `state`, `updated_at` |
| `job.updated` | A job is updated or archived | Same as `job.created` |
| `webhook.test` | You call [Test Webhook](/docs/api-reference/webhooks/test.md) with `type: "event"` | `message`, `org_id` |

Verify v2 events with [replay protection](#replay-protection-v2-events). v2 events are retried up to **5 times**, and every attempt is recorded in the [delivery history](#delivery-history-retention).

***

## Delivery and retries

You must return a **2xx HTTP status code** (200, 202, or 204) to acknowledge receipt.

If your endpoint fails to acknowledge the webhook, we automatically retry with **exponential backoff**:

| | Retried on | Retries |
| - | - | - |
| Interview events | `5xx` and `429` only. Any other `4xx` is final. | Up to 3 |
| [v2 events](#v2-events-beta) | Any non-`2xx` response | Up to 5 |

After the last retry fails, the event is marked as undeliverable.

> [!TIP]
>
> Return a 2xx status code as quickly as possible. If processing is slow, respond immediately and handle the payload asynchronously.

### Delivery history retention

Every dispatch is recorded, and you can read it back through
`GET /v2/webhooks/events` and `GET /v2/webhooks/events/{eventId}`.

The **delivery record** — status, attempt count, response status, timestamps and
the last error — is kept indefinitely, so a delivery you need to account for
months later is still there.

The **stored envelope** is not. `interview.completed` payloads carry the full
transcript, the recording URL and the candidate's contact details, so we empty
the stored copy **30 days** after dispatch. Past that window,
`GET /v2/webhooks/events/{eventId}` returns `payload: null` alongside a
`payload_purged_at` timestamp — the delivery record is intact, the body is gone.

Our retries are exhausted within hours, so a purged payload was never
redeliverable anyway. If you need the content of an event, persist it on receipt
rather than relying on our history, or re-read the underlying record through the
API (`GET /v2/candidates/{id}/interview`).

> [!NOTE]
>
> If your own retention terms need a different window, contact
> [success@classet.ai](mailto:success@classet.ai) — it is configurable per
> deployment.

***

## Custom variables and data extraction

Need data in the webhook response that isn't listed above? We can add custom variables and extract additional information from the call. Reach out to [success@classet.ai](mailto:success@classet.ai).

***

## Call completed (deprecated)

> [!WARNING]
>
> The `call_completed` webhook is deprecated in favor of `candidate.interview.updated`. Please migrate to the new event format.

The legacy call completed webhook fires when a call finishes and includes the full transcript, call analysis, and recording URL. See [Webhooks](/docs/guides/migration-from-v1.md#webhooks) in the v1 migration guide for how to move off it.


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