Add a Driver CPC training period to a worker
const url = 'https://api2.recruso.co.uk/v1/workers/1/cpc-training';const options = { method: 'POST', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"workerId":4821,"trainingFrom":"2021-09-10","trainingUntil":"2026-09-09","completedByRequiredDate":false}'};
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/cpc-training \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "workerId": 4821, "trainingFrom": "2021-09-10", "trainingUntil": "2026-09-09", "completedByRequiredDate": false }'Opens a Driver CPC training period for a worker in your own agency — the window the periodic training has to be completed in.
The period holds no training on its own: the modules completed within it are recorded against it one at a time, and the period reports how many there are and the hours they add up to.
Both dates are required, and TrainingUntil must not be before TrainingFrom. 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 Driver CPC training period to record for a worker.
object
The worker the period belongs to. Taken from the route; a value in the request body is ignored.
Example
4821The date the period starts. Required.
Example
2021-09-10The date the period runs to. Required, and must not be before the start date — both columns are NOT NULL.
Example
2026-09-09Whether the required hours were completed within the period.
Example
falseResponses
Section titled “Responses”Created
object
The training period identifier.
The date the period starts.
The date the period runs to.
Whether the required hours were completed within the period.
How many modules have been recorded in the period.
The hours recorded across those modules.
Example
{ "trainingId": 4410, "trainingFrom": "2021-09-10", "trainingUntil": "2026-09-09", "completedByRequiredDate": false, "moduleCount": 3, "totalHoursCompleted": 21}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"}
