API keys
API errors
What each error from the Lanesra endpoint means and what to do about it. Errors come back as a JSON-RPC error with an HTTP status, or, once a tool has run, as a result with isError: true.
HTTP errors#
| Status | JSON-RPC code | Meaning | What to do |
|---|---|---|---|
| 401 | -32001 |
No key, a malformed Authorization header, or a key that was revoked or replaced |
Send exactly Authorization: Bearer lns_live_… with a current key. See The 401 message |
| 403 | -32002 |
The key is valid, but the account can't use the endpoint | Check error.data.reason, below |
| 405 | -32000 |
A GET or DELETE request | Use POST |
A 403 won't clear by retrying with the same key. The account needs to change first.
The 401 message#
Every 401 carries the same message, whatever went wrong with the key:
Unauthorized: send a Lanesra key as `Authorization: Bearer lns_live_…`, or connect an app. A replaced or revoked key is no longer recognised - copy your current key from Integrations → MCP in the Lanesra app; for a script, ask the company owner or a project Admin for an API key. An app such as ChatGPT or Claude that stopped working: connect Lanesra again from that app.
Its last sentence, about apps, doesn't apply to keys.
A key that used to work and now gets this has been replaced or revoked. That happens when:
- its holder replaced it, or someone revoked it on Integrations → API keys;
- for a personal key, its holder changed or reset their password, or was removed from the company or from their last project;
- for the company key, the owner changed or reset their password, or ownership moved to someone else;
- for a key created for some projects, the last of them was deleted.
For your own assistant, copy your current key from Integrations → MCP. For a script, the company owner or a project Admin can give it a key from Integrations → API keys. Retrying with the same key never helps.
403 reasons#
error.data.reason |
Meaning | What to do |
|---|---|---|
no_plan |
The account has no active plan | Start a plan in the app |
billing_lapsed |
Billing has lapsed, so access is paused | Renew the plan. Access comes back straight away |
company_suspended |
The account is suspended | Contact support |
user_suspended |
The person a personal key belongs to is suspended | Contact support |
Tool errors#
These come back with HTTP 200 and result.isError: true. The text in result.content[0].text explains the problem in plain words, so you can log it or show it.
| Message | What to do |
|---|---|
This account tracks several brands - pass one as project |
Pass project. The message lists the slugs |
| No project "…" on this account | The key doesn't read that project, or it doesn't exist. Use one of the slugs the message lists, or call list_projects |
| This connection cannot use … on project "…" | The role doesn't read that part of the project. See What each tool needs |
| This key reads no projects: its holder is no longer a Member or Admin of any project in this company… | The key's holder is now a Viewer, or holds a role without MCP, on every project. Ask the company owner for Member or Admin access |
| This key has no projects left: every project it was created for has been deleted… | Ask the company owner or a project Admin for a new key |
| Project "…" has no data yet | Wait for the project's first capture to finish |
| Project "…" is suspended | Contact support |
| This account has no projects yet | Create a project in the app first |
| This key reads no projects: its holder is no longer a Member or Admin of any project in this company | Ask the company owner for Member or Admin access on a project. The same key works again once it is given |
| This key has no projects left: every project it was created for has been deleted | Ask a project Admin for a new key |
| "…" to "…" is not a date range that runs forwards | Put the earlier date in from |
| A range covers at most 366 days | Split the period into shorter ranges |
| Something went wrong reading this data … quote reference … | Retry later. If it keeps happening, send the reference to support |
Empty numbers#
A result with a note saying no answers have been captured yet is not an error. Every metric in it is empty, not zero. Call get_capture_status to see whether the first capture is still running.