Submit a batch of print jobs
const url = 'https://example.com/api/v1/print/example/batch';const options = { method: 'POST', headers: {'X-Label-Hub-Key': '<X-Label-Hub-Key>', 'Content-Type': 'application/json'}, body: '{"half_cut_override":true,"items":[{"content_type":"qr_only","data":{"items":[],"primary_id":"example","qr_payload":"example","secondary":[],"title":"example"},"lookup":{"app":"example","identifier":"example"},"options":{"auto_cut":true,"copies":1,"half_cut":false,"high_resolution":false,"last_page":true}}],"printer_slug":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/print/example/batch \ --header 'Content-Type: application/json' \ --header 'X-Label-Hub-Key: <X-Label-Hub-Key>' \ --data '{ "half_cut_override": true, "items": [ { "content_type": "qr_only", "data": { "items": [], "primary_id": "example", "qr_payload": "example", "secondary": [], "title": "example" }, "lookup": { "app": "example", "identifier": "example" }, "options": { "auto_cut": true, "copies": 1, "half_cut": false, "high_resolution": false, "last_page": true } } ], "printer_slug": "example" }'Validates all items and enqueues the batch as one tape run — no per-item errors are returned. The labels (copies included) print in sub-jobs of at most 50; each further sub-job waits for POST /api/v1/batches/{batch_id}/continue. Inside a sub-job the labels go out in groups of 10 with a status check after each; when a group fails, the run stops (see GET /api/v1/batches/{batch_id}). A tape end stops it when the printer reports it: a PT sets the SNMP noPaper bit; whether a QL-820NWB reports the end of a DK roll is not verified, so on a QL the check reliably catches only an unreachable printer and an open cover. Any validation failure or hardware precondition (printer_offline, cover_open, unsupported_tape, no_tape_loaded, content_type_data_mismatch) rejects the whole batch with the appropriate 4xx status code. A page printer (IPP) answers 409 media_kind_mismatch. A printer holds at most LABELYARD_MAX_QUEUED_RUNS_PER_PRINTER (default 5) runs and a key at most LABELYARD_MAX_QUEUED_RUNS_PER_KEY (default 20); a run counts until it is over. A run that waits for /continue or a reprint counts against its key only. Over a cap the batch answers 429 too-many-queued-runs.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Printer slug or UUID
Printer slug or UUID
Request Bodyrequired
Section titled “Request Bodyrequired”Top-level POST /api/v1/print/{slug_or_uuid}/batch body.
object
POST /api/v1/print body.
Either data (RawLabelData) or lookup (PrintLookupRequest) is provided.
Exactly one of the two must be present.
object
Tape-independent semantic content types for label rendering.
Raw label payload accepted when the client supplies data directly.
Mirrors LabelData minus source_app (set server-side to ‘manual’).
All content fields are optional — ContentType-specific validation
happens in LayoutEngine._validate_data.
Every free text is bounded at the request (the same caps as sheet items): 512 characters
per text and QR payload, at most 10 secondary lines and 100 items. A label shows
far less; the renderer shortens what does not fit (#258 security review).
object
Resolve label data via an integration plugin.
object
Per-print options — copies, cut behaviour, resolution, layout.
object
The built-in QL 62 mm across-width layouts (docs/design/ql-layout-presets).
How the label content runs on endless tape.
Responses
Section titled “Responses”Successful Response
202 Response für erfolgreich akzeptierte Batch (auch wenn 0 Items queued).
object
The job of every label (copies included) in print order (#277). The labels are printed in sub-jobs of sub_job_size; each further sub-job waits for POST /api/v1/batches/{batch_id}/continue.
Labels per sub-job (#277).
Example generated
{ "batch_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "job_ids": [ "example" ], "label_job_ids": [ "example" ], "printer_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "queued_at": "example", "sub_job_size": 1}Validation Error
object
object
object
Example generated
{ "detail": [ { "ctx": {}, "input": "example", "loc": [ "example" ], "msg": "example", "type": "example" } ]}