Get Started

Get Started

This guide gets you from zero to your first successful print job.

1. Base URL

Use your production domain:

https://api.printbase.cloud

2. Register and Login (Web users)

Register:

curl -X POST https://api.printbase.cloud/v1/auth/register \
  -H "Content-Type: application/json" \
  -d '{
    "email":"admin@example.com",
    "password":"Passw0rd!",
    "name":"Admin",
    "organization_id":"org_default"
  }'

Login:

curl -X POST https://api.printbase.cloud/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email":"admin@example.com","password":"Passw0rd!"}'

Save the returned token and use it in Authorization: Bearer <TOKEN>.

3. Create an API key for server-to-server calls

curl -X POST https://api.printbase.cloud/v1/api-keys \
  -H "Authorization: Bearer <USER_JWT>" \
  -H "Content-Type: application/json" \
  -d '{"name":"backend-service"}'

4. Connect an Agent

Run an agent binary on a local machine:

PRINTBASE_API_KEY=pb_live_xxx ./agent-darwin-arm64

The agent registers the computer, reports printers, and opens a WebSocket.

5. Create your first print job

curl -X POST https://api.printbase.cloud/v1/print-jobs \
  -H "Authorization: Bearer pb_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "printer_id":"printer_123",
    "content_type":"pdf",
    "content":"JVBERi0xLjQK...",
    "copies":1,
    "options":{"duplex":false}
  }'

Expected response:

{ "id": "job_xxx", "status": "queued" }
Get Started