Permanently deletes a single task or task hierarchy from a space. Use this endpoint to remove
completed tasks, cancel obsolete work items, or clean up task structures that are no longer needed. The
operation supports both individual task deletion and recursive deletion of entire task hierarchies including
all subtasks. When deleting a parent task with recursive=true, all child tasks and their descendants are
also deleted in a cascading operation. When recursive=false (default), the operation will fail if the task
has any children, protecting against accidental data loss. This asynchronous operation returns immediately
with operation IDs that can be polled for completion status.
Key Features:
- Delete individual leaf tasks (tasks with no children) using default recursive=false
- Delete entire task hierarchies using recursive=true for bulk cleanup operations
- Asynchronous processing returns operation IDs for status tracking via polling
- Fail-safe validation prevents accidental deletion of parent tasks when recursive=false
- Permanent deletion cannot be undone (consider archiving workflows if recovery is needed)
Typical Use Cases:
- Delete Leaf Task: Remove a single completed task with no subtasks. Example: DELETE /v2/spaces/w5PmrE9p0kicqqRSVJ3VBQ/tasks/yT97zSH8tnz8OWxeVFzKTj?recursive=false deletes the task if it has no children, or returns 400 error if children exist.
- Delete Task Hierarchy: Remove a parent task and all its descendants. Example: DELETE /v2/spaces/w5PmrE9p0kicqqRSVJ3VBQ/tasks/parentTaskId123?recursive=true deletes the parent task plus all subtasks recursively, useful for canceling an entire program phase.
- Cleanup After Program Completion: Remove all tasks in a completed program by deleting parent tasks with recursive=true, freeing up space and reducing clutter in the workspace.
Expected Response:
Returns 200 OK with AsyncOperationResponse containing asyncOperationIds array (example: [opId1", "opId2"]).
Poll these operation IDs using the async operations status endpoint to confirm deletion completion.
Authorization Logic:
- User must have a valid JWT token with management scopes
- User must have permission to delete the specific task
- For recursive deletes, user must have delete permission on all descendant tasks