# API keys and the REST API

Create an API key at Settings → API & agents → Create key (Pro plan) and call the REST API at /api/v1 with an Authorization: Bearer header. A key shows once.

You create an API key at Settings → **API & agents** → **API keys**, and call the REST API under `/api/v1` with an `Authorization: Bearer inv_…` header; the feature is part of the Pro plan.

**Where to find it:** Settings → **API & agents** → the **API keys** section. Owners and admins manage keys.

![Create API key dialog with Name, Role, Expiry and scopes](https://guilder-desk.dev/help/en/api-keys.png)

## Steps

1. Open **Settings** → **API & agents** → **API keys** and click **Create key**.
2. Enter a **Name**, for example "Accounting sync".
3. Choose the **Role**. A key cannot have a role above your own.
4. Set the **Expiry** (a number of days or never) and the scopes: **Read**, **Write**, **Send to KSeF**, **Manage organization**.
5. Click **Create key**. In the "Copy your API key" dialog copy the key and click **I have copied it**. This is the only time you see it in full.
6. Call the API with the key in the header:

```
curl -H "Authorization: Bearer inv_..." https://YOUR-DOMAIN/api/v1/orgs/{orgId}/invoices
```

You can use the `x-api-key` header instead of `Authorization`.

## Client documents over REST

All paths start with `/api/v1/orgs/{orgId}` ([client documents](https://guilder-desk.dev/en/help/clients-and-products/client-documents)):

| Endpoints | What they do |
|---|---|
| `GET/POST /document-templates`, `GET/PATCH /document-templates/{id}`, `POST /document-templates/preview`, `POST /document-templates/{id}/duplicate`, `.../archive`, `.../unarchive` | document templates |
| `GET/POST /documents`, `GET/PATCH/DELETE /documents/{id}`, `GET /documents/{id}/preview` | documents and drafts |
| `POST /documents/{id}/finalize`, `POST /documents/{id}/send` | finalize, e-mail the PDF; both need `{"confirm": true}` |
| `POST /documents/{id}/status` | sent, signed, declined or void |
| `GET /documents/{id}/pdf`, `POST/GET /documents/{id}/signed-file` | the PDF; upload (multipart `file`, PDF/JPG/PNG up to 10 MB) or download a signed scan |
| `POST /documents/{id}/invoices` | draft invoice from a statement of work |
| `GET/POST/PATCH /clients/{id}/checklist`, `PATCH /clients/{id}/checklist/items/{itemId}` | the client's checklist and ticking a step |
| `GET/POST /clients/{id}/onboarding`, `GET /client-onboarding` | start client onboarding, its progress, the overview of all clients |

## Time tracking over REST

All paths start with `/api/v1/orgs/{orgId}` ([time tracking](https://guilder-desk.dev/en/help/clients-and-products/time-tracking)):

| Endpoints | What they do |
|---|---|
| `GET/POST /projects`, `GET/PATCH /projects/{id}`, `POST /projects/{id}/archive`, `.../unarchive` | projects: rate, VAT, rounding, budget |
| `GET/POST /time-entries`, `PATCH/DELETE /time-entries/{id}` | the hours ledger (`minutes` 1 to 1440); a response carries the project's budget status; entries on an invoice return 409 |
| `GET /time/unbilled` | unbilled hours per client and project, with estimated amounts |
| `POST /time/invoice-preview`, `POST /time/invoices` | preview the lines and totals; create the draft invoice from unbilled entries |
| `GET /time/timesheet.pdf`, `GET /invoices/{id}/timesheet.pdf` | the timesheet PDF for a period or for an invoice (`locale`, `download=1`) |

## Tips

- Docs: **REST API docs** on this page, the OpenAPI 3.1 spec at `/api/v1/openapi.json`, the page at `/api/v1/docs`.
- A key's permissions are the intersection of its role and scopes. Issuing needs the Write scope, sending to KSeF needs Send to KSeF.
- Errors carry a readable code (for example `validation`, `limit_reached`, `rate_limited`). On a 429 read the `Retry-After` header.
- If you lose a key, **Revoke** it and create a new one. Keep keys in a secrets manager.
- Without the Pro plan the section tells you API access is part of Pro ([plans](https://guilder-desk.dev/en/help/team-and-billing/plans-and-billing)).

*Updated 2026-11-21*
