Authentication and API keys
Get, reset and revoke a Drivetrain API key, and see exactly which of your Drivetrain permissions each API endpoint applies.
Every call to the Drivetrain API carries an API key in the apikey request header. The key belongs to one Drivetrain user, and every call runs as that user.
Send the key
Add the apikey header to every request. There's no token exchange, session or Authorization: Bearer header.
curl 'https://{your_subdomain}.drivetrain.ai/drive/api/v1/public/versions' \
--header 'apikey: {your_apikey}'Send the key exactly as copied.
Get your API key
Navigate to Settings > API Key.
Under Your API key, the key is masked except for its first and last 4 characters. Click the eye icon (Show key) to reveal it, or click Copy. The button changes to Copied.


Drivetrain creates your key the first time you open Settings > API Key. After that you see the same key every time you open it, until you reset it.
About keys
Format
A 32-character string of letters and digits.
Keys per user
One. Each Admin has their own key.
Acts as
The user who owns it. Calls have that user's Drivetrain access (see What the API applies from your permissions).
Scope
No scopes or read-only keys. A key can call every endpoint of the API.
Expiry
None. A key works until it's reset, its user is deactivated or loses the Admin role, or API access leaves your subscription.
Workspace
A key works only in the workspace it was created in.
Treat the key like a password. Anyone who has it can read your data and replace list rows as you.
Reset (rotate) a key
Navigate to Settings > API Key.
Click Reset Key.
The new key replaces the old one immediately, with no confirmation step. Every integration still using the old key starts getting 401 Unauthorized, so update them right after you reset.
Reset only changes your own key. To rotate with no downtime, use a second Admin user's key for the switch-over.
Revoke access
There's no separate revoke button. Depending on whose key it is:
Your own key
Click Reset Key and don't use the new one.
401 Unauthorized
Another user's key
Deactivate the user, or remove their Admin role.
401 (deactivated) or 403 Forbidden (no longer Admin)
If a deactivated user is reactivated, their old key works again. Reset it if it may have leaked.
What the API applies from your permissions
Every endpoint checks that the key's user has the Admin role, and returns 403 Forbidden if not. An Admin has access to every version and scenario. Beyond that, each endpoint applies the user's other Drivetrain access differently:
Admin role only. Returns every metric.
Admin role only. Returns values for every dimension value, even values the user's roles hide in Drivetrain.
Admin role only. Lists every dimension.
The user needs full access to the dimension. Otherwise 403, never a partial list.
Admin role only. Returns every version.
Returns the scenarios the user can access, which for an Admin is every scenario.
The user needs access to the list. Rows the user can't see aren't returned.
The user needs full access to the list, and no limited access to any dimension that's also a column of the list.
If someone must not see every value, don't give them the Admin role or an Admin's API key.
FAQ
Last updated
Was this helpful?