These conventions apply to every endpoint in this API. Individual endpoint pages describe only what is specific to that resource.
The API uses OAuth 2.0. Obtain an access token from the token endpoint using the client_credentials grant, then send it on every request in the HTTP Authorization header as a bearer token:
Authorization: Bearer <your-access-token>
The client_id is the configured OAuth client and the client_secret is the matching user's password; they may be sent in the request body or as HTTP Basic credentials. While a token is valid a licenced user session is held, so release it when you are finished by calling the logoff endpoint. A request with a missing, invalid or expired token is rejected with 401 Unauthorized. A valid token is rejected with 403 Forbidden when it lacks the required scope, when no licence is available, or when the Jim2 user's security group withholds a right needed by the field being changed - see the endpoint page for the rights that guard its individual fields. See the token endpoint page for the supported scopes and a worked example.
When a request fails, the HTTP status code carries the outcome and the response body is a JSON:API error document: a top-level errors array. Each entry may contain a status (the HTTP status code as a string), a title (a short summary) and a detail (a human-readable explanation). Fields that are empty are omitted.
{
"errors": [
{
"status": "400",
"title": "Bad Request",
"detail": "The attribute 'DateDue' is not a valid ISO date/time."
}
]
}
The status codes you are most likely to encounter are:
| Status | Meaning | |
|---|---|---|
| 200 OK | The request succeeded. | |
| 400 Bad Request | The request body or a query parameter was malformed or failed validation. | |
| 401 Unauthorized | The bearer token is missing, invalid or expired. | |
| 403 Forbidden | Authenticated, but the request is not permitted: the token lacks the required scope, no licence is available, or the Jim2 user's security group withholds a right needed by the field being changed. See the endpoint page for the rights that guard individual fields. | |
| 404 Not Found | The endpoint or the requested resource id does not exist. | |
| 405 Method Not Allowed | The HTTP method is not supported by this endpoint. | |
| 406 Not Acceptable | The Accept header does not allow a supported media type. |
A failed write stores nothing. Every POST, PATCH and DELETE is applied inside a single transaction that is committed only once the whole request has succeeded, so a request that comes back with an error leaves the stored resource exactly as it was. This holds however far into the request the failure happens: a body that sets twenty attributes and is rejected on the twentieth stores none of the other nineteen. A batch sent to api/v1/operations behaves the same way across the whole batch — either every operation in it is applied, or none is.
This applies to the JSON:API endpoints (eg api/v1/jobs, api/v1/invoices), which do not currently support the JSON:API page, sort or fields query parameters — a JSON:API collection endpoint returns every record that matches and the response is not paged. To keep responses manageable, narrow the result set with filters (see Resource Filtering) rather than relying on paging, and request only the includes you need — the include parameter is not supported on list endpoints at all (it is ignored there; use the single-resource endpoint to embed related resources). The api/v1/list/* endpoints below are a separate family with their own, different paging model.
The api/v1/list/* endpoints (eg api/v1/list/jobs, api/v1/list/gl/accounts) are a separate family built for pulling large result sets to completion without a server- or consumer-side timeout. Each item is returned as a flat JSON object (plain key/value pairs), not a JSON:API resource with type/attributes/relationships. Every endpoint in this family shares the same response envelope:
{
"success": true,
"data": [ { "field": "value", ... }, ... ],
"nextCursor": "<opaque string, or null on the last page>",
"highWaterMark": "<datetime, or null>",
"maxrows": 100
}
Request up to maxrows rows at a time (default 100, hard cap 1000 — a higher value is silently clamped to the cap, not rejected). If more rows match, nextCursor is an opaque token: pass it back as the cursor query parameter to fetch the next page, in the same order, with no gaps or duplicates. nextCursor is null once you have the last page. There is no page/offset parameter and no totalCount — paging is by cursor only, so performance does not degrade on deep pages.
highWaterMark is a server-captured cutoff timestamp, present on endpoints that support incremental sync via a lastModified filter (check the individual endpoint page for whether that filter is registered) — re-supply it as the lower bound on your next pull to fetch only what changed. Some endpoints (eg reference/setup data with no last-modified column, such as the chart of accounts) do not support incremental sync at all, in which case a full pull each time is the intended model even though highWaterMark may still be present in the envelope; on those endpoints treat it as unused rather than assuming null means "not supported".
A run that supplies a lastModified range filter (-gte or -gt) enters incremental sync mode: every subsequent page of that run must re-supply the same lastModified lower-bound filter alongside the cursor — a cursor from a sync run supplied without it returns 400. Only -gte, -gt, -lte and -lt are accepted on lastModified; bare equality (no operator) and any other operator (eg -like, -in) return 400. Supplying only an upper bound (-lte or -lt) does not enter sync mode, so its cursor pages without needing the filter re-supplied. A malformed timestamp on any date filter returns 400 before any rows are read.
The include parameter is supported only on the list/* endpoints that declare an Includes section on their own page (eg api/v1/list/jobs, api/v1/list/pos) - each requested name adds a nested array of that sub-item's rows to every top-level record, in one round trip instead of a separate call. On any list/* endpoint with no Includes section (including every sub-item endpoint itself, eg api/v1/list/job/stock), include is not supported and is silently ignored. Narrow what comes back with filters either way (see Resource Filtering) — each endpoint page lists its own supported filters, response fields, and includes.