Errors Handling & Exceptions

GAINSConnect API endpoints implement standard HTTP response codes for various error scenarios.

HTTP Response CodeDescription
400 Bad RequestRequests where the query parameters are missing or invalid
401 UnauthorizedAll endpoints where the user is not authenticated
403 ForbiddenAll endpoints where the user is authenticated but not authorized for that specific endpoints
404 Not FoundAttempting to access a route that does not exist
429 Too Many RequestsIndicates rate limiting thresholds have been surpassed for a particular endpoint

For certain types of errors, we will include a JSON payload such as:

HTTP 400 Bad Request
{
  "reason": "The webhook test attempt failed due {reason}"
}