Skip to main content

Clatri API

The Clatri API lets you read and change your Clatri data from your own apps, scripts and automations, over HTTPS and JSON. It runs a short list of tools built for adding and updating data: log an expense, read your income statement, create a task, log your weight…

It uses the same token as the MCP. If you already have one, you don't need another key.

API or MCP?
  • MCP: when you want an AI assistant (Claude, ChatGPT, Cursor…) to look at your Clatri while you chat with it. See Clatri MCP.
  • API: when you write code. Your program decides which tool to call and with what data, and gets JSON back.

How it works​

  • Base URL: https://api.clatri.com/v1
  • Authentication: an Authorization: Bearer clt_mcp_XXXX header on every call.
  • Everything is a tool. To run one, you POST to /v1/entities/{entity_id}/tools/{tool_name} with its arguments as the JSON body. The entity (personal, business, project) always goes in the path.
Method and pathWhat it's for
GET /v1/meThe token: your user, permissions, areas, entities and expiry date.
GET /v1/entitiesThe entities this token can use (id, type, name).
GET /v1/toolsThe tools this token can call, with their input schema.
POST /v1/entities/{entity_id}/tools/{tool_name}Runs a tool on that entity.
GET /v1/openapi.jsonThe full OpenAPI 3.1 specification. It's public: no token needed.

The full list of tools, with their arguments, is in the API reference.


What you can do​

The API is for adding and updating your data from other apps. It is a short, closed list, not everything the Clatri agent can do. For everything else, use the chat or Clatri MCP.

AreaReadAdd and updateDelete
Moneyread_user_accounts, read_cards, search_chart_accounts, read_expenses, read_incomes, read_income_statementcreate_expense, edit_expense, create_income, edit_income, transfer_between_accounts, pay_carddelete_expense, delete_income
Administrationlist_boards, search_tasks, read_task, read_calendar_events, read_contacts, read_contact, read_habitscreate_task, update_task, complete_tasks, create_calendar_event, edit_calendar_event, create_contact, edit_contact, add_contact_note, log_habitdelete_task, delete_calendar_event, delete_contact
Healthread_body_metrics, read_health_activitiescreate_body_metric, edit_body_metric, log_health_activity, edit_health_activitydelete_body_metric, delete_health_activity

A tool outside this list returns 404 tool_not_available.


Requirements​

You need an active Clatri subscription

Like the MCP, the API requires an active subscription. Without one you can't create tokens, and existing tokens respond 402 subscription_inactive until you renew. They're not deleted: they start working again on their own when you renew.

You need to call it from a server or a script

The API doesn't accept calls from a browser: it sends no CORS headers. That's on purpose, so nobody puts your token in a web page's code. Call it from a backend, a script, a serverless function or an automation tool.


Step 1 — Create your token​

  1. In the Clatri app, open Settings → Connections → Agents and APIs. On the web, Settings → Agents and APIs.
  2. Tap Create token and give it a name you'll recognize (for example, "My expenses script").
  3. Choose the permissions: Read only, Read and write or Full access (includes delete).
  4. Optionally, limit the areas (Money, Health, Administration, General) and entities it can use. By default it has all of them.
  5. Tap Create token and copy it.
Copy it right away

The token (it starts with clt_mcp_) is shown only once. If you lose it, revoke it and create another. Treat it like a password: anyone who has it can use your data with the permissions you chose.

Tokens expire after 6 months and you can have up to 10 active ones. After creating one, you can change its name, permissions, areas and entities without generating a new one.

In the examples on this page the token is in an environment variable:

export CLATRI_TOKEN="clt_mcp_XXXX"

Step 2 — Your first call​

Check that the token works with GET /v1/me:

curl https://api.clatri.com/v1/me \
-H "Authorization: Bearer $CLATRI_TOKEN"

The response looks like this (made-up data):

{
"user_id": "11111111-1111-4111-8111-111111111111",
"credential": "personal_token",
"token_name": "My expenses script",
"permissions": ["read", "write"],
"areas": ["money", "administration"],
"entity_ids": null,
"entities": [
{"id": "22222222-2222-4222-8222-222222222222", "type": "personal", "name": "Personal", "is_shared": false},
{"id": "33333333-3333-4333-8333-333333333333", "type": "business", "name": "My company", "is_shared": false}
],
"expires_at": "2027-04-29T15:00:00+00:00",
"request_id": "req_0f1e2d3c4b5a69788796a5b4c3d2e1f0"
}
  • areas: null means all areas; entity_ids: null, all your entities.
  • is_shared: true marks an entity someone else shared with you.

Confirm deletes with ?confirm=true​

Tools with the delete permission (deleting or cancelling data) require ?confirm=true in the URL, on top of the Idempotency-Key. Without the confirmation → 428 confirmation_required and nothing is deleted:

curl -X POST \
"https://api.clatri.com/v1/entities/22222222-2222-4222-8222-222222222222/tools/delete_task?confirm=true" \
-H "Authorization: Bearer $CLATRI_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 9e8d7c6b-5a49-4382-9170-6f5e4d3c2b1a" \
-d '{"task_id": "44444444-4444-4444-8444-444444444444"}'

