The print agent keeps going offline
AGENT_OFFLINE means the computer's agent is not connected. Sleep, network, and a stopped process are the usual causes. The printer itself is a different code.
For Operators whose jobs sit in AGENT_OFFLINE
Overview
The dispatcher marks a job with AGENT_OFFLINE when the computer that owns the printer is not connected. PRINTER_OFFLINE is the other case: the computer is connected and the printer is not ready. Reading the reason code tells you which box to walk to.
The agent holds an outbound WebSocket. Sleep, a closed laptop lid, a killed process, or a firewall that blocks outbound HTTPS will drop it. There is no inbound port to open. Restart the agent and confirm it shows connected before you reprint.
A failed job does not automatically print when the agent returns. Submit again with a new Idempotency-Key if the previous attempt reached a terminal failure. A job still queued may proceed when the agent reconnects. Check the status instead of assuming.
Integration steps
- 01
Read the reason code
AGENT_OFFLINE is the PC. PRINTER_OFFLINE is the device. Use POST /v1/print-jobs with Authorization: Bearer and the printer_code from GET /v1/printers.
- 02
Wake the computer and the agent
A test page from the OS proves the printer. A connected agent proves the path.
- 03
Confirm outbound HTTPS
The agent must reach the API host you selected, global or cn.api.printbase.cloud.
- 04
Reprint only if the last job failed
Use a new key for a new physical copy. Use POST /v1/print-jobs with Authorization: Bearer and the printer_code from GET /v1/printers.
Node.js — read job status
// Read status after a disconnect
const created = await fetch('https://api.printbase.cloud/v1/print-jobs', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.PRINTBASE_API_KEY}`,
'Content-Type': 'application/json',
'Idempotency-Key': jobKey,
},
body: JSON.stringify({
printer_code: Number(process.env.PRINTER_CODE),
content_type: 'raw',
content: Buffer.from(payload).toString('base64'),
copies: 1,
}),
}).then(async (res) => {
if (!res.ok) throw new Error(await res.text());
return res.json();
});
const status = await fetch(`https://api.printbase.cloud/v1/print-jobs/${created.id}`, {
headers: { Authorization: `Bearer ${process.env.PRINTBASE_API_KEY}` },
}).then((res) => res.json());
// status.status moves queued -> dispatched -> printing -> completed
Details for this setup
Queued versus failed
While the agent is briefly gone, a job can stay queued with an offline reason and wait. A terminal failure is the one you must resubmit.
One computer on the free plan
The free plan is one computer. A second PC will not be a free spare agent. The agent prints only what you send; it does not fetch the document from the platform for you.
Questions
Does opening port 443 inbound help?
No. The agent connects out. The call is still POST /v1/print-jobs with a Bearer API key, and HTTP 201 means queued rather than printed.
VPN required?
Not for the agent. A VPN that blocks its outbound call will look like offline.
Multiple agents on one printer?
Install one. Two agents do not create failover in this product.
How fast is the status?
Poll GET /v1/print-jobs/{id}. Paid webhooks fire on completed and failed, not on every offline blip.
Free plan: 100 jobs a month on one computer, no card.