> ## Documentation Index
> Fetch the complete documentation index at: https://docs.autoprintfarm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AutoPrintFarm API

> Read-only access to your print farm — printers, jobs, and inventory — over a REST API scoped to your account.

The AutoPrintFarm public API lets external tools, scripts, and dashboards read
live data from your print farm. Every request is authenticated with an
API key you mint from the dashboard, and every response comes wrapped in a
predictable `{ success, data }` envelope.

<CardGroup cols={3}>
  <Card title="Printers" icon="print" href="/api-reference/overview">
    Fleet status, firmware versions, and connection health for every printer.
  </Card>

  <Card title="Jobs" icon="list-check" href="/api-reference/overview">
    The queued, active, and historical print jobs across your farm.
  </Card>

  <Card title="Inventory" icon="boxes-stacked" href="/api-reference/overview">
    Finished-goods stock levels by SKU, color, and material.
  </Card>
</CardGroup>

## Base URL

```
https://api.autoprintfarm.com/public/v1
```

## Quick start

<Steps>
  <Step title="Create a key">
    Open **Settings → API Keys** in the [dashboard](https://app.autoprintfarm.com/settings),
    click **Create API Key**, and pick the scopes you need.
  </Step>

  <Step title="Copy it once">
    The full key is shown exactly once. AutoPrintFarm only stores the SHA-256
    hash, so save it to your secret manager immediately.
  </Step>

  <Step title="Make your first request">
    Send the key as a Bearer token on every request:

    <CodeGroup>
      ```bash Terminal theme={null}
      curl -H "Authorization: Bearer apf_live_xxx..." \
        https://api.autoprintfarm.com/public/v1/printers
      ```

      ```javascript JavaScript theme={null}
      const res = await fetch("https://api.autoprintfarm.com/public/v1/printers", {
        headers: { Authorization: `Bearer ${process.env.APF_API_KEY}` },
      });
      const { data } = await res.json();
      ```

      ```python Python theme={null}
      import os, requests
      r = requests.get(
          "https://api.autoprintfarm.com/public/v1/printers",
          headers={"Authorization": f"Bearer {os.environ['APF_API_KEY']}"},
      )
      r.raise_for_status()
      print(r.json()["data"])
      ```
    </CodeGroup>
  </Step>
</Steps>

## Scopes

| Scope     | What it grants                                                                                                         |
| --------- | ---------------------------------------------------------------------------------------------------------------------- |
| `read`    | Every `GET` — printers, jobs, inventory, orders, products, files, hubs, assembly, materials, wiki, worklist, analytics |
| `write`   | Data mutations — create, update, delete, uploads, fulfillment, job enqueue/patch/retry/complete                        |
| `control` | Physical printer commands — start, pause, resume, stop, heaters, light, filament                                       |

See [Authentication → Scopes](/authentication#scopes) for the per-scope breakdown.

## Response envelope

Every successful response is wrapped:

```json theme={null}
{
  "success": true,
  "data": [ /* ... */ ]
}
```

Errors use the same shape with `success: false` plus `code` and `error` fields:

```json theme={null}
{
  "success": false,
  "code": "INSUFFICIENT_SCOPE",
  "error": "API key missing required scope: read"
}
```

See [Authentication → Error codes](/authentication#error-codes) for the full
list of codes and their HTTP statuses.

## Next steps

<CardGroup cols={2}>
  <Card title="Authentication" icon="key" href="/authentication">
    How to create, use, and revoke API keys — plus the full error code table.
  </Card>

  <Card title="Rate limits" icon="gauge-high" href="/rate-limits">
    Per-key request budgets and how to read the `X-RateLimit-*` headers.
  </Card>

  <Card title="API Reference" icon="code" href="/api-reference/overview">
    Endpoint-by-endpoint reference generated from the OpenAPI spec.
  </Card>

  <Card title="OpenAPI spec" icon="file-code" href="/api-reference/openapi.json">
    Machine-readable spec you can feed into your own SDK generator.
  </Card>
</CardGroup>
