The responses to API calls from Cleo use the HTTP status code convention to indicate whether the call was successful or failed.
| Code | Meaning | Description |
|---|---|---|
| 200 | OK | The request was successful |
| 201 | Created | The call was successful, and a new object or group of objects was created |
| 400 | Bad Request | The request contains invalid information and shouldn't be repeated |
| 401 | Unauthorized | You did not provide the API Key in the header of the request, or it was formatted incorrectly |
| 403 | Forbidden | Based on the API Key you provided in the header, you do not have permission to make this type of call |
| 404 | Not Found | According to the API Key provided in the header, the resource does not exist. This may also indicate that you are not allowed to make this type of call |
| 500 | Internal Server Error | Our servers stumbled upon a problem and we are working non-stop to solve it |
Errors usually include more details in the response body, in the properties statusCode, message, and error. The statusCodeand errorcorrespond to the Code and Meaning sections in the table above, while the message contains more information about the error, such as missing or incorrect parameters, as an example.
Below is an example of an error callback:
{
"statusCode": "NNN",
"message": ["ERROR"],
"error": "string"
}