In GET /v1/tools these tools have requires_confirmation: true. The destructive: true field also flags the ones that overwrite data.


Errors​

Errors arrive as application/problem+json (RFC 9457), always with a stable code you can use in your code:

{
"type": "https://docs.clatri.com/api/errors#scope_denied",
"title": "Permission not granted",
"status": 403,
"detail": "This token does not have the permission this tool requires.",
"code": "scope_denied",
"request_id": "req_6c1d0e2a9b7f4e3c8a5d1f0b2e4c6a8d"
}

The wording of title and detail can change: decide with code and status.

HTTPCodes
400validation_error, idempotency_key_required, dry_run_not_supported, https_required
401unauthorized, token_revoked, token_expired
402subscription_inactive
403scope_denied, domain_denied, entity_denied
404tool_not_found, tool_not_available, not_found
405method_not_allowed
409idempotency_key_reused, idempotency_in_progress
413payload_too_large
422tool_error
428confirmation_required
429rate_limited
500internal_error
503service_unavailable

What each code means and what to do: API errors.

422 tool_error is the most common day to day: the tool ran but couldn't complete what you asked (for example, an account that doesn't exist). The detail explains why.


Limits​

LimitValue
Reads per token120 per minute
Writes and deletes per token30 per minute
Calls per entity (all tokens combined)300 per minute
Maximum body size256 KB
  • Windows are fixed one-minute windows. GET /v1/me, /v1/entities and /v1/tools count as token reads.
  • Responses carry RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset (seconds until the window resets). When several limits apply, the headers show the one closest to running out.
  • Going over returns 429 rate_limited with Retry-After in seconds. Wait that long before retrying.
  • Blocking after repeated failures: 20 401 or 403 responses within 5 minutes, for the same token or the same IP, block that token or IP for 15 minutes (429 with Retry-After). If your script gets a 401 or 403, fix the cause instead of retrying in a loop.
  • Some tools (web search, maps, images) use your account's credits, as when the agent uses them.

Useful headers​

HeaderWhereWhat for
Authorization: Bearer …RequestYour token. Required except on /v1/openapi.json.
Idempotency-KeyRequestRequired on writes and deletes.
Content-Type: application/jsonRequestOn calls with a body.
Clatri-Request-IdResponseId of the call, on every response.
RateLimit-*, Retry-AfterResponseRate limits (see above).

The API only works over HTTPS. Responses carry Cache-Control: no-store.


Versioning and deprecation​

  • The version is in the path: /v1. A breaking change ships as a new version.
  • Before a version is retired, its responses carry the Deprecation and Sunset headers, with at least 90 days of notice.
  • Error codes are part of the contract: new codes can appear, but existing ones aren't renamed or removed within v1.
  • The tools are the same ones the Clatri agent uses, so the catalog grows with the product. Check GET /v1/tools or the reference for the current schema.

Security​

Take care of your token
  • Never share it or paste it into chats, screenshots, tickets or forums.
  • Don't commit it to a repository or put it in the code of a mobile app or a web page. Keep it in an environment variable or a secrets manager.
  • One token per integration. That way you can revoke one without affecting the others, and the activity shows what each one did.
  • If it leaked, revoke it in Settings → Connections → Agents and APIs. Revocation is immediate. Then create another.
What a token can and can't do

A token only acts inside Clatri, with the permissions, areas and entities you gave it. It can't create other tokens, change your password or email, touch your subscription, delete an entity or see entities outside its scope.

Every tool call is recorded in the token's recent activity (Settings → Connections → Agents and APIs → tap the token), just like MCP calls. If you see something you don't recognize, revoke it.

Tools that aren't available through the API

Some of the agent's tools can't be called through the API even if the token has the permission. They respond 404 tool_not_available and don't appear in GET /v1/tools or in the reference:

  • Free-form database queries. They're not a stable, reviewable contract.
  • Document passwords. Saving or using a protected PDF's password is credential handling.
  • Access management. Inviting or removing members of a space, seeing who else is in it, or linking a contact to another Clatri account: they change who sees your data.
  • Looking up other entities or people. A token never sees entities outside its own.
  • Schedules. Creating, editing or running a schedule later puts the full agent to work with all your permissions, outside the token's limits.
  • whoami and list_entities from the MCP: in the API, GET /v1/me and GET /v1/entities replace them.

For these actions, use the Clatri app or chat.

If you connect the API to an AI model

What the API returns is your data: movement descriptions, document text, notes. If you pass it to an AI model, treat it as data, not instructions. Text inside a document could try to give the model orders.

OAuth tokens from connected apps

Besides personal tokens (clt_mcp_), the API accepts the OAuth access tokens (clt_at_) that apps you connected to Clatri through OAuth receive. Those tokens only see the reduced catalog of tools those apps use in the MCP.


API reference​

  • Interactive reference: every tool, with its arguments, permissions, areas and body examples.
  • OpenAPI 3.1: https://api.clatri.com/v1/openapi.json (public, always current). Import it into Postman, Insomnia or your client generator.
  • API errors: each code, its cause and what to do.