Skip to content
  • There are no suggestions because the search field is empty.

API Reference

Get started with the ONE RACEHUB GraphQL API to connect to your dedicated endpoint, authenticate securely, and query, mutate, or subscribe to live data.

Overview

Each customer is hosted on a dedicated server in the PACETEQ cloud. Every server provides a GraphQL API endpoint that allows you to query data, perform mutations, and subscribe to live updates.
 
Your GraphQL endpoint follows the format below:
 
https://<customer-acronym>.oneracehub.net/graphql 
 
Example: For a user acronym of demo, the endpoint is: 
 
https://demo.oneracehub.net/graphql
  • Opening this URL in a browser launches the Apollo Studio Playground
  • Click Query your server to open the GraphQL Sandbox
 api-playground
 
The left-hand panel displays the schema documentation. Click query, mutation, or subscription to browse all available operations and their schemas. 

Check the API Connection

Use the version query to confirm the API is reachable. This query does not require authentication. 

Request:
query Version {
version
}

If the request succeeds, the server returns an HTTP 200 response together with the current server version.

Authenticate

ONE RACEHUB API issues tokens once the user is logged in.
 
  •  All queries and mutations except login require a valid authentication token. Tokens are issued via the login mutation and are valid for 7 days
Request:
mutation Login {
login(username: "your-username", password: "your-password") {
  token
}
}

Expected response:

{
  "data": {
    "login": {
    "token": "~236 characters long string"
    }
  }
}

Once you have the token, pass it in the HTTP request header for all subsequent calls. The header key is Authorization

Verify Authentication

Use the whoami query to confirm you are logged in and the token is working correctly. It returns the username of the account you are currently logged in with.

Request:

query WhoAmI {
whoami {
  person {
    username
  }
}
}
Expected response:
{
"data": {
  "whoami": {
    "person": {
      "username": "your-username"
    }
  }
}
}

Query Data 

GraphQL allows you to nest multiple related data requests in a single query.

Example: Retrieve all race series with seasons and events

query RaceSeriesAll {
  raceSeriesAll {
    items {
      name
      seasons {
        name
        events {
          name
        }
      }
    }
  }
}

Example: Filter by race series name

Use the _operators filter to narrow results. The following query returns only the DTM and Formula 3 series:

query RaceSeriesAll {
  raceSeriesAll(filter: {_operators:  {
     name:  {
        in: ["DTM", "Formula3"]
     }
  }}) {
    items {
      name
      seasons {
        name
        events {
          name
        }
      }
    }
  }
}

ⓘ Array queries support both direct filters and _operators for more advanced filtering within lists.

Subscribe to Live Updates

Subscriptions deliver real-time events whenever data changes in the database.

For example, the following subscription listens for newly created jobs:

subscription JobAdded {
  jobAdded {
    _id
    description
  }
}

This subscription triggers every time a job is added to the database and returns the requested fields (_id and description). 

If you already know a job ID, you can subscribe to updates for that specific job.

subscription JobUpdated($jobID: MongoID) {
  jobUpdated(jobID: $jobID) {
  _id
  description  
  }
}

Accessing the API with Excel / VBA

PACETEQ provides an Excel/VBA template with a built-in function to retrieve a login token from your endpoint and make API calls directly from your spreadsheet. Contact our Support Team to request the template.