Skip to main content
API requests are authenticated with a Bearer token:
The apf_live_ prefix identifies these as AutoPrintFarm production keys. It also lets GitHub’s secret scanning flag accidental commits.

Creating a key

Only owners and admins can mint API keys.
  1. Open Settings → API Keys in the dashboard.
  2. Click Create API Key.
  3. Enter a descriptive name (e.g. warehouse-dashboard-prod).
  4. Choose the scopes you need:
    • read — list/fetch any resource
    • write — create, update, and delete data
    • control — physical printer actions (start, pause, stop, heaters, light, filament)
  5. Click Create key.
The full key is shown exactly once after creation. AutoPrintFarm only stores its SHA-256 hash, so we can’t recover it for you. Copy it immediately into your secret manager.

Using a key

Send the key in the Authorization header on every request:
Terminal
JavaScript
Python

Scopes

Each request checks for the scope the endpoint requires. A key without the right scope gets 403 INSUFFICIENT_SCOPE. Keys can hold any combination of scopes. Grant only what you need.

Revoking a key

Open Settings → API Keys and click the trash icon on a row. Revocation is immediate — the next request using that key returns 401 TOKEN_REVOKED. If you think a key may have leaked, revoke it and mint a new one. There is no rotation flow — just create + revoke.

Error codes