Docs
Esc

Working with the GraphQL API

Our API uses GraphQL, which gives you flexibility and control when you work with compliance data. If you are new to GraphQL, this guide covers the essentials.

What is GraphQL?#

GraphQL is a query language for APIs. It gives you precise control over the data you retrieve from a server. With a traditional REST API you call a different endpoint for each kind of data. With GraphQL you fetch exactly what you want in one request.

Why use GraphQL?#

  • Efficiency: Ask for only the data you need.
  • Flexibility: Fetch multiple related resources in a single request.
  • Ease of use: Simple queries that return predictable results.

If you are new to GraphQL, we recommend this beginner-friendly resource:

The next section shows how to use it with HirePass.

How GraphQL queries work#

Once your account is authenticated, you can build your first GraphQL query.

A basic query is structured like this:

Basic GraphQL query structure#

  1. Start with a query or mutation keyword: Queries fetch data and mutations modify it.
  2. Specify the fields you want: You choose which fields to return, which cuts out unnecessary data.
  3. Send the request: The API returns only the data you asked for.

Example

query ListCheckRequests {
    listCheckRequests {
        items {
            externalId
            progressStatus
            applicant
        }
        total
        page
        pageSize
    }
}

In this example:

  • We ask for all check requests from your organisation.
  • We request specific fields: externalId, progressStatus and the associated applicant's name.

Try it yourself#

Go to API key for your credentials, then to the GraphQL playground, where you can write and test queries in real time.