Update an assignment

Update an assignment

Introduction

You can update an assignment by its internal ID with the PUT call.

Caution

This endpoint is only available if clients are not using Planning Flex or Shift.

Tip

Check the Swagger page for more technical information on the endpoints.

Endpoint details

PUT
https://<tenant>.myprotime.eu/connector/protimeapi/api/v1/assignments/{id}

URL parameters

This parameter needs to be filled in when calling this endpoint.

Parameter Description
<id> The internal ID of the assignment.

Body properties

This list of properties is applicable for this endpoint.

Property Type Description
person.id integer Internal ID of the person who the assignment is for. Required (or use external reference)
from string Start date of the assignment (YYYY-MM-DD). Required
until string End date of the assignment (YYYY-MM-DD).
startTimeInMinutes integer Start time in minutes since midnight (-1440 and 2880).
endTimeInMinutes integer End time in minutes since midnight (-1440 and 2880).
breakDurationInMinutes integer Duration of the break in minutes.
comments string Comments associated with the assignment.
activityLevels.level integer A list of levels in the activity structure of the registered activity definition.
activityLevels.activityDefinition.id string Unique identifier for the activity definition registered.

External references

It’s possible to use predefined external references and custom external references. More information can be found on the External References Page.

The following collections are supported for this endpoint:

Collection Predefined Custom
people @badge-number, @employee-number Supported
activity-definitions @data-entry-code, @external-reference Supported

Examples

Update an assignment with internal IDs

Example updating assignment with ID 757085:

PUT
https://<tenant>.myprotime.eu/connector/protimeapi/api/v1/assignments/757085

{
  "person": {
    "id": 1234
  },
  "from": "2025-03-10",
  "until": "2025-03-10",
  "startTimeInMinutes": 540,
  "endTimeInMinutes": 1080,
  "breakDurationInMinutes": 60,
  "comments": "Updated shift",
  "activityLevels": [
    {
      "level": 1,
      "activityDefinition": {
        "id": "a7d853ea-89eb-4735-83d1-b891c6fde398"
      }
    }
  ]
}

Update an assignment with external reference for person

Example updating assignment with ID 757085 using the employee number as the external reference:

PUT
https://<tenant>.myprotime.eu/connector/protimeapi/api/v1/assignments/757085

{
  "person": {
    "externalReferences": {
      "@employee-number": "5678"
    }
  },
  "from": "2025-03-10",
  "until": "2025-03-10",
  "startTimeInMinutes": 540,
  "endTimeInMinutes": 1080,
  "breakDurationInMinutes": 60,
  "activityLevels": [
    {
      "level": 1,
      "activityDefinition": {
        "id": "a7d853ea-89eb-4735-83d1-b891c6fde398"
      }
    }
  ]
}

Update an assignment with multiple activity levels

Example updating assignment with ID 757085 with multiple activity levels:

PUT
https://<tenant>.myprotime.eu/connector/protimeapi/api/v1/assignments/757085

{
  "person": {
    "id": 1234
  },
  "from": "2025-03-10",
  "until": "2025-03-10",
  "startTimeInMinutes": 540,
  "endTimeInMinutes": 1080,
  "breakDurationInMinutes": 60,
  "activityLevels": [
    {
      "level": 1,
      "activityDefinition": {
        "id": "a7d853ea-89eb-4735-83d1-b891c6fde398"
      }
    },
    {
      "level": 2,
      "activityDefinition": {
        "id": "22d320ed-f6ed-44bd-b7b1-fe58f518960c"
      }
    }
  ]
}