Base URLhttps://ottla.ai/api/v1

Reference

Errors

Every error has a stable code; this page says what each means and what to do.

Updated 8 min read

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.

A signpost at a crossroads

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.

403 response
{
  "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:

422 response
{
  "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.

StatusDefault code
400bad_request
401unauthenticated
402payment_required
403forbidden
404not_found
405method_not_allowed
409conflict
410gone
413payload_too_large
415unsupported_media_type
422validation_failed
423locked
426module_upgrade_required
429rate_limited
5xxserver_error

Error codes

Keys and access

StatusCodeWhat it meansWhat to do
401unauthenticatedNo API key was sent.Send Authorization: Bearer with your key.
401invalid_api_keyThe key is unknown, revoked or expired.Create a new key under Storefront → API keys and swap it in.
403forbidden_scopeThe 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.
403ip_not_allowedThe 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.
403tenant_suspendedThe workspace isn’t active.Contact us.
403website_not_allowedIngestion 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.
403server_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.
403origin_not_configuredThe 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.
403origin_requiredNo Origin header was sent.From a server, send your storefront’s address as Origin.
403origin_invalidThe Origin header couldn’t be read.Send scheme://host with an optional port, such as https://shop.example.
403origin_not_allowedThe 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.
403not_authorisedA 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

StatusCodeWhat it meansWhat to do
402plan_limit_exceededThe 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.
402account_past_dueA 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.
402account_suspendedThe 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

StatusCodeWhat it meansWhat to do
404not_foundThe address or the item doesn’t exist.Check the path. Every endpoint is under /api/v1.
404invalid_feedbackFeedback 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.
409idempotency_key_reusedThe Idempotency-Key was used before with a different body.Use a new key for a new request.
409idempotency_in_flightA request with this key is still running.Wait a moment and retry with the same key.
409store_url_mismatchMagento 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.
413payload_too_largeThe request body is too large.Send smaller batches.
422validation_failedA field is missing or wrong. errors lists each one.Fix the fields named in errors.
422invalid_idempotency_keyThe Idempotency-Key breaks the format rules.Use 8 to 128 letters, digits, -, _, . or :.
422invalid_answer_idThe answer_id isn’t an answer from your workspace.Send the answer_id from your own /ask response.
422unsupported_event/track got an event name it doesn’t accept.Use one of the documented events.
426module_upgrade_requiredMagento only: the module is older than Ottla requires. Not in use today.Upgrade the module.
429rate_limitedThis key’s per-minute limit for the endpoint’s group. The body adds retry_after.Wait retry_after seconds, then retry.
429tenant_rate_limitedThe workspace’s limit across all its keys.Wait, then spread your traffic more evenly.
429ip_rate_limitedThe limit for one network address.Wait. From a server, see Rate limits on sending each shopper’s address.
429shopper_rate_limitedThe limit for one shopper.Wait retry_after seconds.
503feature_disabledOttla 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.
5xxserver_errorSomething 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.

ResponseWhereWhat it meansWhat to do
fallback: true with a refusal_reason/askThe 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/askThe assistant couldn’t answer just now.It’s safe to ask again.
status: "human_active"/askA person from your team is handling this chat.Send messages to /escalation/message instead.
Empty results with strategy: "disabled"Storefront readsThe assistant is paused for the workspace.Hide the row or suggestions. See When the assistant is paused.
202 with status: "ignored"/feedback, /trackA team member shopping as a customer. Not counted.Nothing.
204/attribution/ingestRevenue measurement isn’t on the workspace’s plan.Nothing. Orders aren’t recorded.
200 with stored: 0/search/eventsThe batch wasn’t stored.Nothing. Reporting never breaks your page.

Retrying

You gotDo this
429Wait retry_after seconds (or Retry-After, from a server), then retry.
503 feature_disabledRetry after Retry-After seconds.
5xxRetry with exponential backoff and a little random jitter, with the same Idempotency-Key.
409 idempotency_in_flightRetry after a short wait, with the same key.
402 during a catalogue syncStop until billing is resolved, then carry on from where you stopped.
Any other 4xxDon’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.

Try Ottla on your own store

Start a 14-day free trial with no card needed. The trial has every Pro feature, with lower limits, so you can install the module or the widget, connect your catalogue and try the assistant on your own products.

14 days free. No card needed.