Skip to main content

Endpoint

Overview

Delete one or more tasks from your task queue. This is useful for removing tasks that are no longer needed or clearing failed tasks that you don’t want to retry.
Important Restrictions:
  • You can only delete tasks with status scheduled or failed
  • Tasks with other statuses (pending, complete) cannot be deleted using this endpoint
  • Deletion is permanent and cannot be undone

Request Body

string[]
required
Array of task IDs to deleteAll tasks must belong to your organization and must have status scheduled or failed

Response

object
Deletion result information

Error Cases

  • 400 Bad Request: Attempting to delete tasks that are not in scheduled or failed status
  • 404 Not Found: Some tasks don’t exist or don’t belong to your organization
  • 400 Bad Request: No task IDs provided

When to Delete Tasks

Consider deleting tasks in these scenarios:
  1. Scheduled tasks no longer needed - Plans changed, account was removed, etc.
  2. Failed tasks you don’t want to retry - Task configuration was incorrect
  3. Cleanup after testing - Remove test tasks from your queue
  4. Bulk task management - Clear out old or irrelevant tasks
Deletion is permanent!Once a task is deleted, it cannot be recovered. Make sure you really want to delete the task before calling this endpoint.

Best Practices

Check task status before deleting:Always verify that tasks are in scheduled or failed status before attempting to delete them. Use the Get Tasks endpoint to check task statuses first.
1

Fetch tasks

Use the Get Tasks endpoint to retrieve tasks and check their status
2

Filter eligible tasks

Filter out tasks with status scheduled or failed
3

Confirm deletion

Ensure you want to permanently delete these tasks
4

Delete tasks

Call the delete endpoint with the filtered task IDs

Example: Cleanup Failed Tasks

Example: Cancel Scheduled Task

Cannot Delete Running or Completed Tasks

Status restrictions:
  • pending tasks (currently running) cannot be deleted
  • complete tasks cannot be deleted
Only scheduled (not yet started) and failed tasks can be deleted.
If you need to cancel a running task, you’ll need to wait for it to complete or fail. There is no way to interrupt a task that is currently executing.

Comparison with Retry