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

# Assessment Links

> Push candidate assessment links to Alex the moment they are generated, for immediate in-channel delivery to the candidate

## Introduction

The Assessment Links API lets an assessment provider push each candidate's unique assessment link to Alex the moment it is generated. Alex matches the link to the candidate's application and delivers it in the candidate's conversation channel (e.g. WhatsApp) within seconds.

The contract is deliberately thin: the payload carries an **opaque ATS identifier and the link** — no names, email addresses, phone numbers, scores, or results. Alex resolves candidate details and assessment outcomes from the customer's ATS directly, so a misrouted or replayed request never exposes personal data.

> [!NOTE]
>
> Unlike the rest of this reference, this endpoint lives under the `/v2` base:
>
> ```http theme={null}
> POST https://api.alex.com/v2/api/assessment-links
> ```

## How it fits the assessment flow

The provider's existing ATS integration is unchanged — this endpoint adds one push, at the moment the link is generated:

1. The candidate is moved to the assessment stage in the ATS, which triggers an assessment order to the provider — the existing trigger, unchanged.
2. The provider generates the unique, candidate-and-job-specific assessment link, as it does today.
3. The provider writes the link (and later, results) back to the ATS — the existing write-back, unchanged.
4. **New:** at the same moment, the provider `POST`s the link to this endpoint.
5. Alex matches the application identifiers to a candidate conversation and delivers the link in-channel within seconds. Links for applications Alex doesn't manage are discarded on receipt and not retained.
6. Completion status and scores flow back to the ATS exactly as today — Alex reads assessment status from the ATS to follow up with candidates who haven't completed. No assessment results ever pass through this API.

## Authentication

Requests are authenticated with the **customer's** API key — the same key used for the rest of the Alex API. The key determines which customer account the links apply to; a provider integrating on behalf of multiple customers holds one key per customer.

```http theme={null}
"X-API-Key": <CUSTOMER-API-KEY>
```

The provider does not need to know which of the customer's candidates Alex manages: send **every** link generated for the customer's account, and Alex matches on the application identifier and silently discards the rest.

## Pushing an assessment link

Call once per generated link, immediately after generation — ideally in the same step that writes the link back to the ATS, never on a batch or polling schedule. Candidates are typically in a live conversation when the assessment is ordered, and delivery is expected within seconds of generation.

Each request identifies the application in one of two ways: by `applicationId` alone, or — when the application ID isn't available — by `jobId`, `candidateId`, and `orderId` together.

**Request fields:**

| Field | Description |
| - | - |
| `assessmentUrl` | **Required** — the unique, candidate-specific assessment link (HTTPS, at most 2,048 characters). Delivered to the candidate as sent, with surrounding whitespace trimmed. |
| `applicationId` | The ATS application identifier for the candidate–job pair. **Required** unless `jobId`, `candidateId`, and `orderId` are all sent. |
| `jobId` | The ATS job ID. **Required** when `applicationId` is absent; otherwise optional, and used as a consistency cross-check. |
| `candidateId` | The ATS candidate ID. **Required** when `applicationId` is absent; otherwise optional, and used as a consistency cross-check. |
| `orderId` | The provider's own order or reference ID. **Required** when `applicationId` is absent; otherwise optional. Included in Alex's logs for mutual traceability during support. |

**Identifier requirements by ATS:**

| ATS | `applicationId` | `jobId` / `candidateId` |
| - | - | - |
| SmartRecruiters | The application ID from the assessment order — the same identifier the provider receives when the order is placed. | The ATS's internal job and candidate IDs (UUIDs), not the job's public reference. |

> [!NOTE]
>
> The identifiers must resolve to the candidate *on a specific job*. A candidate ID alone is not sufficient — one candidate
> can hold several applications — which is why `candidateId` is only accepted together with `jobId`.

> [!NOTE]
>
> When `applicationId` is sent alongside `jobId` or `candidateId`, those values must agree with the application. A request
> whose cross-check disagrees is treated as unmatched: it is acknowledged with `200` and the link is not delivered.

> [!WARNING]
>
> **Do not send candidate PII.** Names, email addresses, phone numbers, scores, and report data are intentionally excluded
> from this contract — Alex resolves the candidate from the ATS using the identifiers above.

**Example request — by application ID:**

```json theme={null}
{
  "applicationId": "7f3a1c9e-4b2d-4e8a-9c61-2d5f8b0a7e14",
  "assessmentUrl": "https://assessments.example.com/start?token=Zk9x...",
  "orderId": "ORD-102938"
}
```

**Example request — by job, candidate, and order:**

```json theme={null}
{
  "jobId": "3c8e2f71-9a4b-4d6e-b1f0-5e7a2c9d8b36",
  "candidateId": "a91d4b6c-2e7f-4c3a-8d5b-0f6e1a9c7b42",
  "orderId": "ORD-102938",
  "assessmentUrl": "https://assessments.example.com/start?token=Zk9x..."
}
```

**Response — `200 OK`:**

```json theme={null}
{
  "success": true
}
```

A `200` is returned whether or not the application is one Alex manages — the provider does not need to distinguish, and an unmatched link is not an error.

Requests are idempotent per application: re-sending the same link is harmless and does not message the candidate again, and sending a new link for the same application replaces the previous one (last write wins) and is delivered to the candidate. It is always safe to retry a request you are unsure was received.

## Response codes

| Code | Meaning | Retry? |
| - | - | - |
| `200` | Link accepted. The link is recorded and delivery is started before the response; the candidate's message is sent after it. | — |
| `400` | Malformed request — a missing, non-HTTPS, or over-2,048-character `assessmentUrl`; neither `applicationId` nor all of `jobId`, `candidateId`, and `orderId`; or an identifier that isn't a string. | No — fix the request. |
| `401` | Invalid or missing API key. | No — fix the key. |
| `409` | Assessment link delivery is not enabled for the customer's account. | No — ask the Alex team to enable it. |
| `5xx` | Transient failure on the Alex side. | **Yes**, with backoff. |

On network failure, timeout, or a `5xx` response, retry with exponential backoff (for example 30s, 2m, 10m, then hourly for up to 24 hours). Suggested client timeout: 10 seconds — the endpoint records the link and starts delivery before responding, and sends the candidate's message after the response.

## Volume

There is no rate limiting at expected volumes; if sustained throughput above \~10 requests/second is anticipated, give the Alex team a heads-up during onboarding.


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