UPDATE Shift 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

FieldTypeRequiredDescription
idstring (ULID format)OptionalShift task ID. If omitted, task is considered new and will be added
taskIdstring (ULID format)MandatoryMaster task ID
namestringMandatoryShift task name
descriptionstringOptionalShift task description
typeintegerMandatoryTask type: 1 = regular, 2 = time-boxed
optionsobjectOptionalOptions for time-boxed tasks (null for regular tasks)

Options Object (for time-boxed tasks)

FieldTypeRequiredDescription
startTimedatetimeMandatoryStart time for the task
dueTimedatetimeMandatoryDue time for the task

Behavior Rules

  • New Tasks: Task elements without an id are considered new and will be added to the shift
  • Update Tasks: Task elements with an id will 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
}
Language
Credentials
Query
Click Try It! to start a request and see the response here!