Skip to content

API overview

The Temprix API is GraphQL over the same schema the product runs on. Almost anything visible in the app can be read or changed through the API. A few operations expect a signed-in session instead of a key: key management, billing and subscription changes, and other actions where someone in the app is required.

Each data region has its own endpoint. Send requests to the one your workspace lives in.

Region Endpoint
US East (N. Virginia) https://graphql.use1.temprix.app/graphql
EU Central (Frankfurt) https://graphql.euc1.temprix.app/graphql

A workspace’s region is chosen when the workspace is created and cannot be changed. You can see it on Workspaces. Where data is stored and processed is described on Security.

Send the key as the whole value of the Authorization header, with no Bearer prefix:

Authorization: tpx_eyJ2IjoxLCJrIjoi...

A key acts as the member who created it, with that member’s permissions, narrowed by the key’s scope. A key is read-only unless it was created with write access. Creating, scoping and revoking keys is on API keys.

  1. In the app, create a key under Settings → API keys and copy it. It is shown once.
  2. Send a query to your region’s endpoint:
Terminal window
curl https://graphql.euc1.temprix.app/graphql \
-H "Content-Type: application/json" \
-H "Authorization: $TEMPRIX_API_KEY" \
-d '{"query":"{ members { items { id displayName baselineAvailability } nextToken } }"}'
  1. Read the response:
{
"data": {
"members": {
"items": [
{
"id": "1024",
"displayName": "Marieke Janssen",
"baselineAvailability": 1.0
},
{
"id": "1025",
"displayName": "Tomás Ruiz",
"baselineAvailability": 0.8
}
],
"nextToken": null
}
}
}

Every list comes back in this shape: the records in items, and a nextToken that is null on the last page. Keep requesting until it is null. The loop is on Conventions.

Check for an errors array on every response, including ones with HTTP status 200. What each error means, and what to do about it, is also on Conventions.

  • API keys: create, scope, send and revoke keys.
  • Conventions: errors, rate limits, paged lists and date ranges.
  • Schema: how the types fit together, and the full reference.
  • Examples: worked integrations, such as who is out on a given day, or writing approved leave in from an HR system.