Working with webhooks
HirePass sends a POST request to your URL when something happens to a check, so your systems stay up to date without polling.
What webhooks do#
A webhook is a URL on your side that HirePass calls when an event happens, such as a new check request. You choose which events to receive when you create the webhook. Your system then reacts straight away, for example by updating the applicant's record in your HRIS or fetching the latest results with the API.
Events#
| Event | Label in Workspace | Sent when |
|---|---|---|
REQUESTED | New check request | A check is requested for an applicant, from Workspace, the API or a connected app |
RESULTS_BY_CHECK_ELEMENT | Results by check element | The applicant submits or updates information in their onboarding form |
Webhooks tell you that something changed. To read the results themselves, call the API with the externalId from the payload, for example with Fetch all results at once.
Workspace also lists Consider status and Final report. These are not sent to webhooks yet. To know when a check completes, read its status with View all requests.
The request HirePass sends#
Each notification is an HTTPS POST with a JSON body.
POST https://your-server.example.com/hirepass
Content-Type: application/json
Authorization: Bearer YOUR_WEBHOOK_TOKEN{
"event": "REQUESTED",
"data": {
"externalId": "HP210910249",
"status": "requested",
"personalData": {
"completeName": "Jane Smith",
"email": "[email protected]"
}
}
}| Field | Description |
|---|---|
event | The event name, from the table above |
data.externalId | The check's HirePass reference. Use it to query the check with the API |
data.status | The check's status at the time of the event, such as requested or in_progress |
data.personalData.completeName | The applicant's full name |
data.personalData.email | The applicant's email address |
The Authorization header carries the token you set on the webhook. If you didn't set one, the header is sent empty.
Receive webhooks safely#
- Check the token. Compare the
Authorizationheader with the token you set, and reject the request if it doesn't match. - Answer quickly. Return a
2xxstatus as soon as you have stored the event, and do any slow work afterwards. - Expect one attempt. Each event is sent once and is not retried if your server is down or returns an error. If you miss an event, catch up with View all requests.
- Handle duplicates. Use
externalIdandeventto recognise an event you have already processed. - Protect personal data. The payload includes the applicant's name and email. Store and log it under your own data protection policy.
Next step#
Create a new webhook in Workspace and test the connection.