Create a new API token for programmatic access
This endpoint creates a new API token with specified permissions and configuration. The token value is returned only once - there is no way to retrieve it again, so store it securely immediately.
Token Creation Process
- Specify token name and type
- Define required permission scopes
- Set optional expiration period
- Add any metadata (IP restrictions, etc.)
- Receive token value - SAVE IT IMMEDIATELY
Token Types
- api: Standard tokens for API access
- Inherit user permissions (scoped down)
- Recommended for most use cases
- Maximum 1 year expiration
- service: Long-lived service account tokens
- For automated systems and CI/CD
- No expiration limit
- Requires admin approval
Permission Scopes
Tokens can only have permissions the creating user possesses:
experiments:read
- View experiment dataexperiments:write
- Create/modify experimentsreports:read
- Access reportstargets:read
- View target catalogtokens:write
- Manage tokens (dangerous!)users:read
- View user informationinvoices:read
- Access billing data
Security Best Practices
- Immediate Storage: Save the token value immediately and securely
- Minimal Scopes: Only grant necessary permissions
- Expiration: Set expiration for temporary access
- IP Whitelist: Use metadata to restrict by IP if possible
- Descriptive Names: Use clear names to identify purpose
- Regular Rotation: Rotate tokens periodically
Using Your Token
Include the token in API requests:
Authorization: Bearer sk_your_token_here
Important Warning
The token value is shown only once! If you lose it, you must create a new token. There is no way to recover a lost token value.
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
Request payload for creating a new API token
Specify the token configuration including permissions, expiration, and optional metadata.
Response
Token successfully created - SAVE THE TOKEN VALUE!
Response after creating a new API token
Contains the newly created token value. This is the ONLY time the token value is shown - store it securely!