Limai Docs
API ReferenceQueue

Cancel Job

Cancel pending extraction jobs for a file

POST/api/v1/queue/cancel

Cancels all pending jobs for a specific file. Only jobs with PENDING status can be cancelled. Optionally delete the queue records entirely instead of marking them as failed.

Parameters

NameTypeInRequiredDescription
fileIdstringbodyYesThe file ID to cancel jobs for
deleteRecordbooleanbodyNoDelete queue records instead of marking as failed(default: false)

Request

const res = await fetch(
"https://app.limai.io/api/v1/queue/cancel",
{
  method: "POST",
  headers: {
    Authorization: "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    fileId: "file_001",
    deleteRecord: false,
  }),
}
);

Response

Response200
{
  "cancelledCount": 2,
  "deletedCount": 0,
  "jobIds": [
    "job_001",
    "job_002"
  ]
}