Developer docs
Printaloft is one small HTTPS API. You send a PDF to a role, Printaloft hands it to the right station and tells you what happened.
Basics
Base URL: https://printcloud.apps.ubartas.cloud. Every request carries your API key as “Authorization: Bearer pck_…”. Keys are per account and can be revoked one by one.
A role is a name you choose, for example packing-slip, invoice or label. In your account each role points to a printer and tray at a station. Your code only knows roles.
Submit a job
POST /v1/jobs with the PDF as Base64 (up to 20 MB). With ?wait=50 the request waits up to 50 seconds for the final status.
idempotencyKey is required and must be unique per print. Use something stable from your system, for example order number, document and attempt.
curl -X POST "https://printcloud.apps.ubartas.cloud/v1/jobs?wait=50" \
-H "Authorization: Bearer pck_…" \
-H "Content-Type: application/json" \
-d '{
"idempotencyKey": "order-1042:packing-slip:1",
"role": "packing-slip",
"pdfBase64": "JVBERi0xLjcK…",
"fileName": "packing-slip-1042.pdf",
"jobName": "Order 1042"
}'The answer
201 for a new job, 200 when the same key comes again. status is one of queued, delivered, spooled, printed, failed, cancelled or expired. ok is true only for printed.
If the job is not finished after the wait, ask again with GET /v1/jobs/<jobId>?wait=50.
{
"ok": true,
"accepted": true,
"jobId": "job_7f3c…",
"status": "printed",
"message": "Gedruckt.",
"printer": "Brother HL-L5100DN (Schacht 2)",
"stationOnline": true
}Ask for the status
Returns the same object as above. Repeat as often as you like, it never prints anything.
curl "https://printcloud.apps.ubartas.cloud/v1/jobs/job_7f3c…?wait=50" \
-H "Authorization: Bearer pck_…"Retries without double prints
Network errors and timeouts happen. Retry with the same idempotencyKey: you reach the same job and nothing is printed twice. The same key with a different PDF returns 409.
A wanted reprint gets a new key, for example by counting up the attempt at the end.
Cancel and deadlines
POST /v1/jobs/<jobId>/cancel cancels one job. POST /v1/jobs/cancel takes jobIds, idempotencyKeys or allOpen with olderThanSec. Anything not yet in the spooler can be cancelled.
Each job has a deadline until it reaches the spooler: 15 minutes by default, or expiresInSec per job (30 seconds to 24 hours). After that it is expired and never printed.
curl -X POST "https://printcloud.apps.ubartas.cloud/v1/jobs/cancel" \
-H "Authorization: Bearer pck_…" \
-H "Content-Type: application/json" \
-d '{ "allOpen": true, "olderThanSec": 600 }'Errors
400 invalid job, 401 missing or revoked key, 409 same key with different content, 413 PDF too large. On 5xx without accepted: true the job was not taken; it is safe to retry with the same key.
The agent
A Windows service for the PC next to your printers. Pair it once with a code from your account; after that it only opens outgoing HTTPS connections, fetches jobs, prints through the Windows spooler and reports back.
Access to the agent and to API keys is part of early access. Write to mail@printaloft.com.