Menu
Getting started
Cookbooks
API reference
- Overview
- Companies
- Capabilities
- Measures
- Packages
- Unexplained
- Liquidity forecast
- Portfolio
- Customers
- Invoices
- Collections
- Articles
- Set-offs
- Suppliers
- Supplier invoices
- Supplier payment files
- Bank payments
- Expense claims
- Transactions
- Reconciliation
- Bank accounts
- POS sales
- Webshop orders
- Journal entries
- Voucher gap explanations
- Fiscal periods
- Accounts
- Accrual schedules
- Agreements and commitments
- Tax loss carry-forwards
- Fixed assets
- Documents
- Signing requests
- Company registers
- Capital events
- Owner tax
- Inbox items
- Dimensions
- Employees
- Salary runs
- Reports
- Budgets
- Imports
- Compliance check
- Deadlines
- Skatteverket
- Peppol
- Webhooks
- Operations
- Pending operations
- Health
- API key
- Service accounts
API key
What the calling key may do: its mode, scopes, and the companies it reaches with write access per company. Any valid key may call it.
Endpoints
GET/api/v1/api-key: Show what the calling API key may do: mode, scopes and company access.
GET /api/v1/api-key
api-key.get · any valid key, no scope
Show what the calling API key may do: mode, scopes and company access.
Returns the grant of the key that makes the request: mode (live or test), its scopes, whether it reaches every company its user is a member of (all_memberships) or only an allowlist (allowlist), and every company it reaches with the role and whether writes are let through there. access is read_only when the membership is a viewer (read_only_code ROLE_READ_ONLY) or the key was given read-only access to the company (CONNECTION_READ_ONLY): the same codes a refused write answers with. Any valid key may call this, whatever its scopes, and it works the same for keys issued through MCP OAuth. A key can write to company X with scope S when scopes contains S, X is in companies with access read_write, and mode is live or the endpoint supports dry-run. For document uploads: documents:write, read_write, and mode live. service_account names the service account the key belongs to (id, name, handle), or is null for a key that belongs to a person.
Use when: You connect a customer key and want to check, before the first real call, that it carries the scopes you need and can write to the company you will use, so the customer can fix the key while still on your connect screen.
Don't use for: Company names, org numbers or settings: use GET /api/v1/companies (scope companies:read). Testing a single write end to end: send it with ?dry_run=true where the endpoint supports dry-run.
Pitfalls
- A test key (
modetest) forces every write into dry-run, and an endpoint without dry-run support refuses it with 403 TEST_KEY_WRITE_BLOCKED. POST /companies/{companyId}/documents is one: uploads need a live key. - The grant can change after you read it: the customer can edit the key's scopes or company access, or remove the user from a company. Keep handling 403 INSUFFICIENT_SCOPE, ROLE_READ_ONLY and CONNECTION_READ_ONLY on real calls.
- With
company_accessall_memberships, companies the user joins later become reachable too; anallowlistkey never reaches a company outside its list, including one it creates with POST /companies. - A non-owner membership in a company whose multi-user plan has lapsed is refused on every call (403 with reason
multi_user_frozen); this response does not show that state. - Archived companies are not listed, the same as GET /api/v1/companies.
- A service account's key reaches only the account's company, and every write it makes is recorded under the account's name. When the sponsor stops being an owner or admin, the key is refused with 403 SERVICE_ACCOUNT_SUSPENDED, here too.
- While the person responsible for the agent has paused it, every key of the agent is refused with 403 AGENT_PAUSED, here too. Tell the user; only that person can resume it, under Settings.
Risk: low · Idempotent: yes · Reversible: no · Dry-run supported: no
Response fields
| Name | Type | Description |
|---|---|---|
mode | "live" | "test" | |
scopes | string[] | |
company_access | "all_memberships" | "allowlist" | |
companies | object[] | |
service_account | object | null | The service account the key belongs to, or null for a key that belongs to a person. A service account's key acts for its sponsor and reaches only the account's company. |
Example response
{
"data": {
"mode": "live",
"scopes": [
"companies:read",
"documents:read",
"documents:write"
],
"company_access": "allowlist",
"companies": [
{
"id": "8fd5b1f4-0000-4000-8000-000000000001",
"role": "owner",
"access": "read_write",
"read_only_code": null
},
{
"id": "8fd5b1f4-0000-4000-8000-000000000002",
"role": "admin",
"access": "read_only",
"read_only_code": "CONNECTION_READ_ONLY"
}
],
"service_account": null
},
"meta": {
"request_id": "req_…",
"api_version": "2026-05-12"
}
}