API Documentation
The machine readable contract is the OpenAPI 3.1 document served by the API:
The machine-readable contract is the OpenAPI 3.1 document served by the API:
- Interactive docs:
https://accounts.kintconsult.com/api/v1/docs - JSON:
https://accounts.kintconsult.com/api/v1/openapi.json
The OpenAPI document is generated from the same Zod schemas that validate requests, so it cannot drift from the implementation. This page explains the conventions that apply to every endpoint.
1. Base URL and versioning
All endpoints live under /api/v1. Within v1, changes are additive only: new endpoints, new optional fields, new enum values in responses. Removing or renaming a field, or changing its meaning, requires /api/v2, with v1 kept running for an announced deprecation period.
2. Envelope
// Success (single resource)
{ "data": { "id": "0193…", "email": "[email protected]" } }
// Success (list)
{ "data": [ … ], "meta": { "page": 1, "pageSize": 25, "total": 112, "totalPages": 5 } }
// Error
{ "error": { "code": "VALIDATION_FAILED", "message": "The request contains invalid data.",
"details": [ { "location": "body", "path": "email", "message": "Invalid email address" } ],
"requestId": "5f0c…" } }
204 No Contentresponses have no body.- Money is always a decimal string with two decimals (
"1500000.00"), never a JSON number. Clients must not do authoritative arithmetic with floating point. - Timestamps are ISO 8601 in UTC (
2026-11-27T10:15:00.000Z). Accounting dates (from Phase 2) areYYYY-MM-DD. - Identifiers are UUIDs. Human-readable document numbers (
KINT/INV/2026/0001) are separate fields. - Internal fields (password hashes, token hashes, MFA secrets) never appear in responses; response schemas are allow-lists.
3. Errors
| HTTP | code |
Meaning |
|---|---|---|
| 400 | VALIDATION_FAILED |
Body, query or path parameters are invalid; see details. |
| 401 | UNAUTHENTICATED |
No valid session (missing, expired, revoked). |
| 401 | INVALID_CREDENTIALS |
Sign-in failed. Deliberately generic. |
| 403 | FORBIDDEN |
Authenticated but lacking the required permission. |
| 403 | CSRF_REJECTED |
Missing/invalid X-CSRF-Token, or a foreign Origin. |
| 403 | PASSWORD_CHANGE_REQUIRED |
The user must change a temporary password first. |
| 403 | MFA_ENROLMENT_REQUIRED |
The organisation requires two-factor; set it up at /auth/mfa/setup. |
| 401 | MFA_CODE_INVALID, MFA_CHALLENGE_INVALID |
Wrong two-factor code; or the sign-in challenge expired (sign in again). |
| 404 | NOT_FOUND, ROUTE_NOT_FOUND |
Resource or route does not exist (or is in another organisation). |
| 409 | CONFLICT, EMAIL_IN_USE, ROLE_IN_USE, … |
Conflicts with existing data. |
| 413 | PAYLOAD_TOO_LARGE |
Body over 1 MiB (2 MiB for statement imports, 10 MiB for attachments). |
| 415 | UNSUPPORTED_MEDIA_TYPE |
Attachment of a type other than PDF, PNG, JPEG or WebP. |
| 409 | IDEMPOTENCY_IN_PROGRESS |
A request with the same Idempotency-Key is still running. |
| 422 | business-rule codes, e.g. LAST_ADMINISTRATOR, TIN_REQUIRED, PASSWORD_POLICY |
Valid request that a business rule rejects. |
| 422 | IDEMPOTENCY_KEY_REUSED |
The Idempotency-Key was used before with a different request body. |
| 429 | RATE_LIMITED |
Too many requests; retry later. |
| 500 | INTERNAL_ERROR |
Unexpected failure; quote requestId when reporting. |
| 503 | EMAIL_NOT_CONFIGURED |
Email is not set up on this installation. |
Every response carries an X-Request-Id header. Clients may send their own X-Request-Id (8–64 characters of A–Z a–z 0–9 . _ -), and it is used for log and audit correlation.
4. Pagination, filtering and search
List endpoints accept page (default 1) and pageSize (default 25, maximum 100), and return meta. Filters are explicit query parameters documented per endpoint (e.g. status, roleId, from, to). search is a case-insensitive free-text match on the fields named in each endpoint's description.
5. Authentication
5.1 Browser sessions (web interface)
POST /api/v1/auth/loginwith{ "email", "password" }.- The response sets two cookies:
__Host-kint_session(development:kint_session) —HttpOnly; Secure; SameSite=Lax; Path=/. Opaque session token.__Host-kint_csrf(development:kint_csrf) — readable by the page.
- Every
POST,PUT,PATCHorDELETEmust send the CSRF cookie's value in theX-CSRF-Tokenheader. Requests with a foreignOriginheader are rejected. - Sessions expire after inactivity (default 30 minutes) and at an absolute limit (default 12 hours), and are revoked by logout, password change, password reset and user deactivation.
- If
user.mustChangePasswordis true, only/auth/me,/auth/change-passwordand/auth/logoutare allowed until the password is changed. - Two-factor authentication (ADR-0012). For a user with two-factor on,
POST /auth/loginreturns 202{ data: { mfaRequired: true, challenge, expiresAt } }and sets no cookies. SendPOST /auth/mfa/verifywith{ challenge, code }(a 6-digit authenticator code, or a recovery code) within five minutes to receive the session as in step 2. A challenge allows five attempts; wrong codes count toward the account lockout. When the organisation requires two-factor, a user without it receives403 MFA_ENROLMENT_REQUIREDfor everything except/auth/*. - Forgotten password (when email is configured;
GET /auth/optionssays whether it is).POST /auth/password-resetwith{ email }always answers 202 with the same message. The emailed link ishttps://…/reset-password#token=…; the page sendsPOST /auth/password-reset/completewith{ token, newPassword }. Links work once, for 30 minutes; a new request cancels the older link; at most three per person per hour. Completing a reset signs the person out everywhere; two-factor still applies at the next sign-in.
# Example with curl (development)
curl -c jar -H 'content-type: application/json' \
-d '{"email":"[email protected]","password":"…"}' http://localhost:3101/api/v1/auth/login
CSRF=$(awk '$6=="kint_csrf"{print $7}' jar)
curl -b jar http://localhost:3101/api/v1/users?pageSize=10
curl -b jar -H "x-csrf-token: $CSRF" -H 'content-type: application/json' \
-X PATCH -d '{"city":"Kampala"}' http://localhost:3101/api/v1/organisation
5.2 Integration clients (OAuth 2.0 client credentials)
Other systems use their own credentials, never a person's password (ADR-0011). An administrator registers the integration under Administration → Integrations, which creates its service account, then issues client credentials with the scopes it needs. Scopes are permission keys (clients:read, invoices:create, …); administration permissions can never be granted. The client secret is shown once.
Exchange the credentials for a token (RFC 6749 §4.4). HTTP Basic or body parameters; form-encoded or JSON:
curl -u "$CLIENT_ID:$CLIENT_SECRET" -d grant_type=client_credentials -d 'scope=clients:read invoices:read' \ https://accounts.kintconsult.com/api/v1/oauth/token # {"access_token":"kint_at_…","token_type":"Bearer","expires_in":3600,"scope":"clients:read invoices:read"}scopeis optional (default: every scope of the credential) and may only narrow it. Errors follow the RFC:400 unsupported_grant_type,400 invalid_scope,401 invalid_client(wrong, revoked or expired credentials, or the integration is disabled).Call the API with
Authorization: Bearer <token>. No cookies and no CSRF token. A missing scope gives403 FORBIDDEN; an expired or revoked token gives401 UNAUTHENTICATED(request a new one). Tokens cannot call/auth/*.
Revoking credentials, disabling the integration or narrowing scopes takes effect on the next request. Every request is logged (method, route, status, duration; no bodies) and visible to administrators for 90 days. Actions are audited with actor type integration.
5.3 Idempotency keys
Send Idempotency-Key: <8–100 characters of A–Z a–z 0–9 . _ : -> on any POST or PATCH so that a retry after a timeout never creates a second invoice or payment. For 24 hours, per caller and key:
- the same request again returns the stored response with
Idempotent-Replayed: true; - the same key with a different body returns
422 IDEMPOTENCY_KEY_REUSED; - a duplicate sent while the first is still running returns
409 IDEMPOTENCY_IN_PROGRESS; - server errors (5xx) are not stored, so the request can be retried with the same key.
Use a new key (for example a UUID) for each distinct operation. Browser sessions may use keys too.
6. Rate limits
| Scope | Limit (per client IP) |
|---|---|
| All API routes | 300 requests/minute |
| Integration tokens | 300 requests/minute per token (not per IP) |
POST /auth/login, POST /auth/change-password, /auth/mfa/* |
10 requests/minute |
POST /oauth/token |
30 requests/minute |
| Account lockout | 5 consecutive failures → 15 minutes (configurable) |
Nginx applies an additional limit in production. Exceeding a limit returns 429 RATE_LIMITED. People in one office share an IP address (NAT); raise RATE_LIMIT_PER_MINUTE if a busy office sees 429s. Behind Cloudflare the real client IP comes from CF-Connecting-IP (DEPLOYMENT.md).
7. Endpoints
Phase 1 — foundation
| Method | Path | Permission | Purpose |
|---|---|---|---|
| GET | /health |
public | Liveness |
| GET | /health/ready |
public | Database reachable |
| POST | /auth/login |
public | Sign in |
| POST | /auth/logout |
signed in | Sign out (revokes the session) |
| GET | /auth/me |
signed in | Profile, organisation, effective permissions |
| POST | /auth/change-password |
signed in | Change own password; rotates the session |
| GET | /users |
users:read |
List (search, status, roleId, pagination) |
| POST | /users |
users:manage |
Create; returns a one-time temporary password |
| GET | /users/{id} |
users:read |
Get |
| PATCH | /users/{id} |
users:manage |
Rename, disable or enable |
| PUT | /users/{id}/roles |
users:manage |
Replace roles |
| POST | /users/{id}/reset-password |
users:manage |
New temporary password, sessions revoked |
| POST | /users/{id}/unlock |
users:manage |
Clear a lockout |
| GET | /permissions |
roles:read |
Permission catalogue |
| GET | /roles |
roles:read |
List roles with permissions and user counts |
| POST | /roles |
roles:manage |
Create a custom role |
| GET | /roles/{id} |
roles:read |
Get |
| PATCH | /roles/{id} |
roles:manage |
Update name, description, permissions |
| DELETE | /roles/{id} |
roles:manage |
Delete an unused custom role |
| GET | /organisation |
organisation:read |
Organisation profile |
| PATCH | /organisation |
organisation:manage |
Update profile (base currency is fixed) |
| GET | /settings/tax |
organisation:read |
Tax configuration |
| PUT | /settings/tax |
organisation:manage |
Replace tax configuration |
| GET | /settings/security |
organisation:read |
Session, lockout and password settings |
| PUT | /settings/security |
organisation:manage |
Replace security settings |
| GET | /audit-logs |
audit:read |
Search the append-only audit log |
| GET/PUT | /settings/documents |
read / organisation:manage |
Numbering prefix, default terms, payment instructions, footer, signatory |
| GET/PUT | /settings/approvals |
read / organisation:manage |
Approval rules: quotations, purchase orders, expenses, self-approval |
Phase 2 — sales
| Method | Path | Permission | Purpose |
|---|---|---|---|
| GET | /clients |
clients:read |
List (search name/number/email/TIN, status, type) |
| POST | /clients |
clients:write |
Register; assigns C-0001…; optional primary contact |
| GET | /clients/{id} |
clients:read |
Detail with contacts, outstanding and overdue balances |
| PATCH | /clients/{id} |
clients:write |
Update, or archive/restore via status (never deleted) |
| POST/PUT/DELETE | /clients/{id}/contacts[/{contactId}] |
clients:write |
Manage contact people (exactly one primary) |
| GET/POST | /services |
services:read / services:write |
Catalogue with code, unit, unit price, category |
| GET/PATCH | /services/{id} |
services:read / services:write |
Price changes apply to new documents only |
| GET/POST/PATCH | /service-categories[/{id}] |
services:read / services:write |
Categories |
| GET | /quotations |
quotations:read |
List; status also accepts open and expired |
| POST | /quotations |
quotations:write |
Prepare; numbered KINT/QTN/YYYY/NNNN |
| GET/PUT | /quotations/{id} |
quotations:read / quotations:write |
Get; replace while draft |
| POST | /quotations/{id}/submit |
quotations:write |
Submit for approval (auto-approved below threshold) |
| POST | /quotations/{id}/approve, /return |
quotations:approve |
Approve (segregation of duties) or return with a reason |
| POST | /quotations/{id}/mark-sent |
quotations:write |
Record delivery; stores this revision's PDF |
| POST | /quotations/{id}/accept, /reject |
quotations:write |
Record the client's decision |
| POST | /quotations/{id}/revise, /cancel |
quotations:write |
New revision (snapshot kept) or cancel, with a reason |
| POST | /quotations/{id}/convert |
invoices:write |
Accepted quotation → draft invoice; returns invoiceId |
| GET | /quotations/{id}/pdf |
quotations:read |
PDF (?download=1 for attachment) |
| GET | /invoices |
invoices:read |
List; status also accepts unpaid and overdue |
| POST | /invoices |
invoices:write |
Draft (no number yet) |
| GET/PUT/DELETE | /invoices/{id} |
invoices:read / invoices:write |
Get; replace or delete while draft only |
| POST | /invoices/{id}/issue |
invoices:issue |
Issue: number KINT/INV/YYYY/NNNN, freeze, store PDF |
| POST | /invoices/{id}/mark-sent |
invoices:write |
Record delivery to the client |
| GET | /invoices/{id}/pdf |
invoices:read |
Stored PDF (issued) or DRAFT-watermarked render |
| POST | /invoices/{id}/credit-notes |
credit_notes:issue |
Credit note (full: true or explicit items), ≤ balance |
| GET | /credit-notes/{id}, /credit-notes/{id}/pdf |
invoices:read |
Credit note and its stored PDF |
Detail responses for quotations and invoices include an actions array: the operations the current user may take now, given the document's status, the approval rules and their permissions. Clients should show only these, but the API enforces them independently.
Line items are sent as { serviceId?, description, unit?, quantity, unitPrice, discountPercent? | discountAmount? }, with all numbers as decimal strings. Totals are always computed by the server, and requests that include totals are rejected.
Phase 3 — payments, purchasing, expenses, attachments
| Method | Path | Permission | Purpose |
|---|---|---|---|
| GET | /payments |
payments:read |
Receipts (search, client, status) |
| POST | /payments |
payments:create |
Record a receipt with allocations; KINT/RCT/YYYY/NNNN, PDF stored, posted |
| GET | /payments/{id} |
payments:read |
Detail: allocations, amount on account, journal, actions |
| POST | /payments/{id}/allocations |
payments:create |
Apply money held on account to invoices |
| POST | /payments/{id}/reverse |
payments:reverse |
Reverse with a reason; reopens invoices |
| GET | /payments/{id}/receipt |
payments:read |
Stored receipt PDF |
| GET | /clients/{id}/statement?from&to |
payments:read |
Statement of account from the ledger |
| GET/POST | /suppliers |
suppliers:read / suppliers:write |
Suppliers (S-0001…) with balances owed |
| GET/PATCH | /suppliers/{id} |
suppliers:read / suppliers:write |
Detail; update or archive |
| GET/POST | /purchase-orders |
purchases:read / purchases:write |
Orders KINT/PO/YYYY/NNNN |
| GET/PUT | /purchase-orders/{id} |
purchases:read / purchases:write |
Detail; replace while draft |
| POST | /purchase-orders/{id}/submit, /issue, /close |
purchases:write |
Submit (auto-approved below threshold), issue (PDF stored), close |
| POST | /purchase-orders/{id}/approve, /return |
purchases:approve |
Approve (segregation of duties) or return with a reason |
| POST | /purchase-orders/{id}/cancel |
purchases:write |
Cancel with a reason |
| GET | /purchase-orders/{id}/pdf |
purchases:read |
Stored PDF once issued; DRAFT render before |
| GET/POST | /supplier-bills |
supplier_bills:read / supplier_bills:write |
Bills; status=unpaid for approved and part-paid; a duplicate supplier reference is refused (409) |
| GET/PUT/DELETE | /supplier-bills/{id} |
supplier_bills:read / supplier_bills:write |
Detail; replace or delete while draft |
| POST | /supplier-bills/{id}/approve |
supplier_bills:approve |
Approve and post to payables |
| GET/POST | /supplier-payments |
supplier_bills:read / supplier_payments:create |
Pay approved bills; optional WHT; KINT/PV/YYYY/NNNN voucher |
| GET | /supplier-payments/{id}, /voucher |
supplier_bills:read |
Detail and stored voucher PDF |
| POST | /supplier-payments/{id}/reverse |
supplier_payments:create |
Reverse with a reason; reopens bills |
| GET/POST | /expenses |
expenses:read / expenses:create |
Expenses KINT/EXP/YYYY/NNNN (status, account, dates, search) |
| GET/PUT/DELETE | /expenses/{id} |
expenses:read / expenses:create |
Detail; replace while draft or returned; delete drafts without attachments |
| POST | /expenses/{id}/submit |
expenses:create |
Submit (approved and posted at once below the threshold) |
| POST | /expenses/{id}/approve, /reject |
expenses:approve |
Approve and post, or return with a reason (segregation of duties) |
| GET | /attachments?ownerType&ownerId |
the owner's read permission | Files attached to a record |
| POST | /attachments?ownerType&ownerId&fileName |
the owner's write permission | Upload as the raw body with Content-Type application/pdf, image/png, image/jpeg or image/webp; at most 10 MB; the content must match the type |
| GET | /attachments/{id}/file |
the owner's read permission | Download (SHA-256 verified, nosniff, sandboxed) |
| DELETE | /attachments/{id} |
the owner's write permission | Only while the record is editable; audited; the stored bytes are kept |
Attachment owner types: expense, supplier_bill, purchase_order, supplier_payment, customer_payment, journal, supplier, client.
Allocations are sent as [{ invoiceId, amount }] (receipts) or [{ billId, amount }] (supplier payments). withholdingTax is accepted only when withholding tax is switched on in the tax configuration; otherwise the API returns WHT_DISABLED.
Phase 4 — accounting and banking
| Method | Path | Permission | Purpose |
|---|---|---|---|
| GET | /accounts |
accounts:read |
Chart of accounts with ledger balances |
| POST | /accounts |
accounts:manage |
Add an account or heading |
| PATCH | /accounts/{id} |
accounts:manage |
Rename, move or archive (refused for system accounts or accounts with a balance) |
| GET/POST | /fiscal-years |
periods:read / periods:manage |
Financial years with 12 monthly periods; years must be contiguous |
| POST | /periods/{id}/close, /reopen |
periods:manage |
Close (refused while draft journals exist in it) or reopen with a reason |
| GET/POST | /journals |
journals:read / journals:create |
All journals (status, source, dates, search); create a manual or opening-balance draft |
| GET/PUT/DELETE | /journals/{id} |
journals:read / journals:create |
Detail; edit or delete a draft |
| POST | /journals/{id}/post |
journals:post |
Post: number KINT/JNL/YYYY/NNNN; must balance and fall in an open period |
| POST | /journals/{id}/reverse |
journals:reverse |
Reverse a posted manual or opening-balance journal |
| GET | /ledger/trial-balance?asOf |
accounts:read |
Trial balance |
| GET | /ledger/accounts/{id}?from&to |
accounts:read |
General ledger with opening and running balances |
| GET/POST | /bank-accounts |
banking:read / banking:manage |
Bank, mobile-money and cash accounts with ledger balances |
| GET | /bank-accounts/{id}/cashbook?from&to |
banking:read |
Cashbook (ledger lines with matched flags) |
| POST | /bank-accounts/{id}/statements |
banking:manage |
Import a CSV statement ({ fileName, content }); the same file twice is refused (409) |
| GET | /bank-accounts/{id}/statement-lines?status |
banking:read |
Imported statement lines |
| GET | /statement-lines/{id}/candidates |
banking:read |
Ledger lines of the same amount within 14 days |
| POST | /statement-lines/{id}/match, /unmatch, /ignore |
banking:manage |
Match to a ledger line, undo, or ignore with a reason |
| GET/POST | /bank-accounts/{id}/reconciliations |
banking:read / banking:reconcile |
Reconcile to a statement balance; history |
Every financial create endpoint posts to the ledger in the same transaction. If the date has no open period, the request fails with 422 NO_ACCOUNTING_PERIOD or PERIOD_CLOSED and nothing is saved, not even a document number.
Phase 5 — reporting, fixed assets, refunds, debit notes, year-end, opening items
| Method | Path | Permission | Purpose |
|---|---|---|---|
| GET | /reports/profit-and-loss?from&to[&compareFrom&compareTo&projectRef&departmentRef] |
reports:read |
Profit and loss from the ledger (year-end closing journals excluded) |
| GET | /reports/balance-sheet?asOf |
reports:read |
Balance sheet; checks assets = liabilities + equity |
| GET | /reports/cash-flow?from&to |
reports:read |
Cash-flow statement (indirect method), reconciled to the movement in bank and cash |
| GET | /reports/aged-receivables, /reports/aged-payables |
reports:read |
Ageing by days past due (current, 1–30, 31–60, 61–90, over 90), agreeing with the control accounts |
| GET | /reports/analysis?type=income|expense&by=month|client|supplier|account|project|department&from&to |
reports:read |
Revenue or expense analysis |
| GET | /reports/dashboard |
reports:read |
Dashboard: income and expenses this month and financial year to date, overdue invoices, bills due within 14 days, 12 months of income and expenses |
| GET/POST | /fixed-assets |
assets:read / assets:manage |
Asset register (FA-0001); registering does not post (record the purchase as a bill or journal) |
| GET/PATCH | /fixed-assets/{id} |
assets:read / assets:manage |
Detail with 12-month forecast; financial fields frozen once depreciated |
| POST | /fixed-assets/{id}/dispose |
assets:post |
Disposal with proceeds; posts the gain or loss |
| GET | /depreciation-runs, /depreciation-runs/{id}, /depreciation-runs/preview?periodId |
assets:read |
Runs, detail, and a preview of a month's run |
| POST | /depreciation-runs |
assets:post |
Run a month's depreciation (months in order; one live run per month) |
| POST | /depreciation-runs/{id}/reverse |
assets:post |
Reverse the latest run, with a reason |
| POST | /payments/{id}/refunds |
payments:refund |
Refund money held on account (KINT/RFD); posts Dr client deposits / Cr bank |
| POST | /supplier-bills/{id}/debit-notes |
supplier_bills:approve |
Debit note (KINT/DN) reducing a bill's balance |
| POST | /fiscal-years/{id}/close, /reopen |
periods:manage |
Year-end close (closing journal to retained earnings, all periods closed) or reopen |
| GET | /opening-items |
journals:read |
Invoices and bills brought forward from the previous books |
| POST | /opening-items/invoices, /opening-items/bills |
journals:post |
Bring forward an open invoice (original number) or bill, dated before the opening date |
Reports accept format=json (default), csv, xlsx or pdf.
Phase 6 — integration platform
| Method | Path | Permission | Purpose |
|---|---|---|---|
| POST | /oauth/token |
public (client authentication) | Client-credentials token (§5.2) |
| GET | /integrations/catalogue |
integrations:read |
Grantable scopes, webhook event types, event schema version |
| GET/POST | /integrations |
integrations:read / integrations:manage |
Integrations; register one (creates its service account) |
| GET/PATCH | /integrations/{id} |
integrations:read / integrations:manage |
Detail with credentials, webhooks, last 50 deliveries and requests; rename, disable |
| POST | /integrations/{id}/credentials |
integrations:manage |
Issue client credentials (secret returned once) |
| POST | /integrations/{id}/credentials/{credentialId}/revoke |
integrations:manage |
Revoke credentials and their tokens |
| POST | /integrations/{id}/webhooks |
integrations:manage |
Add an endpoint (signing secret returned once) |
| PATCH | /integrations/{id}/webhooks/{endpointId} |
integrations:manage |
Change URL or events, disable or enable |
| POST | /integrations/{id}/webhooks/{endpointId}/rotate-secret |
integrations:manage |
New signing secret; the old one also signs for 24 hours |
| POST | /integrations/{id}/webhooks/{endpointId}/test |
integrations:manage |
Queue a ping event |
| POST | /webhook-deliveries/{id}/replay |
integrations:manage |
Send a failed or dead delivery again |
Phase 7 — two-factor authentication
| Method | Path | Access | Purpose |
|---|---|---|---|
| POST | /auth/mfa/verify |
public (challenge) | Second sign-in step (§5.1) |
| GET | /auth/mfa |
signed in | Your status: on/off, recovery codes left, required by policy |
| POST | /auth/mfa/setup |
signed in | New seed, otpauth:// URI and QR code (SVG data URL) |
| POST | /auth/mfa/enable |
signed in | Confirm with a code; returns 10 recovery codes once; signs out other sessions |
| POST | /auth/mfa/recovery-codes |
signed in | Replace recovery codes ({ password, code }) |
| POST | /auth/mfa/disable |
signed in | Turn off ({ password, code }); refused when the organisation requires it |
| POST | /users/{id}/mfa/reset |
users:manage |
Reset another user's two-factor ({ reason }); signs them out |
The security setting requireTwoFactor (PUT /settings/security) can only be switched on by an administrator who uses two-factor (MFA_REQUIRED_FOR_POLICY).
Email (ADR-0013)
| Method | Path | Permission | Purpose |
|---|---|---|---|
| GET | /auth/options |
public | { passwordReset }: whether self-service reset is available |
| POST | /auth/password-reset, /auth/password-reset/complete |
public | Forgotten password (§5.1 step 7) |
| GET | /email/status |
organisation:read |
Configured or not, sending and reply-to mailboxes, alert recipients, last 7 days' counts |
| POST | /email/test |
organisation:manage |
Queue a test email ({ to? }, default: you) |
| GET | /email/messages?status&kind |
audit:read |
Email log: recipients, subject, delivery; never bodies |
| POST | /email/messages/{id}/retry |
organisation:manage |
Send a failed email again (not password resets) |
| POST | /invoices/{id}/email, /credit-notes/{id}/email |
invoices:write |
Email the stored PDF to the client ({ to[], cc[]?, message? }); the first email of an invoice records it as sent |
| POST | /quotations/{id}/email |
quotations:write |
Same; an approved quotation becomes sent |
| POST | /payments/{id}/email |
payments:create |
Email the receipt |
| GET | /invoices/{id}/emails, /credit-notes/{id}/emails, /quotations/{id}/emails, /payments/{id}/emails |
the document's read permission | Suggested recipients (client and primary contact) and delivery history |
Emails are queued (202) and sent by the worker within seconds. Without email configured, these endpoints return 503 EMAIL_NOT_CONFIGURED and documents show no Email action.
Events delivered as webhooks
client.created, client.updated, quotation.created, quotation.submitted, quotation.approved, quotation.sent, quotation.accepted, quotation.rejected, quotation.cancelled, quotation.converted, invoice.created, invoice.issued, invoice.sent, invoice.partially_paid, invoice.paid, credit_note.issued, payment.received, payment.reversed, purchase_order.approved, purchase_order.issued, supplier_bill.created, supplier_bill.approved, debit_note.issued, supplier_payment.made, expense.approved, payment.refunded, depreciation.posted, fixed_asset.disposed. Plus ping (test events only). Subscribe to * for every type, including types added later.
8. Webhooks
Events are written to a transactional outbox in the same database transaction as the change, then delivered by the worker (kint-accounts-worker) to every active endpoint subscribed to the event type. Delivery is at least once, usually within a few seconds. Subscriptions are not retroactive.
POST <endpoint URL>
Content-Type: application/json
User-Agent: KINT-Accounts-Webhooks/1.0
X-Kint-Event: invoice.issued
X-Kint-Delivery: <uuid, stable across retries>
X-Kint-Timestamp: <unix seconds>
X-Kint-Signature: v1=<hex HMAC-SHA256(secret, "<timestamp>.<raw body>")>
{ "id": "<event uuid>", "type": "invoice.issued", "version": "2026-11-01", "occurredAt": "…", "data": { … } }
- Respond with 2xx within 10 seconds. Anything else (including redirects, which are not followed) is a failure. Do slow work after responding.
- Retries: after 1 min, 5 min, 15 min, 1 h, 3 h, 6 h, 12 h and 24 h (9 attempts over about two days). Then the delivery is marked failed; an administrator can replay it from Administration → Integrations.
- Rotation: for 24 hours after a secret rotation,
X-Kint-Signaturecarries two values (v1=…,v1=…), one per secret. Accept the request if either matches. - URLs must be https on the live system and must not point to private or local network addresses.
Verify every delivery before trusting it (Node.js example):
import { createHmac, timingSafeEqual } from 'node:crypto';
export function verifyKintWebhook(rawBody, headers, secret) {
const ts = Number(headers['x-kint-timestamp']);
if (!Number.isFinite(ts) || Math.abs(Date.now() / 1000 - ts) > 300) return false; // replay window
const expected = Buffer.from(
createHmac('sha256', secret).update(`${ts}.${rawBody}`).digest('hex'),
);
return String(headers['x-kint-signature'] ?? '')
.split(',')
.map((v) => Buffer.from(v.trim().replace(/^v1=/, '')))
.some((sig) => sig.length === expected.length && timingSafeEqual(sig, expected));
}
Use the raw request body (before JSON parsing). Store processed id values and ignore repeats, because a delivery can arrive more than once.