put
https://www.humanity.com/api/v2/shifts//tasks
API documentation for updating shift tasks with bulk create, update, and delete operations
UPDATE Shift Tasks
This API endpoint allows you to update shift tasks for a specific shift with bulk operations for creating, updating, and deleting tasks.
Request Parameters
Path Parameters
- shiftId (integer, mandatory) - The ID of the shift to update tasks for
Request Body
- tasks (array, mandatory) - Contains a list of "shift task" objects
Task Object Structure
| Field | Type | Required | Description |
|---|---|---|---|
id | string (ULID format) | Optional | Shift task ID. If omitted, task is considered new and will be added |
taskId | string (ULID format) | Mandatory | Master task ID |
name | string | Mandatory | Shift task name |
description | string | Optional | Shift task description |
type | integer | Mandatory | Task type: 1 = regular, 2 = time-boxed |
options | object | Optional | Options for time-boxed tasks (null for regular tasks) |
Options Object (for time-boxed tasks)
| Field | Type | Required | Description |
|---|---|---|---|
startTime | datetime | Mandatory | Start time for the task |
dueTime | datetime | Mandatory | Due time for the task |
Behavior Rules
- New Tasks: Task elements without an
idare considered new and will be added to the shift - Update Tasks: Task elements with an
idwill be updated if any changes are requested - Delete Tasks: Task elements that previously existed but are omitted from the request will be removed/deleted from the shift
API Details
- Endpoint Type: Public API
- Minimum Role: Employee
- Permissions: Users can create/edit/delete shift tasks for shifts they have edit permissions on
- API Version: v2
Endpoint
PUT {baseUrl}/api/v2/shifts/{shiftId}/tasks?access_token={token}
Example Request
{
"tasks": [
{
"id": "01k6mj6wmesfx9az1s615jdd0y",
"taskId": "01ht07sr1e36pw203eyy7nhn0b",
"name": "Regular task - edited",
"type": 1
},
{
"taskId": "01ht0712np8f5ezngqqp8yfdkf",
"name": "Time-boxed task",
"type": 2,
"options": {
"startTime": "2025-10-04T07:00:00+00:00",
"dueTime": "2025-10-04T07:30:00+00:00"
}
}
]
}Example Response
{
"status": 1,
"data": [
{
"id": "01k6mj6wmesfx9az1s615jdd0y",
"taskId": "01ht07sr1e36pw203eyy7nhn0b",
"shiftId": 2415,
"name": "Regular task - edited",
"description": "",
"type": 1,
"options": null,
"createdBy": 2,
"createdAt": "2025-10-02T12:55:14+00:00",
"updatedBy": null,
"updatedAt": null,
"deletedBy": null,
"deletedAt": null
},
{
"id": "01k6jfvdcwrgcjye7w48dqq342",
"taskId": "01ht0712np8f5ezngqqp8yfdkf",
"shiftId": 2415,
"name": "Time-boxed task",
"description": "",
"type": 2,
"options": {
"startTime": "2025-10-04T07:00:00+00:00",
"dueTime": "2025-10-04T07:30:00+00:00"
},
"createdBy": 2,
"createdAt": "2025-10-02T12:55:14+00:00",
"updatedBy": null,
"updatedAt": null,
"deletedBy": null,
"deletedAt": null
}
],
"metadata": [],
"token": "token",
"error": null
}