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

# API access

> Mint an API key and make your first call.

The PRINTOOLS API lets another system read and write your shop's data: pushing orders in from a storefront, pulling jobs into a dashboard, syncing invoices out to accounting.

## Mint a key

**Settings → API → New key.** Name it after the thing that will use it, pick the scopes it needs, and copy the key immediately.

<Warning>
  The key is shown once. It is stored as a hash, so nobody can recover it later, not you and not support. If you lose it, revoke it and mint a replacement.
</Warning>

Scopes are fixed when the key is minted. To change what a key can do, mint a new one and revoke the old. The list shows each key by its first twelve characters so you can tell them apart.

## Grant the least it needs

A `read` scope reads. A `write` scope creates, updates **and deletes**, so `quotes.write` includes deleting quotes.

Three actions sit outside `write` so you can grant the ordinary work without the dangerous part:

| Scope             | What it allows                                |
| ----------------- | --------------------------------------------- |
| `proofs.approve`  | Approving artwork on the customer's behalf    |
| `invoices.settle` | Marking money as received, voiding, refunding |
| `invoices.sync`   | Pushing invoices into your accounting system  |

## Make your first call

Every request carries two headers: the key, and the organisation the key belongs to.

```bash theme={"dark"}
curl https://api.printools.io/v1/me \
  -H 'X-API-Key: pk_live_...' \
  -H 'X-Printtools-Organization-Id: <your org id>'
```

`GET /v1/me` needs no scope, so it works with any valid key. It returns your org, the credential, and the scopes it was granted, which is the fastest way to confirm a key is live.

## Then

<CardGroup cols={2}>
  <Card title="API introduction" icon="code" href="/api/introduction">
    Base URLs and how the API relates to the app.
  </Card>

  <Card title="Authentication" icon="lock" href="/api/authentication">
    Headers, and the four reasons a 401 happens.
  </Card>
</CardGroup>
