InkRelay

v0.1.1
io.github.GauravBR/inkrelay Checked 1 day ago Published 1 month ago

Print PDFs, ZPL labels and ESC/POS receipts on your printers and follow print jobs via InkRelay

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

whoami Identify the API key

Returns the organization, plan, mode (test or live) and current usage behind INKRELAY_API_KEY. Call it first.

list_computers List computers

Lists the computers running the InkRelay agent, with their state (online, offline, disabled), OS and agent version.

ParameterTypeDescription
limitinteger

list_printers List printers

Lists printers with id, name, computer, online state, whether they are live (accept jobs) and their default options. Use get_printer for paper sizes, trays and other capabilities.

ParameterTypeDescription
computerIdstringOnly printers of this computer
liveOnlybooleanOnly printers that accept jobs

get_printer Get a printer

Returns one printer with its capabilities (papers in tenths of a millimetre, bins, dpis, duplex, color, nup), default options and custom paper sizes.

ParameterTypeDescription
printerId *string

update_printer Update printer settings

Sets a printer's display name, live switch (enabled), default options, custom paper sizes (tenths of a millimetre; replaces the whole list) or remarks. Needs a key with the admin scope.

ParameterTypeDescription
printerId *string
customPapersarray
defaultOptionsobjectPDF options. Omitted options use the printer's defaults; unsupported ones are ignored and listed in stateMessage.
displayNamestring | null
enabledbooleanThe live switch: only enabled printers accept jobs
remarksstring | null

print_pdf Print a PDF

Prints a PDF on a printer. Pass exactly one of url (public or signed http(s) URL, fetched once), base64, or filePath (a local file, read by this server). Up to 25 MB. With an ir_live_ key this prints on paper and counts toward the plan; with ir_test_ it runs on a virtual printer.

ParameterTypeDescription
printerId *stringPrinter id from list_printers
title *stringShown in the dashboard and the OS print queue
base64string
expireAfterinteger
filePathstringA file inside the folder this server runs in (or INKRELAY_FILE_ROOT)
idempotencyKeystringSame key and body returns the first job instead of printing twice. Generated if omitted.
optionsobjectPDF options. Omitted options use the printer's defaults; unsupported ones are ignored and listed in stateMessage.
qtyintegerHow many times to print the document
timeoutSecondsinteger
urlstring
waitbooleanWait until the job is done, error, cancelled or expired, then return it

print_raw Print raw bytes (ZPL, ESC/POS)

Sends printer language bytes unchanged to a label or receipt printer, e.g. ZPL (^XA...^XZ) or ESC/POS. Pass exactly one of text (each character U+0000 to U+00FF becomes one byte, so \u001b is ESC), base64, url or filePath. Options do not apply. The OS queue must accept raw data (CUPS raw queue, or the printer's own or Generic / Text Only driver on Windows).

ParameterTypeDescription
printerId *stringPrinter id from list_printers
title *stringShown in the dashboard and the OS print queue
base64string
expireAfterinteger
filePathstringA file inside the folder this server runs in (or INKRELAY_FILE_ROOT)
idempotencyKeystringSame key and body returns the first job instead of printing twice. Generated if omitted.
qtyintegerHow many times to print the document
textstring
timeoutSecondsinteger
urlstring
waitbooleanWait until the job is done, error, cancelled or expired, then return it

get_print_job Get a print job

Returns a print job with its state, stateMessage and the time of each state change, plus its full event history.

ParameterTypeDescription
jobId *string
includeEventsboolean

wait_for_print_job Wait for a print job

Polls a print job until it is done, error, cancelled or expired (or the timeout passes) and returns it.

ParameterTypeDescription
jobId *string
timeoutSecondsinteger

list_print_jobs List print jobs

Lists recent print jobs, newest first, optionally filtered by printer, computer or state.

ParameterTypeDescription
computerIdstring
limitinteger
printerIdstring
statestring

cancel_print_job Cancel a print job

Cancels a job that is still queued or sent. Once the agent has received it, the API answers 409 not_cancellable.

ParameterTypeDescription
jobId *string

reprint_print_job Reprint a job

Prints the stored file of an earlier job again (files are kept 7 days), on the same printer or another one of the same mode.

ParameterTypeDescription
jobId *string
printerIdstringDefaults to the original printer
timeoutSecondsinteger
titlestring
waitbooleanWait until the job is done, error, cancelled or expired, then return it

get_usage Get print usage

Returns the plan, the live prints used and included this billing period, and earlier periods.

list_events List events

Reads the event feed (the same events webhooks deliver). For new events use dir asc with after set to the last nextCursor.

ParameterTypeDescription
afterstring
dirstring
limitinteger

list_webhooks List webhook endpoints

Lists the webhook endpoints of this key's mode.

create_webhook Create a webhook endpoint

Creates an endpoint that receives signed events (Standard Webhooks HMAC). Returns the whsec_ signing secret once: tell the user to store it as INKRELAY_WEBHOOK_SECRET. Live endpoints need https. Needs the admin scope.

ParameterTypeDescription
events *array
url *string
descriptionstring

ping_webhook Send a test webhook

Queues a signed test delivery with type ping to an endpoint. Needs the admin scope.

ParameterTypeDescription
webhookId *string