Browse documentation
API referenceDELETE/v1/batch/jobs/{job_id}Free
Try it

Cancel batch job

DELETE /v1/batch/jobs/{job_id}

Cancel a pending or running batch job by id. The worker stops before the next line and the job stays cancelled. Lines that already finished stay billed, and you can still download them from GET /v1/batch/jobs/{job_id}/results. Finished jobs (succeeded, partial, failed, or cancelled) can't be cancelled and return 400 Cannot cancel <status> job.

When to use it

Use this endpoint for user-initiated cancellation in batch dashboards.

Authentication and billing

  • Requires X-API-Key or api_key.
  • Credit cost: Free. Non-billable batch control route.
  • See pricing for plan allowances and full billing details.

Request

This endpoint does not require a request body.

FieldLocationRequiredNotes
job_idpathYesBatch job id to cancel.
api_keyqueryNoOptional alternative to the X-API-Key header. Prefer the header for server-side applications.

Response

Returns the cancellation result or an error for finished jobs.

Successful Responseapplication/json
{
  "id": "batch_a1b2c3d4e5f6g7h8",
  "status": "cancelled"
}

Code examples

SDK examples use a client created as in the Python, JavaScript / TypeScript, Java, PHP, or C# SDK guide. Java examples import com.fasterxml.jackson.databind.JsonNode and in.manasija.drishti.params.*. C# examples use using Manasija.Drishti.Params;.

client.delete_batch_jobs_job_id(job_id="batch_a1b2c3d4e5f67890")

Try it

Send this request from the Drishti API playground with your own API key. It shows the credit cost before you send and gives you the matching cURL command. For schemas and the full OpenAPI contract, use the Scalar API client.