The API uses standard HTTP status codes to indicate the success or failure of a request. Successful requests typically return a 2xx status code, while client errors return 4xx codes, and server errors return 5xx codes. For instance, a 200 OK indicates a successful response, 400 Bad Request points to an issue with the input data, and 500 Internal Server Error signals a problem on the server side. In the event of an error, the API responds with a JSON structure that provides more detailed information. A typical error response might look like this:
{
  "error": {
    "status": 400,
    "code": "invalid_payload",
    "title": "Invalid request parameters"
  }
}
NameTypeDescription
statusnumberHTTP status code generated by the origin server for this occurrence of the error
codestringAn API specific code representing the type of error
titlestringA short, human-readable summary of the error type
detailstring or objectA best effort human readable explanation specific to this occurrence of the error
By properly handling these error responses, you can ensure your application gracefully recovers from issues or provides useful feedback to the user. If you’re using one of our official SDKs, error handling is made even simpler. The SDKs automatically capture and interpret the API’s error responses and provide a convenient, structured way to handle them within your code. This means you can focus more on building your application and less on managing low-level error handling logic.