Skip to main content

API Overview

The lim REST API provides programmatic access to all accounting operations. It powers the CLI, the web dashboard, MCP server, and third-party integrations.

Base URL

https://api.uselim.com/v1
All API endpoints are versioned under /v1. The base URL may differ for self-hosted deployments.

Authentication

lim uses OAuth 2.0 via WorkOS for authentication. All API requests require a valid bearer token.

Obtaining a Token

lim auth login
# Opens browser for OAuth flow
# Token stored in ~/.config/lim/credentials.json

Using the Token

Include the token in the Authorization header:
curl -X GET https://api.uselim.com/v1/companies \
  -H "Authorization: Bearer <token>"
Never expose API keys in client-side code, public repositories, or logs. Use environment variables or secret management tools.

Request Format

  • Content-Type: application/json for all request bodies
  • Date format: YYYY-MM-DD for dates, ISO 8601 for timestamps
  • Amounts: Integers in the smallest currency unit (yen for JPY, cents for USD)
  • IDs: UUID v7 format

Example Request

curl -X POST https://api.uselim.com/v1/companies/comp_01.../journal-entries \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "effectiveDate": "2026-03-16",
    "sourceType": "manual",
    "memo": "AWS monthly bill",
    "lines": [
      { "side": "debit",  "accountId": "acct_01...", "amount": 10000 },
      { "side": "debit",  "accountId": "acct_02...", "amount": 1000 },
      { "side": "credit", "accountId": "acct_03...", "amount": 11000 }
    ]
  }'

Response Format

All responses are JSON. Successful responses return the resource directly:
{
  "id": "je_01926f3a...",
  "effectiveDate": "2026-03-16",
  "status": "posted",
  "memo": "AWS monthly bill",
  "lines": [
    { "side": "debit",  "accountId": "acct_01...", "accountCode": "5101", "amount": 10000 },
    { "side": "debit",  "accountId": "acct_02...", "accountCode": "1501", "amount": 1000 },
    { "side": "credit", "accountId": "acct_03...", "accountCode": "2101", "amount": 11000 }
  ],
  "createdAt": "2026-03-16T09:30:00.000Z"
}
List endpoints return arrays with pagination info:
{
  "data": [...],
  "total": 150,
  "limit": 50,
  "offset": 0
}

Error Format

Errors return a JSON object with an error field and an appropriate HTTP status code:
{
  "error": "from and to query parameters are required"
}

Status Codes

CodeMeaning
200Success
201Created
400Bad request — missing or invalid parameters
401Unauthorized — invalid or missing token
403Forbidden — insufficient permissions
404Not found
409Conflict — resource already exists (unique constraint)
429Rate limited
500Internal server error
Error messages are safe to display to users. Internal details and stack traces are never leaked in error responses.

Rate Limiting

API requests are rate-limited per authentication token:
PlanRate Limit
Free100 requests/minute
Pro1,000 requests/minute
EnterpriseCustom
When rate-limited, the API returns 429 Too Many Requests with a Retry-After header:
HTTP/1.1 429 Too Many Requests
Retry-After: 30

Endpoint Overview

All endpoints are scoped to a company: /v1/companies/:companyId/...

Core Resources

MethodEndpointDescription
GET/companiesList companies
POST/companiesCreate company
GET/companies/:idGet company

Accounting

MethodEndpointDescription
GET/companies/:id/journal-entriesList journal entries
POST/companies/:id/journal-entriesCreate journal entry
GET/companies/:id/journal-entries/:jeIdGet journal entry
POST/companies/:id/nl-journalNatural language journal entry
GET/companies/:id/accountsList accounts
GET/companies/:id/accounts/:acctIdGet account
GET/companies/:id/tax-codesList tax codes
GET/companies/:id/labelsList labels

Reports

MethodEndpointDescription
GET/companies/:id/reports/trial-balanceTrial balance
GET/companies/:id/reports/plProfit & loss
GET/companies/:id/reports/bsBalance sheet
GET/companies/:id/reports/ssShareholders’ equity
GET/companies/:id/reports/csCash flow statement
GET/companies/:id/reports/general-ledgerGeneral ledger
GET/companies/:id/reports/subsidiary-summarySubsidiary summary
GET/companies/:id/reports/ar-agingAR aging
GET/companies/:id/reports/consumption-taxConsumption tax
GET/companies/:id/reports/consumption-tax/xmle-Tax XML export
GET/companies/:id/reports/account-detailsAccount details

Banking

MethodEndpointDescription
GET/companies/:id/bank-accountsList bank accounts
POST/companies/:id/bank-accountsCreate bank account
GET/companies/:id/bank-accounts/:baId/transactionsList transactions

Operations

MethodEndpointDescription
GET/companies/:id/scenariosList scenarios
POST/companies/:id/scenariosCreate scenario
GET/companies/:id/alert-rulesList alert rules
POST/companies/:id/alert-rulesCreate alert rule
GET/companies/:id/fiscal-periodsList fiscal periods
POST/companies/:id/fiscal-periods/:fpId/closeClose period
GET/companies/:id/contractsList contracts
GET/companies/:id/invoicesList invoices
GET/companies/:id/expense-reportsList expense reports
GET/companies/:id/employeesList employees
POST/companies/:id/payroll/runRun payroll
GET/companies/:id/fixed-assetsList fixed assets
GET/companies/:id/accrual-schedulesList accrual schedules
GET/companies/:id/documentsList documents

Dashboard & Events

MethodEndpointDescription
GET/companies/:id/dashboardDashboard summary
GET/companies/:id/eventsList events

MCP

MethodEndpointDescription
GET/mcp/resourcesList MCP resources
GET/mcp/resources/:uriRead MCP resource
GET/mcp/toolsList MCP tools
POST/mcp/tools/:nameCall MCP tool
A full OpenAPI specification is available at https://api.uselim.com/openapi.json. You can import it into Postman, Insomnia, or any OpenAPI-compatible tool for interactive exploration.