# LAC Developers > Developer documentation for The Last Accounting Company customer API and MCP server. ## Docs - [Create an API key (admin, interactive session only)](https://docs.lastaccountingcompany.com/api-reference/api-keys/create-an-api-key-admin-interactive-session-only.md): Mints a new portal API key with scope `read` or `write`. The `api_key` secret (`lac_sk_...`) is returned once and never again — store it securely. Requires an interactive admin session; API-key bearers receive 403. - [List API keys (admin, interactive session only)](https://docs.lastaccountingcompany.com/api-reference/api-keys/list-api-keys-admin-interactive-session-only.md): Lists the company's portal API keys (metadata only — the secret is shown once at creation). Requires an interactive admin session; API-key bearers receive 403. - [Revoke an API key (admin, interactive session only)](https://docs.lastaccountingcompany.com/api-reference/api-keys/revoke-an-api-key-admin-interactive-session-only.md): Revokes a portal API key. Revoked keys are refused immediately. Requires an interactive admin session; API-key bearers receive 403. - [Drill into statement lines by account](https://docs.lastaccountingcompany.com/api-reference/books/drill-into-statement-lines-by-account.md): Returns the underlying detail behind statement lines for the given GL account codes. `account_codes` is a comma-joined list (e.g. `3000,3010`). Returns JSON `null` when there is nothing to drill into. - [Get financial statements](https://docs.lastaccountingcompany.com/api-reference/books/get-financial-statements.md): Returns statement read models (income statement, balance sheet, and — where available — cash flow via `statement=cashflow`) for the selected range. Returns JSON `null` when no statement data exists for the selection. - [Get ledger analytics](https://docs.lastaccountingcompany.com/api-reference/books/get-ledger-analytics.md): Returns aggregated ledger analytics (trends, category breakdowns) for the selected range, suitable for charting. Amounts are integer cents. - [Get the Books or VAT sheet](https://docs.lastaccountingcompany.com/api-reference/books/get-the-books-or-vat-sheet.md): Returns the spreadsheet-style read model over the canonical general ledger: summary cards, column definitions, and rows for the selected tab and range. Amounts inside rows are integer cents. Paginate with `limit`/`offset` (limit 0 = unpaginated, max 200 per page). - [Get the accounting agent's status](https://docs.lastaccountingcompany.com/api-reference/company/get-the-accounting-agents-status.md): Returns the current status of Björn, the accounting agent, for this company (e.g. idle/working and progress notes). - [Get the authenticated identity](https://docs.lastaccountingcompany.com/api-reference/company/get-the-authenticated-identity.md): Returns the authenticated principal and the companies it can access. For an API key this is the single pinned company. - [Get the company profile](https://docs.lastaccountingcompany.com/api-reference/company/get-the-company-profile.md): Returns the company's registered details and accounting configuration: fiscal year start month, VAT period length in months, company form, and statement format. `editable` indicates whether the caller could change settings (always false for API keys). - [Get the portal overview dashboard](https://docs.lastaccountingcompany.com/api-reference/company/get-the-portal-overview-dashboard.md): One-call summary of the company's current state: the active period, headline metrics, items needing attention, filing readiness, connection health, import status, and document intake. - [List accessible companies](https://docs.lastaccountingcompany.com/api-reference/company/list-accessible-companies.md): Lists the companies (customers) the bearer can act on. API keys always see exactly one. - [Update company accounting settings (admin/approver only)](https://docs.lastaccountingcompany.com/api-reference/company/update-company-accounting-settings-adminapprover-only.md): Changes the fiscal year start month and/or VAT period length. Requires an interactive admin/approver session — NOT available to API keys (even write-scoped ones), which receive 403. `vat_period_valid_from` must be a period-aligned `YYYY-MM-DD` date. - [Confirm or retract a service-connection step](https://docs.lastaccountingcompany.com/api-reference/connections/confirm-or-retract-a-service-connection-step.md): Confirms (or retracts, via `action: retract`) a pending step in a service-connection setup. Accepted asynchronously. Requires a write-scoped key. - [List bank connections](https://docs.lastaccountingcompany.com/api-reference/connections/list-bank-connections.md): Lists the company's bank connections with setup metadata. Establishing a new bank connection uses a browser-interactive consent flow available only in the portal UI. - [List Fennoa connections](https://docs.lastaccountingcompany.com/api-reference/connections/list-fennoa-connections.md): Lists the company's Fennoa connections with setup metadata. - [List Google Sheets connections](https://docs.lastaccountingcompany.com/api-reference/connections/list-google-sheets-connections.md): Lists the company's Google Sheets connections with setup metadata. Establishing one uses a browser-interactive OAuth flow available only in the portal UI. - [List inbox (email) connections](https://docs.lastaccountingcompany.com/api-reference/connections/list-inbox-email-connections.md): Lists the company's inbox connections (e.g. Gmail) with setup metadata. Establishing one uses a browser-interactive OAuth flow available only in the portal UI. - [List Procountor connections](https://docs.lastaccountingcompany.com/api-reference/connections/list-procountor-connections.md): Lists the company's Procountor connections with setup metadata. - [List Stripe connections](https://docs.lastaccountingcompany.com/api-reference/connections/list-stripe-connections.md): Lists the company's Stripe connections with setup metadata. - [Request a service connection change](https://docs.lastaccountingcompany.com/api-reference/connections/request-a-service-connection-change.md): Files an intent about a service connection (e.g. asking LAC to set one up or change it). Accepted asynchronously and dispatched as an event. Requires a write-scoped key. - [Trigger a Fennoa sync](https://docs.lastaccountingcompany.com/api-reference/connections/trigger-a-fennoa-sync.md): Pulls data from the Fennoa connection, optionally constrained to a date window or a full backfill. Requires a write-scoped key. - [Trigger a Procountor sync](https://docs.lastaccountingcompany.com/api-reference/connections/trigger-a-procountor-sync.md): Pulls data from the Procountor connection, optionally constrained to a date window or a full backfill. Requires a write-scoped key. - [Trigger a Stripe sync](https://docs.lastaccountingcompany.com/api-reference/connections/trigger-a-stripe-sync.md): Pulls data from the Stripe connection, optionally constrained to a date window or a full backfill. Requires a write-scoped key. - [Delete an uploaded file](https://docs.lastaccountingcompany.com/api-reference/documents/delete-an-uploaded-file.md): Deletes one uploaded file. Requires a write-scoped key. - [Download one uploaded file](https://docs.lastaccountingcompany.com/api-reference/documents/download-one-uploaded-file.md): Returns the raw bytes of one uploaded file. - [Export all uploads as a zip](https://docs.lastaccountingcompany.com/api-reference/documents/export-all-uploads-as-a-zip.md): Downloads every uploaded document as a single zip archive. - [Get per-file ingest progress](https://docs.lastaccountingcompany.com/api-reference/documents/get-per-file-ingest-progress.md): Reports ingest progress for uploaded files — whether each document has been parsed and booked yet. - [List uploaded files](https://docs.lastaccountingcompany.com/api-reference/documents/list-uploaded-files.md): Lists uploaded documents with their metadata. Filter by `kind` (e.g. `receipt`, `invoice`, `contract`). - [Update an uploaded file's metadata](https://docs.lastaccountingcompany.com/api-reference/documents/update-an-uploaded-files-metadata.md): Renames the file's display name and/or attaches a context note for the accounting agent. Requires a write-scoped key. - [Upload documents](https://docs.lastaccountingcompany.com/api-reference/documents/upload-documents.md): Uploads receipts, purchase invoices, contracts, or bank statements for ingestion into the books. Multipart form; repeat the `files` part for multiple files (the singular part name `file` is also accepted). Limits: 20 files and 25 MB per request. Requires a write-scoped key. - [Download an output package file](https://docs.lastaccountingcompany.com/api-reference/filings/download-an-output-package-file.md): Downloads one file of an output package by role: `excel`, `pdf`, `json`, or `instructions`. Returns raw file bytes with the appropriate content type. - [Get one output package](https://docs.lastaccountingcompany.com/api-reference/filings/get-one-output-package.md): Returns a single output package with its metadata and file roles. - [Get the filing state](https://docs.lastaccountingcompany.com/api-reference/filings/get-the-filing-state.md): Returns the filing state for a period (default `this_month`): the resolved period, the VAT preview, filing drafts, filed returns, produced output packages, the latest review request, and the standing authorization state. Amounts are integer cents. - [List output packages](https://docs.lastaccountingcompany.com/api-reference/filings/list-output-packages.md): Lists produced output packages (e.g. VAT return drafts, close reports) with their available file roles. - [Request a filing review](https://docs.lastaccountingcompany.com/api-reference/filings/request-a-filing-review.md): Asks the accounting agent to review the books and prepare filings for the given range (default `this_month`). Accepted asynchronously — the work is dispatched as an event. Requires a write-scoped key. - [Set filing authorization](https://docs.lastaccountingcompany.com/api-reference/filings/set-filing-authorization.md): Grants or revokes LAC's standing authorization to submit filings on the company's behalf. Requires a write-scoped key. - [Download an import run's raw package](https://docs.lastaccountingcompany.com/api-reference/imports/download-an-import-runs-raw-package.md): Downloads the raw source package that was imported, as file bytes. - [Get an import run](https://docs.lastaccountingcompany.com/api-reference/imports/get-an-import-run.md): Returns one import run with its artifacts. - [List import runs](https://docs.lastaccountingcompany.com/api-reference/imports/list-import-runs.md): Lists historical import runs (e.g. books migrated from a previous accounting system) with their statuses. - [API reference](https://docs.lastaccountingcompany.com/api-reference/index.md): Conventions, authentication, and boundaries for the LAC customer REST API. - [Create or update a recurring invoice template](https://docs.lastaccountingcompany.com/api-reference/invoicing/create-or-update-a-recurring-invoice-template.md): Creates a recurring invoice template (or updates one via `template_id`). `cadence_months` is an integer number of months between issues; `draft` carries the same shape as the invoice-draft input (integer cents, basis points, decimal-string quantities). Requires a write-scoped key. - [Create or update an invoice customer](https://docs.lastaccountingcompany.com/api-reference/invoicing/create-or-update-an-invoice-customer.md): Upserts a party in the invoicing counterparty register. Include `id` to update an existing party. Requires a write-scoped key. - [Create or update an invoice draft](https://docs.lastaccountingcompany.com/api-reference/invoicing/create-or-update-an-invoice-draft.md): Creates a sales-invoice draft (or updates an existing one via `draft_id`). Monetary fields are integer cents; VAT rates are basis points (25.5% = 2550); line quantities are decimal strings. Delivery channel is one of `maventa_einvoice`, `email_pdf`, or `pdf_download`. Requires a write-scoped key. - [Download the invoice as Finvoice XML](https://docs.lastaccountingcompany.com/api-reference/invoicing/download-the-invoice-as-finvoice-xml.md): Returns the invoice rendered as a Finvoice XML document. - [Download the invoice as PDF](https://docs.lastaccountingcompany.com/api-reference/invoicing/download-the-invoice-as-pdf.md): Returns the invoice rendered as a PDF document. - [Draft the next invoice from a template](https://docs.lastaccountingcompany.com/api-reference/invoicing/draft-the-next-invoice-from-a-template.md): Materializes the template's next occurrence as an invoice draft, optionally overriding the issue date. Requires a write-scoped key. - [Get an invoice](https://docs.lastaccountingcompany.com/api-reference/invoicing/get-an-invoice.md): Returns the full detail of one invoice or draft, amounts in integer cents. - [Issue a credit note](https://docs.lastaccountingcompany.com/api-reference/invoicing/issue-a-credit-note.md): Requests a credit note against the invoice. Accepted asynchronously and dispatched as an event. Requires a write-scoped key. - [List invoice customers](https://docs.lastaccountingcompany.com/api-reference/invoicing/list-invoice-customers.md): Lists the invoicing counterparty register — the parties you invoice, with their e-invoice addresses and per-party defaults. - [List recurring invoice templates](https://docs.lastaccountingcompany.com/api-reference/invoicing/list-recurring-invoice-templates.md): Lists recurring invoice templates with their cadence and next issue date. - [List sales invoices](https://docs.lastaccountingcompany.com/api-reference/invoicing/list-sales-invoices.md): Lists the company's sales invoices and drafts with their statuses. - [Retry sending an invoice](https://docs.lastaccountingcompany.com/api-reference/invoicing/retry-sending-an-invoice.md): Retries delivery of an invoice whose previous send attempt failed. Requires a write-scoped key. - [Send a payment reminder](https://docs.lastaccountingcompany.com/api-reference/invoicing/send-a-payment-reminder.md): Requests a payment reminder for an unpaid invoice. Accepted asynchronously. Pass `idempotency_key` to make retries safe. Requires a write-scoped key. - [Send an invoice](https://docs.lastaccountingcompany.com/api-reference/invoicing/send-an-invoice.md): Sends the invoice via its configured delivery channel (Maventa e-invoice or email PDF). Requires a write-scoped key. - [Update a recurring template's status or schedule](https://docs.lastaccountingcompany.com/api-reference/invoicing/update-a-recurring-templates-status-or-schedule.md): Partially updates a recurring invoice template — rename it, pause/resume/ archive it, or change its cadence and next issue date. Requires a write-scoped key. - [List chat messages](https://docs.lastaccountingcompany.com/api-reference/messages/list-chat-messages.md): Returns the chat history between the company and Björn, the accounting agent, newest context included. - [Send a message to the accounting agent](https://docs.lastaccountingcompany.com/api-reference/messages/send-a-message-to-the-accounting-agent.md): Posts a message to Björn. The message is dispatched as an event to the agent runtime; the returned `event_id` identifies that dispatch. Requires a write-scoped key. - [Add an employee](https://docs.lastaccountingcompany.com/api-reference/payroll/add-an-employee.md): NOT available to API keys — requires an interactive admin/approver session. Adds an employee to payroll. Salary and rate fields are integer cents; withholding/pension rates are basis points (10000 = 100%). - [Approve a payroll run (admin/approver only)](https://docs.lastaccountingcompany.com/api-reference/payroll/approve-a-payroll-run-adminapprover-only.md): NOT available to API keys — requires an interactive admin/approver session. Approves a drafted payroll run for payment and reporting. API keys (even write-scoped ones) receive 403. - [Draft a payroll run](https://docs.lastaccountingcompany.com/api-reference/payroll/draft-a-payroll-run.md): NOT available to API keys — requires an interactive admin/approver session. Computes a draft payroll run for the period from current employees, tax cards, and employer settings. Drafting does not pay anyone — a separate approval is required. Pass `idempotency_key` to make retries safe. - [Get an employee's payslip](https://docs.lastaccountingcompany.com/api-reference/payroll/get-an-employees-payslip.md): NOT available to API keys — requires an interactive admin/approver session. Returns one employee's payslip for a period (optionally a specific run). Amounts are integer cents. - [Get the payroll workspace](https://docs.lastaccountingcompany.com/api-reference/payroll/get-the-payroll-workspace.md): NOT available to API keys — requires an interactive admin/approver session. Returns the payroll workspace for a period (`YYYY-MM`, default current): employees, employer settings, draft/approved runs. Amounts are integer cents; rates are basis points. - [Update an employee](https://docs.lastaccountingcompany.com/api-reference/payroll/update-an-employee.md): NOT available to API keys — requires an interactive admin/approver session. Partially updates an employee identified by `employee_id` or `employee_key`. Same units as creation: integer cents and basis points. - [Update an employee's tax card](https://docs.lastaccountingcompany.com/api-reference/payroll/update-an-employees-tax-card.md): NOT available to API keys — requires an interactive admin/approver session. Updates the withholding tax-card values for one employee: base and additional withholding rates in basis points, income ceiling in integer cents, effective-from date, and prior year-to-date gross in cents. - [Update employer payroll settings](https://docs.lastaccountingcompany.com/api-reference/payroll/update-employer-payroll-settings.md): NOT available to API keys — requires an interactive admin/approver session. Updates employer-level payroll rates — pension, side costs, holiday accrual — all in basis points, effective from a given date. - [Getting started](https://docs.lastaccountingcompany.com/index.md): What the LAC customer API covers, how to get an API key, and your first requests. - [MCP server](https://docs.lastaccountingcompany.com/mcp-server.md): Connect Claude, ChatGPT, Cursor, VS Code, or your own agents to your company's books over MCP. ## OpenAPI Specs - [openapi](https://docs.lastaccountingcompany.com/openapi.yaml)