Conventions
Envelopes, paging, amounts, dates and versioning across the API.
Requests and responses
- JSON in, JSON out: send
Content-Type: application/jsonwith a body. - A single record comes as
{"data": {…}}, a list as{"data": […], "meta": {…}}. The key figures (GET /api/v1/reports/key-figures) are the one exception: they are the response itself. - IDs are strings with a prefix that names the kind:
cli_…for a client,inv_…for an invoice.
Paging
Lists take page (from 1) and page_size and answer with:
{ "meta": { "page": 2, "page_size": 50, "total": 121, "total_pages": 3 } }Request pages until page reaches total_pages.
Amounts and dates
- Money is an exact decimal string, never a float:
"1234.50". Send amounts the same way. Currencies are ISO 4217 codes ("CHF"). - Dates are
YYYY-MM-DDin the workspace's time zone; timestamps are RFC 3339 in UTC.
Versioning
The API lives under /api/v1. Within v1, changes are only additive: new operations, new optional fields and
new fields in responses. Ignore fields you do not know rather than failing on them.