REST API errors and limits
The error format, the list of codes you can receive and the rate limits of the Botello REST API.
- Plans
- All plans
- Roles
- Owner, Admin
When a request fails, the REST API responds with an HTTP status and a JSON body containing a stable error code. Your integration should rely on this code, never on the message text. This page lists the possible codes and the rate limits, with what to do for each.
Writing a robust integration: retries at the right time, clear messages in your logs, no loop that drains your quota.
Before you start
- You call the API with a key: see API keys.
Error format
{
"error": "Cette clé n'a pas le droit « write »",
"code": "API_KEY_SCOPE_MISSING",
"scope": "write"
}Prop
Type
{
"error": "Données invalides",
"code": "VALIDATION_ERROR",
"details": [
{ "path": "sessionId", "message": "sessionId: 1-64 letters, digits, _ or -" }
]
}A few responses have no code: an unreadable JSON body (400, with only error) and an internal error (500, “Erreur interne du serveur”). Handle them by HTTP status.
Error codes
| HTTP | code | Meaning | What to do |
|---|---|---|---|
| 400 | VALIDATION_ERROR | A parameter or field breaks the rules | Fix the request based on details. Do not retry it unchanged |
| 400 | URL_INVALID | Malformed URL, or a protocol other than http(s) (POST /knowledge/urls) | Fix the URL |
| 400 | URL_NOT_PUBLIC | The URL points to a private network address | Use a public address |
| 400 | URL_UNRESOLVABLE | The URL’s domain does not resolve | Check the domain |
| 401 | API_KEY_INVALID | Missing, malformed, unknown or revoked key | Check the key. Do not retry in a loop |
| 403 | API_KEY_SCOPE_MISSING | The key lacks the required scope (scope says which) | Use a key with that scope |
| 404 | NO_CHATBOT | The workspace has no assistant | Contact the Botello team |
| 404 | CONVERSATION_NOT_FOUND | Unknown conversation, from another workspace, a test one, or an ID that is not a UUID | Check the ID |
| 404 | CONTACT_NOT_FOUND | Unknown contact, from another workspace, or an ID that is not a UUID | Check the ID |
| 409 | CHATBOT_INACTIVE | The assistant is disabled (POST /chat/messages) | Re-enable it in the admin |
| 429 | RATE_LIMITED | Too many requests for this key | Wait, then retry (see below) |
| 429 | QUOTA_EXCEEDED | The workspace’s message quota is reached (POST /chat/messages) | Wait for the quota to renew, or change plan |
| 500 | — | Internal error | Retry later with increasing delays; write to support@botello.ch if it persists |
Conversation and contact IDs are UUIDs. An ID that does not have this format in GET /conversations/{id}/messages or GET /contacts/{id} is treated as an unknown ID: 404 CONVERSATION_NOT_FOUND or 404 CONTACT_NOT_FOUND.
Rate limits
| Limit | Value | Scope |
|---|---|---|
All /api/v1 routes | 120 requests per minute | Per key |
POST /chat/messages | 20 messages per minute, on top of the limit above | Per key |
| Global Botello API limit | 1000 requests per 15 minutes | Per IP address |
Beyond that, the API responds 429 with "code": "RATE_LIMITED" and a Retry-After header: the number of seconds to wait. Responses also carry the IETF draft rate-limit headers:
RateLimit: limit=120, remaining=87, reset=42for the per-key limit (forPOST /chat/messages, the 20-messages-per-minute one);RateLimit-Policy: 120;w=60, the limit and its window in seconds, for that same per-key limit;RateLimit-Limit,RateLimit-RemainingandRateLimit-Resetfor the global per-IP limit.
To know when to retry, read Retry-After first.
Messages sent via POST /chat/messages also count towards your workspace’s message quota, just like widget messages.
Retrying correctly
- Do not retry
400,401,403,404and409: the same request will fail again. - Retry
429and5xx, with a delay that grows on each attempt, and a maximum number of attempts. - Additions (
POST /knowledge/…) are not idempotent: a retry after a network failure can create a duplicate. Check withGET /knowledge/sourcesbefore creating again.
async function botello(path, init = {}, attempt = 0) {
const res = await fetch(`https://api.botello.ch/api/v1${path}`, {
...init,
headers: {
Authorization: `Bearer ${process.env.BOTELLO_API_KEY}`,
'Content-Type': 'application/json',
...init.headers,
},
});
if (res.ok) return res.json();
const body = await res.json().catch(() => ({}));
const retryable = res.status === 429 || res.status >= 500;
if (retryable && body.code !== 'QUOTA_EXCEEDED' && attempt < 4) {
// Retry-After (seconds) first, otherwise 2 s, 4 s, 8 s, 16 s.
const retryAfter = Number(res.headers.get('Retry-After'));
const delayMs = retryAfter > 0 ? retryAfter * 1_000 : Math.min(60_000, 2 ** attempt * 2_000);
await new Promise((r) => setTimeout(r, delayMs));
return botello(path, init, attempt + 1);
}
throw Object.assign(new Error(`Botello ${res.status} ${body.code ?? ''}`), { status: res.status, code: body.code });
}Troubleshooting
| What you see | Likely cause | Fix |
|---|---|---|
Bursts of 429 during an import | More than 120 requests per minute | Space out your calls: one request every 0.5 s is enough |
429 QUOTA_EXCEEDED on chat | The workspace’s message quota is used up | See SettingsWorkspaceUsage |
400 without code | Malformed JSON body | Check the JSON and the Content-Type: application/json header |
| Your code breaks when the error message changes | It compares the error text | Compare code |
Frequently asked questions
Learn more
REST API endpoints
The reference for every route of the Botello REST API, with its parameters, required scope, and an example request and response.
See who changed what in your integrations
The change history records every creation, change, test, secret display or secret rotation in your webhooks, API actions and developer settings.