Authentication
Ptolemy uses long-lived robot tokens for API access. Robot users are service accounts designed for machine-to-machine integration — they authenticate on every request via a Bearer token and don't require a login flow.
How it works
Every API request must include a valid robot token in the Authorization header. There is no session, no cookie, and no refresh flow — the token is the only credential.
If the token is missing, expired, or revoked, the API returns 401 Unauthorized. If the token is valid but the robot user’s role lacks permission for the operation, the API returns 403 Forbidden.
Robot users
A robot user is a service account tied to a single workspace. Robot users are created by a workspace Admin, either through the dashboard (Workspace Settings → API Tokens) or via the API.
Each robot user has a display_name, an optional description, and a role that determines what operations it can perform.
Roles & permissions
Robot users are restricted to two roles. The Editor and Admin roles are reserved for human users.
Use Viewer for read-only integrations like dashboards or reporting tools. Use Member for integrations that need to create or modify data.
Token management
A robot user can have multiple tokens, allowing you to rotate credentials without downtime. Tokens have a ptk_live_ prefix and are 64 characters of hex after the prefix.
token_suffix for identification in the dashboard and API responses.Token lifecycle
Tokens can be in one of three states:
expires_at date has passed. Requests return 401. Create a new token to restore access.Error responses
Authentication-related errors: