Cancel task

Beta
Cancels a task by marking it for cancellation in the system. This method initiates task cancellation based on the task's current state: - If the task has not been sent to an agent, it cancels immediately and transitions the task to a terminal state (`STATUS_DONE_NOT_OK` with `ERROR_CODE_CANCELLED`). - If the task has already been sent to an agent, the cancellation request is routed to the agent. The agent is then responsible for deciding whether cancellation is possible or not: - If the task can be cancelled, the agent must use `UpdateTaskStatus` and set the task status to `STATUS_DONE_NOT_OK`. - If the task cannot be cancelled, the agent must use `UpdateTaskStatus` to attach a `TaskError` to the task with the error code `ERROR_CODE_REJECTED` and a `message` explaining why the task cannot be cancelled.

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Path parameters

taskIdstringRequired
The ID of task to cancel

Request

This endpoint expects an object.
authorobjectOptional
Who or what is requesting to cancel this task.

Response

Task cancellation was successful.
versionobject
Version of this task.
displayNamestring

DEPRECATED: Human readable display name for this task, should be short (<100 chars).

specificationobject
The path for the Protobuf task definition, and the complete task data.
createdByobject
Records who created this task. This field will not change after the task has been created.
lastUpdatedByobject
Records who updated this task last.
lastUpdateTimedatetime
Records the time of last update.
statusobject
The status of this task.
scheduledTimedatetime
If the task has been scheduled to execute, what time it should execute at.
relationsobject

Any related Tasks associated with this, typically includes an assignee for this task and/or a parent.

descriptionstring
Longer, free form human readable description of this task
isExecutedElsewhereboolean
If set, execution of this task is managed elsewhere, not by Task Manager. In other words, task manager will not attempt to update the assigned agent with execution instructions.
createTimedatetime
Time of task creation.
replicationobject
If populated, designates this to be a replicated task.
initialEntitieslist of objects

If populated, indicates an initial set of entities that can be used to execute an entity aware task For example, an entity Objective, an entity Keep In Zone, etc. These will not be updated during execution. If a taskable agent needs continuous updates on the entities from the COP, can call entity-manager, or use an AlternateId escape hatch.

ownerobject
The networked owner of this task. It is used to ensure that linear writes occur on the node responsible for replication of task data to other nodes running Task Manager.
retryStrategyobject
Sets an optional try strategy for tasks. Use this option to control how Lattice attempts to retry delivery of tasks to assets with intermittent access or network connectivity to your environment.
deliveryStateobject
The current delivery state of a task.

Errors

400
Bad Request Error
401
Unauthorized Error
404
Not Found Error