Error handling in our the REST API is fully based on HTTP error codes. As a web developer, you are probably familiar with the most common ones: 401 Unauthorized, 404 Not Found or 500 Internal Server Error. The REST API uses those, along with a few more, to provide allow proper error handling.
The complete list of error codes used and the conditions in which they apply are specified in the reference documentation.
General error codes
As explained in the specifications, a A few error codes apply to most resources (if they are applicable)
...
Error handling in your REST implementation
It is up to you, in your client implementation, to handle those codes by checking if an error code (4xx or 5xx) was returned instead of an the expected 2xx or 3xx.