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

# Connect Classet to your ATS

> Send applicants from your ATS to a Classet AI interview and write the result back

This guide is for teams connecting their own applicant tracking system, or an ATS product they build, to Classet through the API. The integration has four parts: mirror your jobs, send each applicant, receive the interview result, and write it back.

> [!NOTE]
>
> Classet already integrates with several ATS platforms directly. Ask [success@classet.ai](mailto:success@classet.ai) before you build one.

```mermaid theme={null}
sequenceDiagram
    participant ATS as Your ATS
    participant API as Classet API
    participant C as Candidate
    ATS->>API: POST /v2/jobs (once per job)
    ATS->>API: POST /v2/candidates (per applicant)
    API-->>ATS: candidate_id
    API->>C: Text and email, then the AI interview
    API->>ATS: Webhook: candidate.interview.updated
    ATS->>API: GET /v2/candidates/{id}/interview
    ATS->>ATS: Write outcome and summary to the applicant
```

## How the records map

| In your ATS | In Classet | Link them with |
| - | - | - |
| Job or requisition | Job | `external_id` on the job. Look it up with `GET /v2/jobs?external_id=` |
| Applicant on a job | Candidate, with one application | `external_id` on create, returned as `remote_application_id`. Store the `candidate_id` you get back |
| Pipeline stage | `stage` on the application | Stage names from `GET /v2/jobs/{jobId}/stages` |
| Screening result | Interview | `GET /v2/candidates/{candidateId}/interview` |

Classet does not look candidates up by your `external_id`, so save `candidate_id` on your applicant record when you create it.

## 1. Check your key

