Print API
Use a tenant-scoped service account to obtain a Doorman access token and enqueue a print job through Labels server v2.
Supported integration surface
The documented external integration is POST /v2/jobs. It accepts a saved template ID, printer route, format, orientation, copy count, and dynamic data.
Other v2 routes are used by the Labels web application and Print Agent. Treat them as internal unless your deployment contract explicitly exposes them.
Obtain an access token
- 1
Copy the integration config
Record the token URL, audience, scope, tenant ID, print endpoint, API key, and one-time API secret.
- 2
Request a client-credentials token
Send the API key as client_id and API secret as client_secret to the Doorman token URL.
- 3
Keep the token short-lived
Cache it only until expiry, then request a new one. Never put the API secret in a URL or log.
curl --request POST "$DOORMAN_TOKEN_URL" \
--header "Content-Type: application/x-www-form-urlencoded" \
--data-urlencode "grant_type=client_credentials" \
--data-urlencode "client_id=$LABELS_API_KEY" \
--data-urlencode "client_secret=$LABELS_API_SECRET" \
--data-urlencode "audience=$DOORMAN_AUDIENCE" \
--data-urlencode "scope=$DOORMAN_SCOPE"Request headers
| Header | Value |
|---|---|
| Authorization | Bearer <access_token> |
| Content-Type | application/json |
| x-tenant | The tenant ID shown in the integration configuration |
Print-job payload
| Field | Description |
|---|---|
| idT | Saved template ID. |
| printerId | Printer ID discovered by the agent. Preferred when available. |
| printer | Printer name. Used as a fallback route and retained on the job. |
| format | Printer format name or format ID selected for the request. |
| orientation | portrait or landscape. |
| numberCopies | Positive copy count for each label record. |
| data | Array of objects keyed by exact dynamic field names. |
Enqueue a job
With dynamic data the successful response is an array containing the queued job ID. A template-only request can return a single job ID. Store the returned ID for support and status correlation.
curl --request POST "$LABELS_PRINT_ENDPOINT" \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--header "x-tenant: $LABELS_TENANT_ID" \
--data '{
"idT": "template-id",
"printerId": "printer-id",
"printer": "Production Printer",
"format": "100 x 50 mm",
"orientation": "landscape",
"numberCopies": 1,
"data": [
{
"batch": "A1",
"lotNumber": "LOT-2026-0042"
}
]
}'Common responses
| Status | Meaning |
|---|---|
| 200 / 201 | The job was queued; the response contains one or more job IDs. |
| 400 | Tenant context or request data is missing or invalid. |
| 401 | The bearer token is missing, expired, or invalid. |
| 403 | The service account lacks jobs:enqueue, the tenant is forbidden, or the print quota blocks the request. |
| 404 | The referenced template does not exist in the tenant. |
| 500 | The server could not enqueue the job. Log the response error and job context, without credentials. |