Skip to content

Search the documentation by title, section, or page text.

HTTP Response Codes

The Botsi API uses standard HTTP status codes. 2xx means success, 4xx means something in your request needs changing, and 5xx means the failure was on Botsi's side.

Success#

CodeStatusMeaning
200OKThe request succeeded. The body carries the requested data
201CreatedThe request succeeded and created a resource, such as a Profile
204No ContentThe request succeeded with nothing to return

Client errors#

These need a change on your side before retrying. Retrying without changing anything produces the same result.

CodeStatusMeaning
400Bad RequestA required parameter is missing: no profileId, or an empty custom array
401UnauthorizedNo valid API key in the Authorization header
403ForbiddenThe key is valid but lacks permission for that resource
404Not FoundThe resource does not exist
422Unprocessable EntityWell-formed but semantically wrong: a string where a number was expected
429Too Many RequestsRate limited. Slow down

429 is the one exception to "change something first": back off and retry.

Server errors#

CodeStatusMeaning
500Internal Server ErrorSomething went wrong on Botsi's end
502Bad GatewayInvalid response from the upstream application. Retry with backoff
503Service UnavailableTemporarily overloaded or down for maintenance
504Gateway TimeoutThe upstream application did not respond in time. Retry with backoff

A failed Fetch Paywall should fall back, not block

Retrying a 5xx with backoff is correct for events and validation, where the data matters and arriving late is fine.

It is the wrong behavior in front of a user waiting on a Paywall. Serve your baseline variant instead. See AI Pricing Model API.

Error response format#

Errors return a JSON object with a human-readable message and a machine-readable code:

{
  "error": "Server Error.",
  "code": "internal_server_error"
}

Branch on code. It mirrors the status — bad_request, not_found, internal_server_error — so it identifies the class of failure, not the specific cause. The error string carries the detail, and is for humans reading logs rather than for branching on.