Error codes
Authentication and limit errors come back as an HTTP response with its status code and a JSON-RPC error:
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32029,
"message": "Too many calls per minute with this key. …",
"data": { "code": "RATE_LIMITED", "message": "…", "retry_after": 12, "limit_per_min": 60 }
}
}Errors inside a tool come back as a normal result (HTTP 200) with isError: true:
{
"isError": true,
"content": [{ "type": "text", "text": "FORBIDDEN: You are not allowed to use this tool … (ops.absences.view)" }],
"_meta": { "error": { "code": "FORBIDDEN", "message": "…", "required": ["ops.absences.view"] } }
}Always branch on the code field: it is stable. The text may change.
The table's HTTP column is the status when the error happens before the tool runs. Only authentication, module and limit errors (UNAUTHENTICATED, CREDENTIAL_*, OWNER_INACTIVE, MODULE_DISABLED, RATE_LIMITED, QUOTA_EXCEEDED) arrive that way; the rest arrive inside an HTTP 200 response with isError: true.
| Code | HTTP | Description |
|---|---|---|
UNAUTHENTICATED | 401 | Missing or invalid key (Authorization: Bearer mk_… header). |
CREDENTIAL_EXPIRED | 401 | The key has expired. Create a new one in the panel (API & MCP). |
CREDENTIAL_REVOKED | 401 | The key has been revoked. |
OWNER_INACTIVE | 401 | The person who owns the key is disabled or has no access. |
MODULE_DISABLED | 403 | The "API & MCP" module is not enabled for this organization. |
FORBIDDEN | 403 | You are not allowed to use this tool (the person's permissions ∩ the key's scopes). |
TENANT_MISMATCH | 403 | The organization given is not the key's. You can only narrow within your own organization. |
LOCATION_OUT_OF_SCOPE | 403 | That centre is outside your scope. |
RATE_LIMITED | 429 | Too many calls per minute with this key. Retry after retry_after seconds. |
QUOTA_EXCEEDED | 429 | The organization has used up its monthly call quota. |
INVALID_INPUT | 400 | Invalid arguments; see issues. |
NOT_FOUND | 404 | Not found (or not in your organization). |
UNKNOWN_TOOL | 404 | No such tool. |
CONFIRM_INVALID | 400 | The confirm_token does not exist or belongs to another key. |
CONFIRM_EXPIRED | 400 | The confirm_token has expired (15 min). Ask for the preview again. |
CONFIRM_USED | 409 | That confirm_token was already used. |
INTERNAL | 500 | Internal error. It has been logged. |
What to do
- 401 (
UNAUTHENTICATED,CREDENTIAL_EXPIRED,CREDENTIAL_REVOKED,OWNER_INACTIVE): check the key or create a new one. Don't retry. - 403
MODULE_DISABLED: the organization doesn't have the "API & MCP" module. Talk to Autonex. FORBIDDEN,TENANT_MISMATCH,LOCATION_OUT_OF_SCOPE(inside the result): permissions or scopes are missing, or you asked for another organization or centre. Callwhoamito see yours;_meta.error.requiredsays which permission is missing.- 429 (
RATE_LIMITED): waitretry_afterseconds. (QUOTA_EXCEEDED): wait for next month or talk to Autonex. INVALID_INPUT: fix the arguments according toissues.CONFIRM_*: ask for the preview again.
Step-by-step diagnosis: FAQ → Troubleshooting.