Update a training path
This endpoint allows updating the full definition of a training path in the catalog: its data, its courses and the schedule of its trainings.
PUT /api/v2/businesses/{businessId}/training-paths/{trainingPathId}
Below is a detailed explanation of each of the fields that can make up the request body, with some being mandatory for the request to be successful.
|
Mandatory fields are marked with an asterisk (*). |
Request body
| JSON Analysis |
|---|
Details
|
Request example
Once the analysis of the different fields has been done, an example of the request is shown:
PUT /api/v2/businesses/BUSINESSID/training-paths/TP-RES
{
"id": "TP-RES",
"name": "Shift manager",
"abbreviation": "RES",
"color": "#C3AAFC",
"description": "Full path: store, sales, cash register and closing",
"courseIds": [
"CRS-VAC",
"CRS-BTI",
"CRS-CAJ",
"CRS-CIE"
]
}
If the request is correct, the response will be a 200 OK with the resulting training path.
Considerations
The request replaces the whole definition of the training path. The id in the body is ignored and the training path keeps the identifier given in the URL.
|
If |
The trainingsOrder field must meet the same conditions as when creating the training path.
Changes to the training path do not affect the course assignments already created from it.
Error codes
In addition to the common errors, this endpoint can return the following codes:
| Code | Message | Description |
|---|---|---|
|
Training path not found: <trainingPathId> |
The given |
Course not found: <courseId> |
One of the courses in |
|
Training not found in the training path courses: <training> |
One of the trainings in |
|
|
At least one course is required |
The |
One or more courses not found |
The |
|
Name cannot be longer than 50 characters |
The |
|
Description cannot be longer than 500 characters |
The |
|
Abbreviation cannot be longer than 5 characters |
The |
|
- |
The |
|
Training path order contains duplicate training ids |
The |
|
Training path order must contain exactly all trainings from all courses, no more and no less |
The |
|
Training path order does not respect the internal order of course |
The schedule in |
Useful links
What is a training path?
What is a course?