Update Labour: /labours/{labour_uuid}
Purpose
This API is used to update an existing Labour resource. It allows modification of basic labour details such as name, display name, and description, and also supports partial updates to the labour’s custom availability configuration through additive, update, or delete operations without recreating the entire labour record.
Use Case
- Update the name or display name of an existing labour.
- Modify the labour description to reflect updated responsibilities or roles.
- Add new custom availability slots for specific days.
- Update existing availability time ranges or availability flags.
- Remove existing custom availability entries using their UUID.
- Maintain accurate labour scheduling data without affecting unrelated attributes.
Path Parameters
| Attribute | Type | Description |
|---|---|---|
| labour_uuid | UUID | Unique identifier of the labour record to be updated |
Query Parameters
This endpoint does not support query parameters
Request Body
{
"labour": {
"name": "LABOUR_NAME",
"display_name": "DISPLAY_NAME",
"description": "DESCRIPTION",
"labour_custom_availability": [
{
"operation": "DELETE",
"uuid": "AVAILABILITY_UUID"
},
{
"operation": "ADD",
"start_time": "START_TIME",
"end_time": "END_TIME",
"available": "AVAILABLE",
"preferred_day": "PREFERRED_DAY"
},
{
"operation": "UPDATE",
"uuid": "AVAILABILITY_UUID",
"start_time": "START_TIME",
"end_time": "END_TIME",
"available": "AVAILABLE",
"preferred_day": "PREFERRED_DAY"
}
]
}
}
| Attribute | Type | Description |
|---|---|---|
| labour | Object | Root object containing labour update details |
| labour.name | String | Updated internal name of the labour |
| labour.display_name | String | Updated display name shown in UI |
| labour.description | String | Description of the labour |
| labour.labour_custom_availability | Array | List of custom availability operations |
| labour.labour_custom_availability.operation | String | Operation to perform: ADD, UPDATE, or DELETE |
| labour.labour_custom_availability.uuid | UUID | Unique identifier of the availability entry (required for UPDATE and DELETE) |
| labour.labour_custom_availability.start_time | Time | Start time of availability (HH:mm:ss) |
| labour.labour_custom_availability.end_time | Time | End time of availability (HH:mm:ss) |
| labour.labour_custom_availability.available | Boolean/String | Indicates whether labour is available during the time slot |
| labour.labour_custom_availability.preferred_day | String | Day of the week for availability |
Response
On successful execution, the API returns the updated labour object reflecting all applied changes. The response includes the labour’s current status, identifying information, associated labour profile details, audit metadata, and the complete set of custom availability entries after applying all add, update, and delete operations. Any unchanged attributes are preserved, ensuring partial updates do not overwrite existing data unintentionally.
Response Body
{
"labour": {
"status": "STATUS",
"uuid": "LABOUR_UUID",
"code": "LABOUR_CODE",
"name": "LABOUR_NAME",
"display_name": "DISPLAY_NAME",
"description": "DESCRIPTION",
"image_name": "IMAGE_NAME",
"email_address": "EMAIL_ADDRESS",
"use_custom_availability": "USE_CUSTOM_AVAILABILITY",
"labour_profile": {
"status": "PROFILE_STATUS",
"uuid": "PROFILE_UUID",
"name": "PROFILE_NAME",
"display_name": "PROFILE_DISPLAY_NAME",
"link": "PROFILE_LINK"
},
"custom_form_template": "CUSTOM_FORM_TEMPLATE",
"created_by": "CREATED_BY",
"created_on": "CREATED_ON",
"last_updated_by": "LAST_UPDATED_BY",
"last_updated_on": "LAST_UPDATED_ON",
"custom_attributes": [],
"labour_contacts": [],
"labour_custom_availability": [
{
"status": "AVAILABILITY_STATUS",
"uuid": "AVAILABILITY_UUID",
"start_time": "START_TIME",
"end_time": "END_TIME",
"available": "AVAILABLE",
"preferred_day": "PREFERRED_DAY"
}
],
"labour_availability": []
}
}
| Attribute | Type | Description |
|---|---|---|
| labour | Object | Updated labour object |
| labour.status | String | Current status of the labour |
| labour.uuid | UUID | Unique identifier of the labour |
| labour.code | String | System-generated labour code |
| labour.name | String | Labour name |
| labour.display_name | String | Labour display name |
| labour.description | String | Labour description |
| labour.image_name | String | Image file name associated with labour |
| labour.email_address | String | Email address of the labour |
| labour.use_custom_availability | Boolean | Indicates whether custom availability is enabled |
| labour.labour_profile | Object | Associated labour profile details |
| labour.labour_profile.uuid | UUID | Unique identifier of the labour profile |
| labour.labour_profile.name | String | Labour profile name |
| labour.labour_profile.display_name | String | Display name of the labour profile |
| labour.labour_profile.link | String | API link to the labour profile resource |
| labour.custom_form_template | String | Assigned custom form template |
| labour.created_by | String | User who created the labour |
| labour.created_on | DateTime | Labour creation timestamp |
| labour.last_updated_by | String | User who last updated the labour |
| labour.last_updated_on | DateTime | Last update timestamp |
| labour.custom_attributes | Array | List of custom attributes associated with the labour |
| labour.labour_contacts | Array | Contact details linked to the labour |
| labour.labour_custom_availability | Array | List of custom availability entries |
| labour.labour_custom_availability.uuid | UUID | Unique identifier of availability entry |
| labour.labour_custom_availability.start_time | String | Availability start time |
| labour.labour_custom_availability.end_time | String | Availability end time |
| labour.labour_custom_availability.available | Boolean/String | Availability status |
| labour.labour_custom_availability.preferred_day | String | Day of the week |
| labour.labour_availability | Array | System-generated availability records |