Skip to content

GET /jobs/{jobId}

Returns the current state of a print job. The state is queried live from CUPS on each request.

Use this endpoint to poll for completion after submitting a job with wait: false via POST /print/{target}.

Endpoint:

GET /api/v1/jobs/{jobId}
Parameter Type Description
jobId string The job ID returned by POST /print/{target} (e.g. pj_a8f3e1b2).
{
"status": "success",
"statusCode": 200,
"result": {
"module": "/jobs/pj_a8f3e1b2",
"message": "Job retrieved.",
"content": {
"jobId": "pj_a8f3e1b2",
"printer": "tcp_192-168-86-250_9100",
"target": "tag_LABELS",
"title": "Shipping Label #1234",
"source": "my-erp",
"contentType": "raw_base64",
"size": 1024,
"state": "completed",
"error": null,
"createdAt": "2026-03-28T14:30:00.000Z",
"completedAt": "2026-03-28T14:30:08.500Z",
"cupsJobId": "ProxyBox_Labels-42"
}
}
}
Field Type Description
jobId string ProxyBox job ID.
printer string Printer path that received the job.
target string Original target from the request.
title string Job title.
source string | null Submitting application or user.
contentType string Content type used (e.g. pdf_base64, raw_url).
size number Document size in bytes.
state string Current state (see below).
error string | null Error message if failed.
createdAt string ISO 8601 timestamp.
completedAt string | null ISO 8601 timestamp, or null if still active.
cupsJobId string | null CUPS internal job ID. For debugging only.
State Description
queued Submitted to CUPS, waiting to print.
printing CUPS is actively sending data to the printer.
completed Finished successfully.
failed CUPS error or pre-flight check failed.

Returned when the job ID doesn’t exist or has expired from memory (jobs are kept for 1 hour).

{
"status": "error",
"statusCode": 404,
"result": {
"module": "/jobs/pj_00000000",
"message": "Job not found",
"content": {
"message": "No job with ID: pj_00000000"
}
}
}
// Submit a non-waiting print job
const printRes = await fetch('https://pbx-ABCD.pbxz.io/api/v1/print/tag_LABELS', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-API-Key': 'ULA9WHXMFCHF' },
body: JSON.stringify({
content: 'XlhBXkZPNTAuNTBeQTBOLDUwLDUwXkZESGVsbG8gV29ybGReRlNeWFo=',
contentType: 'raw_base64',
wait: false
})
});
const { result } = await printRes.json();
const jobId = result.content.jobId;
// Poll until complete
let state = 'queued';
while (state === 'queued' || state === 'printing') {
await new Promise(r => setTimeout(r, 2000));
const jobRes = await fetch(`https://pbx-ABCD.pbxz.io/api/v1/jobs/${jobId}`, {
headers: { 'X-API-Key': 'ULA9WHXMFCHF' }
});
const job = await jobRes.json();
state = job.result.content.state;
}
console.log(`Job ${jobId}: ${state}`);

ProxyBox Docs v1.0.6