Skip to main content

Endpoint

Authentication

This endpoint requires API key authentication via the Authorization header:

Path Parameters

string
required
The unique identifier of the task to delete

Requirements

  • Task must have status Succeeded, Failed, or Cancelled
  • Tasks that are Starting or Processing cannot be deleted (use Cancel Task instead)

Response

On success, returns a plain text response:

Status Codes

  • 200: Task deleted successfully
  • 400: Bad request (task cannot be deleted due to invalid status)
  • 404: Task not found or expired
  • 500: Internal server error

Examples

What Gets Deleted

When you delete a task, the following data is permanently removed:
  1. Task Metadata - All task information from the database
  2. Input File - The original uploaded file
  3. Processed PDF - The generated PDF (if applicable)
  4. Output JSON - All processed chunks and segments
  5. Images - All cropped segment images and page images
  6. Configuration - All processing settings
This action is irreversible - once deleted, the task and all associated data cannot be recovered.

Common Use Cases

  • Cleanup: Remove old or unnecessary tasks to free up storage
  • Privacy: Delete sensitive documents after processing
  • Testing: Clean up test tasks during development
  • Error Recovery: Remove failed tasks that won’t be retried

Best Practices

  1. Download First: If you need the output data, retrieve it via GET /task/ before deleting
  2. Check Status: Verify the task is in a deletable state (Succeeded, Failed, or Cancelled)
  3. Batch Operations: If deleting multiple tasks, implement rate limiting to avoid overwhelming the API
  4. Expiration Alternative: Consider using the expires_in parameter when creating tasks instead of manual deletion

Error Handling