D
Druckling
Docs

Cancel a batch

POST
/batches/{id}/cancel

Items that haven't started rendering are canceled (failed documents with error code canceled); renders already running finish. A canceled batch has no ZIP. 409 once the batch has finished.

Authorization

headerAuthorizationBearer <token>

Authorization: Bearer dr_live_… or dr_test_…

Path Parameters

id*string

Response Body

OK

application/json
  1. response
id*string
object*unknown
status*string

queued → running → completed (ZIP ready), failed (nothing rendered, or the ZIP couldn't be built) or canceled.

Value in"queued""running""completed""failed""canceled"
template*string
version*number
filename_pattern*string|null
counts*

Items by outcome; pending is queued or rendering.

zip_url*|

Signed download URL of the ZIP with every rendered file (PDFs, or XML e-invoices), once the batch completed and while the ZIP is retained.

zip_size_bytes*number|null
zip_expires_at*|

When the ZIP is deleted (the file retention period).

error*|null
test_mode*boolean
created_at*string
Formatdate-time
finished_at*|null
Example Request
curl -X POST 'https://druckling-nine.vercel.app/v1/batches/string/cancel'
Example Response200
{  "id": "string",  "object": "batch",  "status": "queued",  "template": "string",  "version": 0,  "filename_pattern": "string",  "counts": {    "total": 0,    "pending": 0,    "rendered": 0,    "failed": 0,    "canceled": 0  },  "zip_url": "string",  "zip_size_bytes": 0,  "zip_expires_at": "2019-08-24T14:15:22Z",  "error": {    "code": "string",    "message": "string"  },  "test_mode": true,  "created_at": "2019-08-24T14:15:22Z",  "finished_at": "2019-08-24T14:15:22Z"}