Reference
Errors
Every error has a stable code; this page says what each means and what to do.
On this page
Ottla API errors are designed to be acted on by code, not just read by people. Each one carries a short, stable error code you can branch on, and most tell you exactly what to change. A few responses look like problems but aren’t, such as a polite refusal from the assistant, so they’re listed here too.
Error format
Every error response is JSON with an error code and a readable message. Codes are stable; messages may be reworded, so branch on error. Some errors add fields, such as retry_after on a 429 or upgrade_url on a 402.
{
"error": "origin_not_allowed",
"message": "The request Origin is not on this API key's allowlist."
}
Validation errors add errors, keyed by field, with a list of problems for each:
{
"error": "validation_failed",
"message": "The items.3.sku field must be a string.",
"errors": {
"items.3.sku": ["The items.3.sku field must be a string."]
}
}
Every response, errors included, carries an X-Ottla-Request-Id header, which browser code can read too. Log it, and quote it when you contact us: it takes us straight to the call.
Codes by status
When an error has no more specific code, error holds the default for its status. If you meet a code you don’t recognise, fall back on the status.
| Status | Default code |
|---|---|
| 400 | bad_request |
| 401 | unauthenticated |
| 402 | payment_required |
| 403 | forbidden |
| 404 | not_found |
| 405 | method_not_allowed |
| 409 | conflict |
| 410 | gone |
| 413 | payload_too_large |
| 415 | unsupported_media_type |
| 422 | validation_failed |
| 423 | locked |
| 426 | module_upgrade_required |
| 429 | rate_limited |
| 5xx | server_error |
Error codes
Keys and access
| Status | Code | What it means | What to do |
|---|---|---|---|
| 401 | unauthenticated | No API key was sent. | Send Authorization: Bearer with your key. |
| 401 | invalid_api_key | The key is unknown, revoked or expired. | Create a new key under Storefront → API keys and swap it in. |
| 403 | forbidden_scope | The key doesn’t have the scope this endpoint needs. The message names it. | Use a key with that scope, such as your Storefront widget key for ask:read. |
| 403 | ip_not_allowed | The key is limited to other IP addresses. On /ask, with status: "hidden", the widget you named is limited to other networks. | Add your server’s address to the key, or hide the chat for this shopper. |
| 403 | tenant_suspended | The workspace isn’t active. | Contact us. |
| 403 | website_not_allowed | Ingestion only: the key is limited to one website, and the request names another website or another website’s store view. | Leave website_id out, or use a key for that website. |
| 403 | server_key_required | /attribution/ingest only: the key is one a web page may hold. | Report orders with a Storefront widget key marked Used by a store connector or another server and limited to your servers’ IP addresses. |
| 403 | origin_not_configured | The key has no allowed origins, so storefront endpoints refuse it from anywhere. | Add your storefront’s address to the key, even if only your server calls. |
| 403 | origin_required | No Origin header was sent. | From a server, send your storefront’s address as Origin. |
| 403 | origin_invalid | The Origin header couldn’t be read. | Send scheme://host with an optional port, such as https://shop.example. |
| 403 | origin_not_allowed | The Origin isn’t one of the key’s allowed origins. | Add it to the key, or fix the mismatch: www, http and ports all count. |
| 403 | not_authorised | A live chat call used a wrong or closed channel_secret. It deliberately doesn’t say which. | Stop polling and offer a new handoff. |
Authentication and API keys and allowed origins explain keys, scopes and origins in full.
Billing
| Status | Code | What it means | What to do |
|---|---|---|---|
| 402 | plan_limit_exceeded | The monthly answered questions and any credits are used up. The body adds metric, used, limit and upgrade_url. | Hide the chat. It comes back when credits are added, the plan changes or the month resets. |
| 402 | account_past_due | A payment is overdue, or a free trial ended without a plan. | The workspace owner resolves it at upgrade_url. Feedback, events and handoffs keep working meanwhile. |
| 402 | account_suspended | The account is suspended. | Resolve billing at upgrade_url, or contact us. |
Only answers from /ask use the monthly allowance. When it and your credits run out, the assistant pauses: /ask answers plan_limit_exceeded and storefront reads return empty results until it resumes, while feedback and events carry on. Plans and allowances are on the pricing page.
Requests and limits
| Status | Code | What it means | What to do |
|---|---|---|---|
| 404 | not_found | The address or the item doesn’t exist. | Check the path. Every endpoint is under /api/v1. |
| 404 | invalid_feedback | Feedback detail was sent with a wrong id, or a session_id that doesn’t match the vote. | Send the id from POST /feedback and the same session_id. |
| 409 | idempotency_key_reused | The Idempotency-Key was used before with a different body. | Use a new key for a new request. |
| 409 | idempotency_in_flight | A request with this key is still running. | Wait a moment and retry with the same key. |
| 409 | store_url_mismatch | Magento only: a copy of the store is syncing from a different address than the one connected. | Use Re-authorise on the store that should be connected. |
| 413 | payload_too_large | The request body is too large. | Send smaller batches. |
| 422 | validation_failed | A field is missing or wrong. errors lists each one. | Fix the fields named in errors. |
| 422 | invalid_idempotency_key | The Idempotency-Key breaks the format rules. | Use 8 to 128 letters, digits, -, _, . or :. |
| 422 | invalid_answer_id | The answer_id isn’t an answer from your workspace. | Send the answer_id from your own /ask response. |
| 422 | unsupported_event | /track got an event name it doesn’t accept. | Use one of the documented events. |
| 426 | module_upgrade_required | Magento only: the module is older than Ottla requires. Not in use today. | Upgrade the module. |
| 429 | rate_limited | This key’s per-minute limit for the endpoint’s group. The body adds retry_after. | Wait retry_after seconds, then retry. |
| 429 | tenant_rate_limited | The workspace’s limit across all its keys. | Wait, then spread your traffic more evenly. |
| 429 | ip_rate_limited | The limit for one network address. | Wait. From a server, see Rate limits on sending each shopper’s address. |
| 429 | shopper_rate_limited | The limit for one shopper. | Wait retry_after seconds. |
| 503 | feature_disabled | Ottla has paused this capability for a short time. The body adds help_url, our status page, and Retry-After is 120 seconds. | Check the status page and retry after Retry-After. |
| 5xx | server_error | Something went wrong on our side. | Retry with backoff and the same Idempotency-Key. If it persists, quote the request id. |
Responses that are not errors
These come back with a success status. Handle them and your storefront will never look broken.
| Response | Where | What it means | What to do |
|---|---|---|---|
fallback: true with a refusal_reason | /ask | The assistant didn’t answer, and says why. | Show the message, and offer a person or a search. See Refusal reasons. |
fallback: true, an error block with retry: true, no refusal_reason | /ask | The assistant couldn’t answer just now. | It’s safe to ask again. |
status: "human_active" | /ask | A person from your team is handling this chat. | Send messages to /escalation/message instead. |
Empty results with strategy: "disabled" | Storefront reads | The assistant is paused for the workspace. | Hide the row or suggestions. See When the assistant is paused. |
202 with status: "ignored" | /feedback, /track | A team member shopping as a customer. Not counted. | Nothing. |
204 | /attribution/ingest | Revenue measurement isn’t on the workspace’s plan. | Nothing. Orders aren’t recorded. |
200 with stored: 0 | /search/events | The batch wasn’t stored. | Nothing. Reporting never breaks your page. |
Retrying
| You got | Do this |
|---|---|
429 | Wait retry_after seconds (or Retry-After, from a server), then retry. |
503 feature_disabled | Retry after Retry-After seconds. |
5xx | Retry with exponential backoff and a little random jitter, with the same Idempotency-Key. |
409 idempotency_in_flight | Retry after a short wait, with the same key. |
402 during a catalogue sync | Stop until billing is resolved, then carry on from where you stopped. |
Any other 4xx | Don’t retry unchanged. Fix the request first. |
Retries are only safe when a repeat can’t do the work twice. Send an Idempotency-Key from your server on every write, and you never have to wonder.
FAQ
Questions developers ask
Should I branch on the message?
No. Branch on error, and fall back on the HTTP status for a code you don’t know. Messages are written for people and may change.
What does account_past_due mean for my storefront?
The assistant, search, recommendations and catalogue updates stop answering until the payment is made or a plan is chosen. Feedback, events and handoffs keep flowing, so you don’t lose data.
What is feature_disabled?
Ottla has paused that capability for a short time, for example during an incident. Check the status page and retry after Retry-After seconds.
What does 409 store_url_mismatch mean?
A copy of a Magento store, such as a staging site, is syncing from a different address than the one connected. Use Re-authorise on the store that should be connected.
Related
Rate limits
Per-minute allowances and how to handle a 429.
Authentication
Send your key and pick the right scopes.
API keys and allowed origins
Fix origin errors for good.
Idempotency
Retry writes without doing the work twice.
Status
Incidents and planned maintenance.