Reference

API reference

A JSON REST API. Base URL https://rocketprint.io/api, authenticated with an organization API key.

Authentication

Pass your key in the X-API-Key header on every request. Keys are organization-scoped, prefixed rp_live_, and stored only as a hash — if you lose one, revoke it and create another.

bash
curl https://rocketprint.io/api/v1/printers \
  -H "X-API-Key: $ROCKETPRINT_KEY"

Endpoints

EndpointWhat it does
POST/v1/print-jobsCreate a print job and dispatch it if the printer is online.
GET/v1/print-jobsList jobs, newest first. Filter by status and printer.
GET/v1/print-jobs/:idFetch one job and its current status.
DELETE/v1/print-jobs/:idCancel a job that is still pending.
GET/v1/printersList registered printers with presence and station.
GET/v1/printers/:idFetch one printer.
GET/v1/scalesList connected scales and their latest readings.
GET/v1/scales/:idRead one scale and its measurement state.

Create a print job

POST /v1/print-jobs — returns 201 with the created job, or 200 with the original job if this is an idempotent replay.

FieldTypeNotes
printerIdstringRequired. An ID from GET /v1/printers.
contentTypeenumRequired. One of raw_base64, pdf_base64, text, raw_uri, pdf_uri. The URI variants are disabled by default and return a validation error.
contentstringRequired. Base64 payload, plain text, or a URL. Maximum 10 MiB.
titlestringDisplay name in the console. Defaults to "Untitled".
sourcestringFree-form origin tag, e.g. your service name. Useful for filtering later.
options.copiesintegerNumber of copies, minimum 1. Copies are one job, and bill as one job.
bash
curl -X POST https://rocketprint.io/api/v1/print-jobs \
  -H "X-API-Key: $ROCKETPRINT_KEY" \
  -H "Idempotency-Key: order-1042-label" \
  -H "Content-Type: application/json" \
  -d '{
    "printerId": "6a4738f7462183c7f5d70598",
    "title": "Order #1042 label",
    "contentType": "raw_base64",
    "content": "XlhBLi4uXlha",
    "source": "my-shop",
    "options": { "copies": 1 }
  }'

Idempotency

Send an Idempotency-Key header on every create. It is scoped to your organization and API key, and can be up to 200 characters — derive it from your own order or shipment ID.

  • An identical retry returns 200 with the original job and the header Idempotency-Replayed: true. Nothing prints twice.
  • A different payload under a key you already used returns 409 rather than printing something unexpected.
  • Replays do not count as billable jobs.

The job object

FieldTypeNotes
idstringOpaque job ID. Store it against your own record.
organizationIdstringThe owning organization.
printerIdstringThe target printer.
stationIdstringThe station assigned when the job was created.
statusenumpending, dispatching, sent, printing, completed, failed, canceled. See the state model.
errorstringPresent when status is failed.
idempotencyKeystringPresent when the create supplied one.
titlestringAs supplied at creation.
contentTypestringAs supplied at creation.
sourcestringAs supplied at creation.
createdAtdate-timeWhen we accepted and persisted the job.
sentAtdate-timeWhen it was delivered to the agent.
completedAtdate-timeWhen the agent reported the outcome.

List and fetch jobs

GET /v1/print-jobs returns jobs newest first under a printJobs key.

QueryTypeNotes
statusenumFilter to one status.
printerIdstringFilter to one printer.
limitintegerDefault 50, maximum 200.

Cancel a job

DELETE /v1/print-jobs/:id cancels a job that is still pending. Once dispatched, a job is no longer cancelable and the request returns 409.

Printers

GET /v1/printers lists everything your agents have registered.

FieldTypeNotes
idstringUse this as printerId when creating jobs.
namestringDisplay name.
systemNamestringThe OS queue name on the station.
statusenumonline or offline.
stationIdstringThe station that owns this queue.
isDefaultbooleanWhether it is the station's default printer.
agentNamestringAgent identifier.
agentHostnamestringHostname of the station machine.
lastSeenAtdate-timeLast presence report.

A printer being offline does not mean you cannot print to it — jobs queue and dispatch when it returns.

OpenAPI

The public API is described by an OpenAPI 3.1 document, which you can use to generate a client or load into your own tooling. It is the same description this page is written from.

Handling failures?

Every error code, what causes it, and what to do about it.

Errors and limits