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

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):

EndpointsWhat they do
GET/POST /document-templates, GET/PATCH /document-templates/{id}, POST /document-templates/preview, POST /document-templates/{id}/duplicate, .../archive, .../unarchivedocument templates
GET/POST /documents, GET/PATCH/DELETE /documents/{id}, GET /documents/{id}/previewdocuments and drafts
POST /documents/{id}/finalize, POST /documents/{id}/sendfinalize, e-mail the PDF; both need {"confirm": true}
POST /documents/{id}/statussent, signed, declined or void
GET /documents/{id}/pdf, POST/GET /documents/{id}/signed-filethe PDF; upload (multipart file, PDF/JPG/PNG up to 10 MB) or download a signed scan
POST /documents/{id}/invoicesdraft 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-onboardingstart client onboarding, its progress, the overview of all clients

Time tracking over REST

All paths start with /api/v1/orgs/{orgId} (time tracking):

EndpointsWhat they do
GET/POST /projects, GET/PATCH /projects/{id}, POST /projects/{id}/archive, .../unarchiveprojects: 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/unbilledunbilled hours per client and project, with estimated amounts
POST /time/invoice-preview, POST /time/invoicespreview the lines and totals; create the draft invoice from unbilled entries
GET /time/timesheet.pdf, GET /invoices/{id}/timesheet.pdfthe 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).

Related articles

See how it works