Skip to main content
DELETE
/
jobs
/
{id}
Cancel Job
curl --request DELETE \
  --url https://api.example.com/jobs/{id} \
  --header 'x-api-key: <x-api-key>'
{
  "message": "Job cancelled successfully",
  "job_id": "550e8400-e29b-41d4-a716-446655440000"
}

Overview

Cancel a job that is still waiting in the queue. Jobs that are already processing or completed cannot be cancelled.

Header Parameters

x-api-key
string
required
Your API key for authentication

Path Parameters

id
uuid
required
The job UUID to cancel

Response

message
string
Success message
job_id
string
The cancelled job ID

Examples

curl -X DELETE "https://tornado.velys.software/jobs/550e8400-e29b-41d4-a716-446655440000" \
  -H "x-api-key: sk_your_api_key"

Success Response

{
  "message": "Job cancelled successfully",
  "job_id": "550e8400-e29b-41d4-a716-446655440000"
}

Error Responses

{
  "error": "Job cannot be cancelled (not in queue or already processing)"
}

Notes

  • Only jobs with status Pending (in queue) can be cancelled
  • Jobs that are already Processing, Completed, or Failed cannot be cancelled
  • Cancelled jobs are marked as Failed with the error message “Job cancelled by user”
  • Cancellation is atomic - if successful, the job is guaranteed to be removed from the queue