Create a key in [Developer Settings](https://app.classet.ai/settings/developers), then confirm it and read the settings that decide whether sends succeed:

```bash theme={null}
curl https://api.classet.ai/v2/organization -H "X-API-KEY: $CLASSET_API_KEY"
```

The response lists the enabled channels, the phone regions you can send to, and your rate limit.

## 2. Mirror your jobs

Create each ATS job once, with your id in `external_id`:

```bash theme={null}
curl -X POST https://api.classet.ai/v2/jobs -H "X-API-KEY: $CLASSET_API_KEY" -H "Content-Type: application/json" -H "Idempotency-Key: job-REQ-2026-118" -d '{"title":"HVAC Technician","description":"Install, maintain, and repair HVAC systems...","location":{"city":"Denver","region":"Colorado","workplace_type":"onsite"},"external_id":"REQ-2026-118"}'
```

The job uses your organization's default interview script unless you pass `script_id`. Before creating a job, check whether it already exists:

```bash theme={null}
curl "https://api.classet.ai/v2/jobs?external_id=REQ-2026-118" -H "X-API-KEY: $CLASSET_API_KEY"
```

## 3. Send each applicant

When an applicant reaches the stage where you want them screened, create the candidate and start outreach in one call:

```bash theme={null}
curl -X POST https://api.classet.ai/v2/candidates -H "X-API-KEY: $CLASSET_API_KEY" -H "Content-Type: application/json" -H "Idempotency-Key: applicant-8812" -d '{"first_name":"Jane","last_name":"Smith","email":"jane@example.com","phone":"+15555550123","job_id":"your-job-id","external_id":"ats-applicant-8812","send_sms":true,"send_email":true}'
```

> [!WARNING]
>
> With `send_sms` or `send_email` set, this request texts and emails the person in the body and uses one interview invite. While you are testing, put in your own phone number and email.

Things to handle:

* **Retries.** Send an [`Idempotency-Key`](/docs/guides/idempotency) built from your applicant id, so a retry after a timeout does not text the candidate twice.
* **`409`, four cases.** Branch on `code` and on whether the body has `data`:
  * `conflict` with `data`: the candidate already exists for this job. Store the `candidate_id` it carries. No new outreach was sent.
  * `conflict` without `data`: your first request with that `Idempotency-Key` is still running. Wait a few seconds and retry with the same key.
  * `candidate_opted_out`: this person opted out of the AI recruiter. Nothing was sent. Do not retry; route them to a recruiter.
  * `recently_contacted`: the phone number or email was contacted for this job in the last 12 hours through another candidate record. Nothing was created or sent. Store the `candidate_id` it carries and do not retry before `retry_at`.
* **`429`.** Nothing was sent. Read `exceeded_window` in the body. For `burst` or `sustained`, wait for `Retry-After` and send again. For `daily` or `monthly` the wait can be hours or days, so queue the applicant and resume later. A `429` without `exceeded_window` is the request [rate limit](/docs/guides/rate-limits.md); wait for `Retry-After`.
* **`402` and `422`.** `402` means your trial interview allowance is spent, and `422` means the request cannot be processed as sent, for example a candidate who cannot be reached. Neither will succeed on a retry. [Error handling](/docs/guides/error-handling.md) lists every code.

To send the link yourself, leave out `send_sms` and `send_email` and use the `webcall_url` in the response.

## 4. Receive the result

> [tab] Webhook
>
> Set a webhook URL in [Developer Settings](https://app.classet.ai/settings/developers). Classet sends one of two formats to it, depending on whether [v2 events](/docs/guides/webhooks.md#v2-events-beta) are enabled for your organization. Handle both: a body with `type` and `api_version` is a v2 event, and a body with `event` is an interview event.
>
> | Format | Result arrives as | Candidate id | Signature header |
> | - | - | - | - |
> | Interview event (default) | `event: "candidate.interview.updated"` | `data.candidate_id` | `x-classet-webhook-signature` |
> | v2 event (beta, enabled per organization) | `type: "interview.completed"` | `data.candidate_id` | `X-Classet-Signature-V2`, with `X-Classet-Timestamp` |
>
> An interview event looks like this:
>
> ```json theme={null}
> {
>   "event": "candidate.interview.updated",
>   "data": {
>     "candidate_id": "Xk3pQ9vT2mLr8bNc4Hd1s",
>     "interview_completed_at": "2026-04-15T16:00:00Z",
>     "interview_outcome": "qualified",
>     "interview_summary": "Candidate has 5 years of commercial HVAC experience..."
>   }
> }
> ```
>
> [Verify the signature](/docs/guides/webhooks.md#verifying-webhook-requests), answer `2xx` quickly, then fetch the full interview with `candidate_id`. Ignore event types you do not handle, and deduplicate v2 events on `event_id`. Keep a poll running as well, at a slower interval, so a missed delivery still gets picked up.

> [tab] Polling
>
> Ask for every application that changed since your last poll and follow the cursor to the end:
>
> ```bash theme={null}
> curl "https://api.classet.ai/v2/applications?updated_since=2026-04-15T15:55:00Z" -H "X-API-KEY: $CLASSET_API_KEY"
> ```
>
> Pass `meta.next_cursor` back as `cursor` until it is `null`. Then move your watermark to the time the poll **started**, minus 5 minutes. Do not move it to the newest `updated_at` you received: rows that changed during the poll would be skipped. [Pagination and delta sync](/docs/guides/pagination-and-delta-sync.md) has the details.

Either way, read the result from one place:

```bash theme={null}
curl https://api.classet.ai/v2/candidates/{candidateId}/interview -H "X-API-KEY: $CLASSET_API_KEY"
```

It returns `status`, `outcome`, `summary`, `question_answers`, `custom_data`, the transcript and a `recording_url`. The recording URL expires, so store the summary and answers, and fetch a recording through [Download call recording](/docs/api-reference/calls/download-recording.md) when someone asks to hear it.

## 5. Write it back to your ATS

Map `outcome` to what your recruiters should see. Only the first three values mean an interview took place.

| `outcome` | Suggested action in your ATS |
| - | - |
| `qualified` | Advance the applicant. Attach the summary and answers |
| `unqualified` | Flag for review or reject, per your process. Attach the summary |
| `completed` | Interview done with no pass or fail. Attach the summary for a recruiter to read |
| `candidate_not_interested` | Mark as withdrawn |
| `ai_opt_out` | Stop automated contact. Route to a recruiter |
| `candidate_not_responsive` | Leave in place or move to a follow-up list |
| `ai_stopped_override` | No action. Someone stopped the interview |
| `not_sent_duplicate`, `not_sent_already_completed` | No action. The same person is already being screened, or just was, for another application |
| `not_sent_unreachable` | Flag missing or invalid contact details |

`outcome` is `null` until something decides the interview. The [Glossary](/docs/glossary.md#interview-outcomes) says when each value is set.

## 6. Keep stages in step (optional)

If recruiters also work in the Classet dashboard, send your stage changes so both systems agree:

```bash theme={null}
curl -X PUT https://api.classet.ai/v2/applications/{applicationId}/stage -H "X-API-KEY: $CLASSET_API_KEY" -H "Content-Type: application/json" -d '{"stage":"Interviewing"}'
```

Read the job's stage names from `GET /v2/jobs/{jobId}/stages` and check `meta.source`. When it is `default_stage_names` or `ats_stages`, the job has a configured list: `stage` must be one of those names, and anything else returns `422` with the valid names in the error. When it is `in_use`, the job has no configured list, the response shows only the stages its applications are in today, and any stage name is accepted. Use [Disqualify application](/docs/api-reference/applications/disqualify.md) for a rejection, and [Stop interview](/docs/api-reference/candidates/stop-interview.md) when an applicant is withdrawn before they finish.

To read changes made in Classet, the polling loop in step 4 already returns them: each application carries `stage`, `status` (`active`, `hired` or `rejected`), `disqualified`, `hired_at` and `rejected_at`.

## Before you go live

* [ ] Every create call sends an `Idempotency-Key`.
* [ ] You store `candidate_id` on the applicant, and handle all three kinds of `409`.
* [ ] Your webhook handler verifies the signature against the raw body and accepts both event formats.
* [ ] A poll runs behind the webhook, with the watermark rule from step 4.
* [ ] `429` and `503` responses wait for `Retry-After`, and a `daily` or `monthly` invite cap queues the send.
* [ ] Candidates with `ai_opt_out` are never re-sent.
* [ ] You tested the whole loop with your own phone number and email first.

## Have your agent build it

Install the `classet-api` skill, then give your coding agent this prompt:

```text theme={null}
Build a Classet integration for our ATS following
https://docs.classet.ai/guides/ats-integration.md. Use the classet-api skill and
the OpenAPI spec at https://api.classet.ai/v2/openapi.json. Read the API key
from CLASSET_API_KEY. Do not call POST /v2/candidates with send_sms or
send_email until I confirm the test candidate.
```

[Build with an AI agent](/docs/guides/agents.md) covers the skill and the MCP server.


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