Docs
Esc

Rate limits and errors

How many requests the API accepts, what happens when you send too many, and how errors are returned.

Rate limits#

The API counts requests in rolling one-minute windows. When you go over the limit, it answers with HTTP status 429 Too Many Requests and doesn't run the query.

To stay within the limit:

  • Use webhooks instead of polling. HirePass tells you when a check is requested and when the applicant submits information. See Working with webhooks.
  • Fetch in one request. Use Fetch all results at once rather than one request per check element.
  • Back off on 429. Wait until the minute has passed, then retry. If you get 429 again, double the wait before the next retry.

If your integration needs a higher limit, for example to import a large cohort, email [email protected] with the expected volume.

How errors are returned#

The API follows the GraphQL convention: errors come back in an errors array in the response body, next to any data that could be returned.

{
  "errors": [
    {
      "message": "Unauthorized",
      "extensions": {
        "code": "UNAUTHORIZED"
      }
    }
  ],
  "data": null
}
  • message says what went wrong in plain words. Log it, and don't show it to applicants.
  • extensions.code is a code you can use in your own logic.

Error codes#

CodeWhat it meansWhat to do
UNAUTHORIZEDThe API key is missing, wrong or revokedCheck the header is Authorization: Bearer hp_client_token_… and that the key is Active in Workspace
FORBIDDENThe key is valid but can't do this actionCheck the record belongs to your organisation
NOT_FOUNDThe check, package or record doesn't exist in your organisationCheck the reference, such as the externalId
BAD_REQUESTThe request couldn't be processed as sentCheck the fields and values in your query
VALIDATIONOne or more fields failed validationRead message: it lists the fields to fix
GRAPHQL_VALIDATION_FAILEDThe query asks for a field or argument that doesn't existCompare your query with the examples in these docs
INTERNAL_SERVER_ERRORAny other error. The message says what to fix, for example "Unauthorized" or a list of invalid fieldsFix what the message names. If it reads "Unable to process your request at this time.", retry after a short wait

HTTP statuses#

Most errors return HTTP 200 with the errors array, so always check the body. Errors with one of the HirePass codes above also set the matching status, such as 401 for UNAUTHORIZED or 404 for NOT_FOUND.

StatusWhen
200The request reached the API. Check the body for errors
400The body isn't valid JSON or GraphQL, or a BAD_REQUEST or VALIDATION error
401, 403, 404UNAUTHORIZED, FORBIDDEN, NOT_FOUND
429Too many requests, see Rate limits
5xxA temporary problem on our side. Retry with backoff, and check HirePass status

If an error persists, email [email protected] with the time of the request, the query name and the message you received. Never send your API key.