Skip to content
ComPDF
DemoAPI ReferenceFAQ

PDF Generation Template Editor

Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.

View on GitHub

API for Close File Processing

Use this API to cancel an async file-processing task that is still pending or processing.

Cancel Task

ItemValue
Request URLPOST http://localhost:8080/api/v1/task/{id}/cancel
Authenticationx-api-key: your_api_key_here
Content typeapplication/json

Request Example

bash
curl -X POST "http://localhost:8080/api/v1/task/7fdc1fb6-1f4d-4b5c-88d6-4b4c4c1e8f44/cancel" \
  -H "x-api-key: your_api_key_here"

Response

json
{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "7fdc1fb6-1f4d-4b5c-88d6-4b4c4c1e8f44",
    "status": "canceled",
    "failureCode": "TASK_CANCELED",
    "failureReason": "task canceled by client"
  }
}

Tasks that already reached success or failed keep their final status.