The header
Send your key as a bearer token:X-Api-Key header is also accepted with the same value:
Authorization: Bearer — it is what the API Reference playground uses and what most HTTP clients handle natively.
Key format
ont_ plus eight hex) are the public prefix. OnTime indexes on it to find the key row, then verifies the full value against a stored hash.
The prefix is not secret and is safe to log — it identifies which key was used without revealing it. The remaining 32 characters are the secret.
Issuing a key
In the admin console: API & webhooks → Issue key. Requires theapi:manage permission.
Revoking
Immediate — a revoked key is refused on its next request with401.
There is no rotate action. To rotate without downtime: issue a new key, deploy it to your consumer, confirm it works, then revoke the old one.
Scopes
A key is issued with a scope ofReadOnly or ReadWrite.
This is deliberate. Granting employee:write to a credential with nothing to write it against would mean that the day a write route is mounted under a path a key can reach, every ReadWrite key ever issued silently acquires it — retroactively, with no reissue and no audit trail.
What a key acts as
A key belongs to an organization, not to a person.- Every request under a key is scoped to that organization. There is no way to reach another organization’s data with it.
- The key’s permissions come from its scope, not from any employee’s role.
- Requests are attributed in logs to the key, not to a user.
This differs from the MCP server, where a key is bound to a specific employee and acts with exactly that employee’s permissions and scope. If you need an integration that acts as a person — respecting their approval scope — that is MCP’s model, not the REST API’s. See the AI & MCP tab.
Session-cookie authentication
The non-public routes under/api/* authenticate differently: a signed, httpOnly session cookie set at login, checked on every request against a live session record.
This is what the OnTime web and mobile apps use. It is stateful — revoking a session takes effect immediately rather than waiting for a token to expire.
Handling keys safely
1
Never commit one
Environment variables or a secrets manager. The
ont_ prefix makes keys easy to detect in secret-scanning tools — use one.2
One key per consumer
So you can revoke a single integration without breaking every other one, and so the last-used timestamp tells you something.
3
Log the prefix, never the key
The first twelve characters identify which key was used and are safe to record.
4
Revoke on personnel change
A key does not belong to a person, so nothing revokes it automatically when someone leaves.