API conventions
These rules apply to every endpoint under https://<your-instance>/api/v1.
Authentication
Every request carries the key in the header Authorization: Bearer hek_…. Keys work only under /api/v1. A key belongs to exactly one company or Mandant; routing hints such as X-Mandant are ignored.
Formats
- JSON in
snake_case. - Money is a decimal number as text (
"1250.50") and always comes with acurrencyfield ("CHF"). - Dates:
YYYY-MM-DD. - Timestamps: ISO 8601 in UTC with offset, for example
2026-11-04T10:00:00+00:00. As input, a timestamp without an offset counts as UTC. - IDs are UUID strings.
- Updates are
PATCHonly. There is noPUT. Fields you do not send stay unchanged.
Lists and paging
List endpoints respond like this:
{ "data": [ … ], "next_cursor": "eyJ1Ijog…" }| Parameter | Meaning |
|---|---|
limit | Entries per page. Default 50, at most 200. |
cursor | The next_cursor value of the previous response. When next_cursor is null, that was the last page. |
updated_since | Only entries changed at or after this time. |
Treat the cursor as opaque text: do not parse or build it. An invalid cursor gives 400 with invalid_cursor, an unreadable timestamp 400 with invalid_timestamp.
Fetching changes
To synchronise, remember the time of your last fetch and ask with updated_since=<time> for what is new or changed. For the overlap, subtract 5 minutes from the time of your last fetch (last fetch at 10:00, next query with updated_since = 09:55) and drop entries you already have by their id. That way you miss no change written while your last fetch ran.
Archived companies stay in the list (with archived_at set) so you can see the archival.
Deletion lists
Deleted entries disappear from the lists. So that you still learn about deletions, each resource has a deletion list (for example GET /api/v1/crm/contacts/deleted?since=…). The parameter since is required. The response holds id and deleted_at.
Deletion lists are kept for 90 days. Poll at least that often or you miss deletions.
Idempotency
POST requests accept the header Idempotency-Key with a unique value of your choice (for example a UUID). If you repeat the same request with the same value, you get the stored response and nothing is created twice. This holds for 4xx error responses too. After a 5xx error, a retry runs again. The same value with a different request gives 409 with idempotency_key_reused.
Retry only after the first attempt has answered. Two simultaneous requests with the same value can both run; the protection covers retries after a response only.
The value is kept for 24 hours and per key.
Errors
Every error has the same shape. The message text is in English.
{ "code": "validation_error", "message": "The request is not valid.", "details": [ { "field": "name", "problem": "Field required" } ]}details appears only for validation errors. Rely on code in your code, not on message.
| Status | code | Meaning |
|---|---|---|
| 400 | invalid_cursor | cursor is invalid. Use next_cursor of the previous page. |
| 400 | invalid_timestamp | updated_since or since is not an ISO 8601 timestamp. |
| 401 | invalid_api_key | Key missing, wrong, revoked or expired. |
| 403 | api_access_not_in_plan | The plan does not include API access. |
| 403 | api_access_disabled | API access is switched off for this Mandant. |
| 403 | module_not_enabled | The module is not active or hidden for the key’s role. |
| 403 | no_write_permission | The key may only read in this module. |
| 404 | not_found | The entry does not exist (or does not belong to this key). |
| 405 | method_not_allowed | This method does not exist for the path. |
| 409 | idempotency_key_reused | The Idempotency-Key was used with a different request. |
| 409 | mandant_archived | The Mandant is archived. Writing is not possible. |
| 422 | validation_error | The request is invalid. details names field and problem. |
| 429 | rate_limited | Too many requests. Mind the Retry-After header. |
| 500 | internal_error | Unexpected server error. |
Some endpoints know further 409 codes, listed in the CRM reference (company_archived, tag_name_taken).
Limits
- 120 requests per minute per key. Above that the API answers
429with the headerRetry-After(seconds until you may try again). - At most 10 active keys per company.
- Request log: Hive Engine stores time, method, path (without query), status and duration for 90 days. Headers, bodies and key material are not stored.
Versioning
Within v1 only additions are made: new endpoints, new optional fields, new values in responses. Existing behaviour does not change. Write your client so it ignores unknown fields.
If a version 2 is released, v1 stays available for at least 12 months after that.