Print API

Use a tenant-scoped service account to obtain a Doorman access token and enqueue a print job through Labels server v2.

About 9 minutes

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. 1

    Copy the integration config

    Record the token URL, audience, scope, tenant ID, print endpoint, API key, and one-time API secret.

  2. 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. 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.

bash
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

HeaderValue
AuthorizationBearer <access_token>
Content-Typeapplication/json
x-tenantThe tenant ID shown in the integration configuration

Print-job payload

FieldDescription
idTSaved template ID.
printerIdPrinter ID discovered by the agent. Preferred when available.
printerPrinter name. Used as a fallback route and retained on the job.
formatPrinter format name or format ID selected for the request.
orientationportrait or landscape.
numberCopiesPositive copy count for each label record.
dataArray 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.

bash
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

StatusMeaning
200 / 201The job was queued; the response contains one or more job IDs.
400Tenant context or request data is missing or invalid.
401The bearer token is missing, expired, or invalid.
403The service account lacks jobs:enqueue, the tenant is forbidden, or the print quota blocks the request.
404The referenced template does not exist in the tenant.
500The server could not enqueue the job. Log the response error and job context, without credentials.