Skip to main content

Endpoint

Authentication

This endpoint requires authentication via API key. Include your API key in the X-API-Key header:

Path Parameters

Request Example

Response

Success Response

Status Code: 200 OK

Response Fields

Error Responses

401 Unauthorized

Returned when authentication fails. See the authentication errors section for details.

404 Not Found

Returned when the task doesn’t exist or you don’t have access to it.

409 Conflict

Returned when the task cannot be cancelled (e.g., already completed or already cancelled).

500 Internal Server Error

Returned when cancellation fails due to a server error.

Notes

Cancelling a task is irreversible. The workflow will stop at its current step and cannot be resumed.
Only tasks with status pending or in_progress can be cancelled. Completed, failed, or already cancelled tasks cannot be cancelled.

Use Cases

This endpoint is useful for:
  • User-initiated cancellation - Allow users to stop workflows they no longer need
  • Error handling - Cancel workflows that are stuck or encountering issues
  • Workflow management - Clean up unnecessary or duplicate workflow instances
  • Resource optimization - Stop workflows that are no longer relevant to free up resources