Skip to content

Updating Task Instances

Updating a task is done by making a PATCH request to /Api/Tasks/{taskId}, structured as a JSON Patch request. We support 3 patch operations: add, replace & remove.

All requests should be an HTTP PATCH with a JSON body, structured as in the examples below.

Supported paths

The following (case insensitive) paths are the only ones supported:

  • activitycontext/status
  • activitycontext/due
  • name
  • description
  • assigneeId
  • assigneeType
  • owner
  • ownerType
  • state (to update/replace the entire state)
  • state/{key} (to update a single value in state)

Operation: Replace

To replace an existing value. This will change a value that already exists, if the value does not yet exist the task will not be changed.

[
  {
    "op": "replace",
    "path": "/ActivityContext/Status",
    "value": "InProgress"
  }
]

Operation: Add

To add a new value to task state, use the add operation. This will add a value if it doesn't already exist, or replace a value that already exists.

[
  {
    "op": "add",
    "path": "/state/first",
    "value": "test"
  }
]

Operation: Remove

To remove an existing value. This will only replace a value that already exists, if the value does not exist then nothing will be changed

[
  {
    "op": "remove",
    "path": "/state/third"
  }
]

Multiple Operations

Multiple operations in one request is supported, like this:

[
  {
    "op": "remove",
    "path": "/state/third"
  },
  {
    "op": "add",
    "path": "/state/fourth",
    "value": "My new value"
  }
]