Skip to main content

HTTP Response Codes

The Botsi API uses standard HTTP status codes to indicate the success or failure of an API request. In general:

  • 2xx codes indicate success.

  • 4xx codes indicate an error caused by the information provided (e.g., a missing parameter or invalid API key).

  • 5xx codes indicate an error on Botsi's servers.

Success Codes

CodeStatusDescription
200OKThe request was successful. The response body contains the requested data.
201CreatedThe request was successful and a new resource (like a Profile) was created.
204No ContentThe request was successful, but there is no representation to return (common for deletes or simple updates).

Client Error Codes (4xx)

These errors usually require a change on your side before retrying.

CodeStatusDescription
400Bad RequestThe request was unacceptable, often due to missing a required parameter (e.g., missing profileId or an empty custom array).
401UnauthorizedNo valid API Key was provided in the Authorization header.
403ForbiddenThe API Key is valid, but it doesn't have permissions for the requested resource.
404Not FoundThe requested resource (e.g., a specific customerUserId) does not exist.
422Unprocessable EntityThe request was well-formed but contains semantic errors (e.g., a string was provided where a number was expected).
429Too Many RequestsYou have hit the rate limit. Please slow down your requests.

Server Error Codes (5xx)

CodeStatusDescription
500Internal Server ErrorSomething went wrong on Botsi's end.
503Service UnavailableThe server is temporarily overloaded or down for maintenance.

Error Response Format

When an error occurs, the Botsi API returns a JSON object providing more detail about the failure. This helps your developers debug the issue quickly. Here's an example error payload:

{
"error": "Internal error",
"code": "PAYWALL_FETCH_FAILED"
}

Where:

  • error: A human-readable explanation of the error.

  • code: A machine-readable string identifying the error type.