For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Get API key
HomeAPI Reference
HomeAPI Reference
  • Overview
    • API reference
  • API Reference
      • GETList the current user's workspaces
      • GETGet a single workspace
      • PATCHMark a workspace as the user's default
Get API key
LogoLogo
API ReferenceAccounts

List the current user's workspaces

||View as Markdown|
GET
https://app.lucanto.eu/api/v1/user/accounts
GET
/api/v1/user/accounts
$curl https://app.lucanto.eu/api/v1/user/accounts \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json"
1[
2 {
3 "id": 42,
4 "name": "ACME s.r.o.",
5 "default": true,
6 "created_at": "2024-01-15T09:30:00Z",
7 "updated_at": "2024-04-10T14:45:00Z",
8 "accounting_type": "simple",
9 "onboarding_step": "company_details",
10 "vat_registration_alert": true,
11 "logo_url": "https://cdn.lucanto.eu/logos/acme_sro_42.png?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
12 "legal_identity": {
13 "registration_id": "12345678",
14 "tax_id": "2023456789",
15 "vat_id": "SK2023456789",
16 "vat_payer_type": "standard",
17 "vat_period": "monthly",
18 "email": "info@acme-sro.sk",
19 "phone_number": "+421 2 1234 5678",
20 "web": "https://www.acme-sro.sk",
21 "legal_form": "s.r.o.",
22 "legal_form_id": 3,
23 "address": {
24 "name": "ACME s.r.o.",
25 "street": "Hlavná 123",
26 "municipality": "Bratislava",
27 "postal_code": "811 01",
28 "country_alpha2": "sk",
29 "contact": "Ján Novák"
30 },
31 "postal_address": {
32 "name": "ACME s.r.o.",
33 "street": "Poštová 45",
34 "municipality": "Bratislava",
35 "postal_code": "811 02",
36 "country_alpha2": "sk",
37 "contact": "Ján Novák"
38 }
39 }
40 }
41]

Returns the workspaces the authenticated user has access to. Typical response is 1–3 accounts; users almost never belong to more than a handful, so this endpoint is not paginated.

The response includes a default flag per account: clients building selector UIs can pre-select the user’s last-used workspace.

Was this page helpful?
Previous

API reference

Next

Get a single workspace

Built with

Authentication

AuthorizationBearer

Devise JWT issued via POST /api/v1/auth/sign_in. Used by mobile and SPA clients. Revoked tokens are tracked in api_jwt_denylists.

OR
AuthorizationBearer
Lucanto API key. Three prefixes: - `lct_pat_<random><checksum>` — personal access token (owner: User) - `lct_live_<random><checksum>` — workspace token, live data - `lct_test_<random><checksum>` — workspace token, sandbox account (Phase 3) Issue keys at `/settings/api_keys` (personal) or `/:account_id/settings/api_keys` (workspace). Plaintext token is shown once and never again.

Response

OK
idlong

Workspace ID. Use this in all account-scoped paths.

namestring

Display name of the workspace. Computed from the linked InvoiceAccount’s legal entity name when the workspace is named after a company, or from the owner’s name for personal/freelancer workspaces.

defaultboolean

true if this is the user’s default workspace. Exactly one account per user is the default at any time.

created_atdatetime
updated_atdatetime
accounting_typeenum or null

The workspace’s bookkeeping mode. Drives expense category options and tax/VAT logic. simple is single-entry bookkeeping; double_entry is full double-entry; and flat_rate_expenses is the SK/CZ “paušálne výdavky” simplified regime for sole proprietors. null when the workspace hasn’t finished onboarding yet.

Allowed values:
onboarding_stepstring or null

Current step in the workspace onboarding wizard. null when onboarding is complete. Useful for clients that want to direct the user to finish setup before issuing invoices.

vat_registration_alertboolean or null

true when the workspace’s recent revenue suggests they may have crossed the VAT registration threshold and should consult an accountant. Hint for client UI to show an in-app banner.

logo_urlstring or nullformat: "uri"

Signed URL for the workspace logo (ActiveStorage blob URL). null when no logo is uploaded. URLs are time-limited — re-fetch the account record to get a fresh URL.

legal_identityobject or null

The workspace’s legal-identity facet — registered name, tax IDs, VAT registration, contact details, and addresses. This is the same data that appears as supplier on every document the workspace issues.

Architecturally the legal identity is a facet of the workspace itself, not a separately-owned resource — the underlying record is the workspace’s InvoiceAccount, which is also the model Contact points at for customer-side legal entities. Closer to Stripe’s nested-fields pattern (account.business_profile, account.individual, account.company) than to a sub-resource shape.

Write access via the public API is a future slice; for now, this surface is read-only.

Errors

401
Unauthorized Error
429
Too Many Requests Error

Lucanto API key. Three prefixes:

  • lct_pat_<random><checksum> — personal access token (owner: User)
  • lct_live_<random><checksum> — workspace token, live data
  • lct_test_<random><checksum> — workspace token, sandbox account (Phase 3)

Issue keys at /settings/api_keys (personal) or /:account_id/settings/api_keys (workspace). Plaintext token is shown once and never again.