Conventions
Base URL and versioning
REST operations live under https://api.filemark.ca/api/v1; the MCP server is https://api.filemark.ca/mcp. Both are HTTPS only.
Changes within v1 are additive. The OpenAPI schema is the published contract; its info.version rises when operations or fields are added, and a CI gate blocks removals and narrowings of published operations, parameters, request bodies, responses, and response headers. Computation targets version their strict schemas separately through payloadSchemaVersion; see Pin a strict contract.
There is no separate test environment. Every request reads your live workspace, and the API is read-only, so no call can change it; the batch and rollover computations read no workspace data at all. Filemark publishes no client libraries; generate one for your language from the OpenAPI schema.
Requests
- Send the access token as
Authorization: Bearer <access-token>. - Bodies are JSON with
Content-Type: application/json. The token endpoint alone takesapplication/x-www-form-urlencoded. - Path and query parameters are
snake_case(client_id,year_end); JSON fields arecamelCase(yearEnd). - A body may be up to 16 MiB on
/api/v1and/mcp, and up to 256 KiB at the token endpoint. A larger body is rejected with413before it reaches the API.
Responses
- Bodies are JSON. Collection reads return
dataandpagination; computations return the envelope described under Run computations. - Failures return
requestIdand anerrorobject withcodeandmessage; see error codes. - IDs are UUID strings.
- Timestamps are ISO-8601 in UTC, for example
2026-07-14T12:00:00Z. Dates areYYYY-MM-DD. - Money in the saved tax-data reads (trial balance, accounts, adjustments) is an exact decimal string, for example
"125000.5"or"-4200", never a float; those reads report debits as positive and credits as negative. Computation inputs and results carry money as JSON numbers; see each target's cells in the computation reference. - Enumerations are lowercase strings,
snake_caseexcept the documentkindvalues, which are kebab-case. Each enum's members are listed inline in the REST reference. nullmeans unknown or not applicable for that record.
Response headers
| Header | Sent on | Meaning |
|---|---|---|
X-Request-Id | Every /api/v1 response | Opaque request identifier. Quote it when you report a failed request. MCP carries the same identifier in the tool result's _meta["ca.filemark/requestId"] and in the error envelope's requestId. |
WWW-Authenticate | 401, 403 | Bearer when no credential was presented, Bearer error="invalid_token" when a token was refused, and Bearer error="insufficient_scope", scope="..." when a valid token lacks a scope; the scope parameter lists what the operation requires. |
Retry-After | 429, 503 | Seconds to wait before retrying. |
X-RateLimit-Limit, X-RateLimit-Remaining | 429 | The exhausted budget's window size and the requests left in it. |
Retries
Every operation is read-only or stateless, so any request can be retried. On 429 and 503, wait the Retry-After seconds first. Retries count against the same request budgets as first attempts.