Skip to main content

Responses and errors

The methods from our API can return different responses and codes. These are the ones that are common to all of them.

OK (200 status code)

Methods return an OK response code when the request is valid. Each method has its own set of responses that are described in the associated documentation.

Unauthorized (401 status code)

If the request is unauthorized, the method returns a Unauthorized response code with an emply response body.

Bad Request (400 status code)

If the request is invalid, the method returns a Bad Request response code with an errors array included in the response body. Here is an example:

{
"errors": [
"Foo is required"
]
}

Not Found (404 status code)

If the resource associated with the request does not exist, the method returns a Not Found response code with an errors array included in the response body. Here is an example:

{
"errors": [
"Foo is not found"
]
}

Internal Server Error (500 status code)

If there is any error processing the request, the method returns an Internal Server Error response code with an errors array included in the response body. Here is an example:

{
"errors": [
"The application has encountered an unknown error"
]
}