Skip to main content
Every request to the PitPath Chrono API must include a valid API key. Keys are sent in the X-API-Key HTTP header and are scoped to a role that controls what operations the caller can perform.

How API key authentication works

When you make a request, Chrono reads the X-API-Key header, looks up the matching key, and checks whether the associated role permits the requested operation. There are no session cookies, no OAuth flows, and no bearer tokens — just the key in the header.
Keys are stored as hashed values. Once a key is created, the plain-text token is returned only once in the creation response. If you lose it, you must create a new key and revoke the old one.
Always store API keys in a secrets manager or environment variable. Never hard-code them in source code or check them into version control.

Getting an API key

Your first ADMIN key is provisioned when your license is created by the PitPath team. To create additional keys, use the API keys endpoint with a key that has at least CR role.
The response contains the key metadata and the one-time plain-text token:
Example response
The name field must be between 3 and 120 characters. Use a descriptive name so you can identify the key’s purpose when listing all keys later.

Roles

Every API key has exactly one role. Roles are cumulative — a higher role includes all permissions of lower roles.

Choosing the right role

  • Use R for dashboards, public leaderboards, or any integration that only needs to display data.
  • Use CR for sim rigs. When Chrono registers a rig, it auto-generates a CR key for that rig to submit laps.
  • Use CRUD for your primary results management software that needs to correct or delete records.
  • Use ADMIN only for your back-office tools that manage the license itself or provision other ADMIN keys.
A key can only assign roles up to its own level. An CRUD key cannot create an ADMIN key. Only ADMIN keys can assign any role freely.

Using a key in a request

Include the key in every request via the X-API-Key header. There is no separate login step.

Listing your API keys

To see all keys associated with your license, use a key with at least CR role:
The response is an array of key objects. Note that keyPrefix is returned (e.g. chrono_cr_) but the full token is never exposed after initial creation.

Rotating a key

To rotate a key, create a new one with the desired role, deploy it to your application, then revoke the old key. There is no in-place secret rotation — the token value is fixed at creation. Step 1 — Create the replacement key:
curl
Step 2 — Update your application to use the new token, then revoke the old key:
curl
A successful revocation returns 204 No Content.
Revocation is immediate and permanent. Make sure the new key is deployed and working before you delete the old one.

Common authentication errors

If you receive a 401 on a key you believe is valid, check the enabled field by listing your keys. A key can be disabled via PATCH /api/v1/api-keys/{apiKeyId} without being fully revoked.