When an error occurs while performing a request to the REST API, all the responses contain an error and a message properties. The first one is a unique error code that never changes, and the second is a human-friendly error that helps to know what happened while debugging.
"message": "You have to provide both \"username\" and \"password\""
Error interpretation depends on the context and the endpoint. Every endpoint includes the documentation for its specific errors.
Depending on the error, a specific status code will be returned, using 400 for validation errors, 401 for authentication errors and 500 for other server or unexpected errors.