Skip to Content
GuidesDevelopersResources
REST API

REST API errors and limits

The error format, the list of codes you can receive and the rate limits of the Botello REST API.

On requestThe Botello team turns this feature on for your workspace. Contact us to get it.
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.

Best for

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

Example: 403
{
  "error": "Cette clé n'a pas le droit « write »",
  "code": "API_KEY_SCOPE_MISSING",
  "scope": "write"
}

Prop

Type

Example: 400 VALIDATION_ERROR
{
  "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

HTTPcodeMeaningWhat to do
400VALIDATION_ERRORA parameter or field breaks the rulesFix the request based on details. Do not retry it unchanged
400URL_INVALIDMalformed URL, or a protocol other than http(s) (POST /knowledge/urls)Fix the URL
400URL_NOT_PUBLICThe URL points to a private network addressUse a public address
400URL_UNRESOLVABLEThe URL’s domain does not resolveCheck the domain
401API_KEY_INVALIDMissing, malformed, unknown or revoked keyCheck the key. Do not retry in a loop
403API_KEY_SCOPE_MISSINGThe key lacks the required scope (scope says which)Use a key with that scope
404NO_CHATBOTThe workspace has no assistantContact the Botello team
404CONVERSATION_NOT_FOUNDUnknown conversation, from another workspace, a test one, or an ID that is not a UUIDCheck the ID
404CONTACT_NOT_FOUNDUnknown contact, from another workspace, or an ID that is not a UUIDCheck the ID
409CHATBOT_INACTIVEThe assistant is disabled (POST /chat/messages)Re-enable it in the admin
429RATE_LIMITEDToo many requests for this keyWait, then retry (see below)
429QUOTA_EXCEEDEDThe workspace’s message quota is reached (POST /chat/messages)Wait for the quota to renew, or change plan
500—Internal errorRetry 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

LimitValueScope
All /api/v1 routes120 requests per minutePer key
POST /chat/messages20 messages per minute, on top of the limit abovePer key
Global Botello API limit1000 requests per 15 minutesPer 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=42 for the per-key limit (for POST /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-Remaining and RateLimit-Reset for 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, 404 and 409: the same request will fail again.
  • Retry 429 and 5xx, 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 with GET /knowledge/sources before creating again.
Call with retries
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 seeLikely causeFix
Bursts of 429 during an importMore than 120 requests per minuteSpace out your calls: one request every 0.5 s is enough
429 QUOTA_EXCEEDED on chatThe workspace’s message quota is used upSee SettingsWorkspaceUsage
400 without codeMalformed JSON bodyCheck the JSON and the Content-Type: application/json header
Your code breaks when the error message changesIt compares the error textCompare code

Frequently asked questions

Learn more

Was this page helpful?
Checked against the product on 14 November 2026 Suggest a fix

On this page