Add a compliance document to a worker
const url = 'https://api2.recruso.co.uk/v1/workers/1/compliances';const options = { method: 'POST', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"workerId":4821,"complianceId":3,"startDate":"2026-01-15","endDate":"2031-01-14"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api2.recruso.co.uk/v1/workers/1/compliances \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "workerId": 4821, "complianceId": 3, "startDate": "2026-01-15", "endDate": "2031-01-14" }'Adds one document to a worker’s right-to-work register in your own agency.
Documents accumulate rather than replace one another. A worker legitimately holds the same document type several times across the years — a renewal is a new document with its own dates, not an edit of the one it renews — so nothing here rejects a type the worker already has.
EndDate must not be before StartDate, and ComplianceId must be a compliance type in your agency’s lookup; one that does not exist returns 400. A worker id belonging to another agency returns 404 rather than 403, so their existence is never disclosed.
Access. Requires a client-credentials access token. Tokens issued through the interactive user login are rejected.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The workerId path parameter
Request Bodyrequired
Section titled “Request Bodyrequired”A compliance document to add to a worker’s right-to-work register.
object
The worker the document belongs to. Taken from the route; a value in the request body is ignored.
Example
4821The kind of document, as an id from your agency’s Compliance lookup.
Example
3The date the document takes effect.
Example
2026-01-15The date the document expires. Must not be before the start date.
Example
2031-01-14Responses
Section titled “Responses”Created
object
The record’s identifier.
The kind of document, as an id from your agency’s Compliance lookup.
The date the document takes effect.
The date the document expires.
Example
{ "workerComplianceId": 7311, "complianceId": 3, "startDate": "2026-01-15", "endDate": "2031-01-14"}Bad Request
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}Unauthorized
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}Forbidden
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}Not Found
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}
