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. Check code for the specific cause. See Domain codes
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. For most errors it mirrors the status (bad_request, not_found, internal_server_error), so it identifies the class of failure. Some V2 endpoints return a domain code in its place, which names the specific cause. The error string carries the detail, and is for humans reading logs rather than for branching on.

A 400 lists every validation failure in error, separated by commas. A 5xx reads Server Error., whatever went wrong, unless it carries a domain code. A 5xx with a domain code, such as 503 purchase_verification_unavailable, carries its own message.

Domain codes#

CodeStatusReturned byMeaning
invalid_store_purchase400Validate Apple Store Purchase, Validate Google Play Store PurchaseThe store doesn't recognize the purchase, the purchase doesn't grant access, or (App Store) the Product's period in Botsi doesn't match the purchase type in App Store Connect. Final for that purchase: sending it again unchanged returns the same code. For a period mismatch, correct the Product's period in the dashboard, then validate again
purchase_verification_unavailable503Validate Google Play Store PurchaseThe store didn't give a usable answer. Botsi keeps the purchase and retries it on its own
store_configuration_invalid503Validate Google Play Store PurchaseThe app's store credentials or permissions aren't working. Botsi keeps the purchase and processes it once the setup is fixed