> For the complete documentation index, see [llms.txt](https://helpcenter.talentlead.nl/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://helpcenter.talentlead.nl/talent-assessment/api/webhooks.md).

# Webhooks

Webhooks maken de ATS-integratie compleet: in plaats van te pollen krijgt jouw systeem een bericht zodra er iets gebeurt, bijvoorbeeld als een kandidaat het assessment afrondt.

#### Events

| Event                  | Wanneer                                        |
| ---------------------- | ---------------------------------------------- |
| `assessment.completed` | Een persoon in je pool rondt een assessment af |
| `person.created`       | Persoon toegevoegd via de API                  |
| `person.joined`        | Persoon koppelt zich via een uitnodiging       |
| `person.archived`      | Persoon gearchiveerd                           |
| `invitation.accepted`  | Persoonlijke uitnodiging geaccepteerd          |
| `invitation.revoked`   | Uitnodiging ingetrokken                        |
| `invitation.expired`   | Uitnodiging verlopen                           |
| `ping`                 | Testevent via `POST /webhooks/{id}/test`       |

Registreer een endpoint met `POST /api/v1/webhooks` (maximaal 10 per organisatie). Abonneer op specifieke events of op alles met `["*"]`.

#### Envelop

```json
{
  "id": "<deliveryId>",
  "type": "assessment.completed",
  "createdAt": "2026-07-15T10:00:00.000Z",
  "apiVersion": "v1",
  "data": {
    "personId": "...",
    "email": "kandidaat@voorbeeld.nl",
    "externalId": "ATS-1001",
    "assessmentId": "...",
    "completedAt": "2026-07-15T09:59:58.000Z"
  }
}
```

#### Handtekening verifiëren

Het signing-secret (`whsec_...`) krijg je **éénmalig** terug bij het registreren van het endpoint. Elke delivery is ondertekend via de header:

```
Talentlead-Signature: t=1752570000,v1=<hex>
```

waarbij `v1 = HMAC-SHA256(secret, "{t}.{body}")`. Verifieer altijd, en weiger deliveries ouder dan 5 minuten (replay-bescherming):

```javascript
import { createHmac } from "node:crypto";

function verify(secret, body, header, toleranceSeconds = 300) {
  const parts = new Map(header.split(",").map((p) => p.split("=")));
  const t = Number(parts.get("t"));
  if (Math.abs(Date.now() / 1000 - t) > toleranceSeconds) return false;
  const expected = createHmac("sha256", secret).update(`${t}.${body}`).digest("hex");
  return expected === parts.get("v1");
}
```

Extra headers per delivery: `Talentlead-Event` (het eventtype) en `Talentlead-Delivery-Id`.

#### Retries

Antwoordt je endpoint niet met een 2xx, dan proberen we het opnieuw met backoff: **1 min, 5 min, 30 min, 2 uur**. Daarna wordt de delivery als mislukt gemarkeerd. Bekijk recente deliveries en hun status via `GET /api/v1/webhooks/{id}/deliveries`.

{% hint style="success" %}
Test je implementatie met `POST /api/v1/webhooks/{id}/test`: je ontvangt direct een ondertekend `ping`-event en ziet de response van je endpoint terug in het antwoord.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://helpcenter.talentlead.nl/talent-assessment/api/webhooks.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
