Skip to content

Delete a task

DELETE
/api/v3/organizations/{organisation}/ai/tasks/{taskId}

Permanently deletes a task. This action cannot be undone. * * Dependency Protection: * By default, deletion is blocked if other tasks depend on this task (TASK_HAS_DEPENDENTS error). * This prevents breaking workflows. * * Cascade Delete: * Use ?cascade=true to delete the task AND all tasks that depend on it recursively. * Useful for cleaning up entire dependency chains. * * Examples: * - DELETE /tasks/{id} - Deletes task if no dependents, otherwise returns 409 error * - DELETE /tasks/{id}?cascade=true - Deletes task and all dependent tasks

Authorizations

Parameters

Path Parameters

organisation
required
string

The organisation ID

taskId
required
string format: uuid

The task UUID

Query Parameters

cascade
boolean

If true, delete task and all dependent tasks recursively

Responses

200

Task deleted successfully

object
deleted
boolean
true
deletedCount

Number of tasks deleted (more than 1 for cascade)

integer
1
deletedTaskIds
Array<string>

404

Task not found

409

Task has dependents - cannot delete without cascade

object
error
string
TASK_HAS_DEPENDENTS
message
string
Cannot delete task with 3 dependent task(s). Use cascade=true to delete all.
dependentTaskIds
Array<string>

500

Failed to delete task