Our goal is to make API errors easy to parse, understand, and react to. Error responses that correspond to this standard will always be in JSON and have an error key with a snake_case error.type field that is machine-readable. There will also often be a human-readable description of the error in English on the error.message field. There may be additional fields on this error object as well to provide even greater detail about the error. For example:

{
    "error": {
        "type": "invalid_request",
        "message": "One or more of your request body parameters were invalid",
        "requestErrors": [
            {
                "code": "invalid_type",
                "expected": "number",
                "received": "undefined",
                "path": [
                    "startTime"
                ],
                "message": "Required"
            }
        ]
    }
}
Error TypeHTTP Code
invalid_request400
unauthorized_access401
api_permission_denied403
rate_limit_exceeded429
internal_error500
asset_not_found400
asset_type_not_supported400
asset_permission_denied403
earnings_not_found404
market_permission_denied403
resource_not_found404