Skip to content

Conventions

Requests

  • Send JSON with content-type: application/json. A body that is not valid JSON answers 400 {"error":"invalid_json"}.
  • Field names are as the reference shows them: request bodies mostly use camelCase (projectId), and response rows use the stored snake_case names (project_id). Leave requests use snake_case in both directions.
  • Unknown fields in a request body are ignored, except on leave requests, which answer 400 for them. Identity and state fields (ids, tenant, status, creator) are always set by the server, never taken from the request.

Errors

An error answers a 4xx or 5xx status with a JSON body carrying a machine-readable code:

{ "error": "forbidden", "permission": "crm:company:create" }

Match on error, never on a message. Extra fields carry details for the code, such as product, permission, reason or retry_after. The error codes page lists every code with its meaning.

A request that fails validation answers 400 with a different body, which names each problem:

{
"success": false,
"error": {
"name": "ZodError",
"message": "[{\"code\":\"invalid_format\",\"format\":\"email\",\"path\":[\"email\"],\"message\":\"Invalid email address\"}]"
}
}

error.message is a JSON array; parse it to show which field was wrong (path).

Status Meaning What to do
400 Invalid input Fix the request; do not retry as is.
401 unauthorized: missing, wrong or revoked key Check the X-API-Key header.
402 product_not_entitled, product_read_only or tier_required The workspace lacks the product or plan. See Products.
403 forbidden (often with permission), or a rule about this record Your roles do not allow it.
404 not_found and specific codes such as project_not_found The record does not exist in this workspace, or you cannot see it.
409 A conflict, for example approval_conflict or entry_finalized Re-read the record, then decide whether to try again.
413 too_large, quota_exceeded The file is too big, or the workspace is out of storage.
429 too_many_requests with retry_after (seconds) Wait that long, then retry.
5xx internal_error Retry with backoff.

The Project task endpoints are RPC procedures and wrap errors in their own envelope: {"json":{"code":"NOT_FOUND","status":404,"message":"not_found"}}. The HTTP status is the same; read the code from json.message.

Lists and paging

Most list endpoints take the same query parameters and answer the same shape:

Parameter Meaning
page 1-based page number. Default 1.
pageSize Rows per page, 1 to 100. Larger values are clamped to 100, not rejected. Default 20.
search Free-text filter. Only the first 200 characters count.
sort A sort key the endpoint names in the reference. Unknown keys fall back to its default.
dir asc or desc (default).
{ "items": [ ... ], "total": 87, "page": 2, "pageSize": 20 }

To read everything, request pages of 100 until page * pageSize >= total. Junk paging values never fail: page=abc is read as page 1.

A few lists differ, and their reference pages say so:

  • Time entries (GET /api/timesheets) page with limit (up to 500, default 50) and offset, and answer { "entries": [...], "total", "limit", "offset" }.
  • Notifications return the 50 newest, with no paging.
  • The approval inbox takes limit (up to 100, default 50).
  • Timesheets projects, leave types, leave peers and expense categories return the whole list.

Dates and times

  • Timestamps are epoch milliseconds (UTC), for example "created_at": 1794050942065. This covers created_at, started_at, issued_at, expectedCloseAt and every other time field, in requests and responses.
  • Calendar days are YYYY-MM-DD strings where a day is meant rather than a moment: leave requests (start_date, end_date) and the dateFrom and dateTo filters of time entries and expenses. Leave requests come back with those days as epoch milliseconds at UTC midnight.
  • Durations are whole minutes (durationMinutes, duration_minutes).

Money

Amounts are integers in minor units (hundredths) of their currency, with the currency as an ISO 4217 code next to them: "total_cents": 8500000, "currency": "IDR" is Rp 85.000, and "amount_cents": 125050, "currency": "USD" is $1,250.50. This applies to every currency, including IDR. Never send decimals.

Retries and conflicts

There are no idempotency keys. Make writes safe to repeat this way:

  • Contacts are unique by email. Posting an email that already exists answers 200 with the existing contact instead of creating a second one, so a retried contact sync is harmless.
  • Look before you write for other records: search for what you are about to create (for example a ticket with the same title from your monitoring alert) before creating it.
  • Approvals are protected against double decisions. Two people deciding the same task, or the same call sent twice, cannot both win: the second answers 409 {"error":"approval_conflict"}. Re-read the inbox and move on.
  • Finalised records are locked. Approved or invoiced time entries and submitted expenses answer 409 (entry_finalized, locked, invalid_transition) instead of changing.

Limits

  • The v1 endpoints have no per-key rate limit today. Keep to a few requests per second per key and back off on 429 and 5xx anyway: sign-in and AI endpoints already rate-limit, and limits may be added to others.
  • Uploads (receipt capture) accept files up to 25 MB and count toward the workspace’s storage.
  • Text filters (search) use the first 200 characters.