Cancel a Task.
The same handler is also mounted at `/v2/org/{org}/nico/rack/task/{id}/cancel`
for backward compatibility; prefer this path for new clients.
Cancellation is best-effort and idempotent: tasks in non-terminal
states (`Pending`, `Running`) are marked `Terminated`
and any underlying Temporal workflow is terminated. Cancelling an
already-`Terminated` task returns the same task without changes.
Tasks that have already finished (`Succeeded` or `Failed`) cannot
be cancelled.
Tasks are site-scoped; `siteId` must be the Site where the task was
created. Org must have an Infrastructure Provider entity. User must
have authorization role with `PROVIDER_ADMIN` suffix.
Request
This endpoint expects an object.
siteIdstringRequiredformat: "uuid"
ID of the Site that owns the task (tasks are site-scoped).
Response
Accepted. The cancellation request was accepted and the Task’s
last known state is returned. Clients should GET the task to
observe the final state, since cancellation is best-effort and
the operation may still be terminating.
idstringOptionalformat: "uuid"
Unique identifier of the task.
statusenumOptional
Current state of the task.
descriptionstringOptional
Human-readable description provided when the task was created.
messagestringOptional
Optional status or error message describing the current state or result.
ruleIdstring or nullOptionalformat: "uuid"
Operation Rule that Flow resolved for this task — either because
the caller pinned one via ruleId on the originating request or
because Flow’s default rule resolution picked it. Null if Flow
has not yet recorded a resolution.
starteddatetimeOptional
Timestamp when the task started execution.
finisheddatetimeOptional
Timestamp when the task finished (succeeded, failed or terminated).
createddatetimeOptional
Timestamp when the task was created.
updateddatetimeOptional
Timestamp when the task was last updated.
reportobjectOptional
Structured v1 execution report for the task. Populated on single-task GET and cancel responses, and on list responses only when includeReport=true is set. Omitted when the task has not yet produced a report (e.g. still queued) or when the caller did not opt in on list endpoints.
A future schema revision will be exposed as a new TaskReportV2 schema referenced from a parallel response field; v1 consumers are not disturbed by that bump.