AI Agents
Neo

CancelTask

Cancels an agent task. When force is true, immediately terminates the runtime session and resets the task to idle. This is the escalation path when a graceful cancel (via the user_cancel event in RespondToTask) is insufficient or the task is stuck. Unlike graceful cancel, force-cancel does not attempt to notify the agent runtime — it kills the session directly and resets the task state. Currently only force cancellation is supported; the force field must be set to true. Returns 409 if the session was stopped but the task status could not be reset to idle.

post/api/preview/agents/{orgName}/tasks/{taskID}/cancel

Request

  • Base URL: https://api.pulumi.com (the document declares no server; this is the origin it was published from)
  • URL: https://api.pulumi.com/api/preview/agents/{orgName}/tasks/{taskID}/cancel
  • Auth: none declared

Path parameters

orgNamestring required

The organization name

taskIDstring required

The agent task identifier

Request body

forceboolean required

If true, immediately terminate the runtime session and reset the task to idle without attempting a graceful cancel. Required to be true in the current implementation.

Response

Task cancelled successfully

Changes

No recorded changes to this operation across all 1 revision of this API.