If an error occurs, the API will respond with the appropriate HTTP status code and an error message object which contains an error code and a humanly readable message.

List of error codes

Error codeHTTP status codeMeaning
bad_request400 Bad RequestThe request was malformed.
invalid_<parameter>400 Bad RequestThe request was malformed. The query parameter parameter contains an invalid value.
unauthorized401 UnauthorizedInvalid credentials were used to authenticate the request.
permission_denied403 ForbiddenPermission to the requested resource was denied. This often means that a request should have been authenticated but was not.
insufficient_permissions403 ForbiddenThe authentication used does not have the required permissions to access the requested resource. Make sure the authentication was performed with the necessary scope.
not_purchased403 ForbiddenThe premium resource you’re trying to access has not been purchased by the authenticated user.
not_found404 Not FoundThe requested resource does not exist or is not publicly available.
rate_limit_exceeded429 Too Many RequestsAPI request rate limit exceeded.

Known CORS issues

Sometimes calling the API from a browser fails during the CORS preflight request:
Reponse to preflight request doesn't pass access control check: It does not have HTTP ok status.

This can be solved by supplying Authorization header to the CORS preflight request.