Creating and Managing API Tokens¶
To authenticate with the Aegis API, you need an API token. You can create and manage tokens in the Aegis web console:
-
Navigate to API Tokens
In the left sidebar, go to Settings > API Tokens. -
Create a New Token
Click the + Create New Token button. -
Fill in Token Details
- Token Name: Enter a descriptive name (e.g.,
CI/CD
,Personal
,Read-only
). - Role: Select the appropriate permission level (e.g., View (Read-only), Admin).
- Expiry Duration: Set how long the token should be valid (e.g., 30 days, 12 months).
-
Expiry Unit: Choose the unit (days, months, years).
-
Create and Save the Token
Click Create Token. Copy and securely store the token value when it is shown—you will not be able to view it again. -
Manage Existing Tokens
- View all tokens, their creators, and expiry dates in the API Tokens list.
- Revoke tokens at any time by clicking the trash icon next to a token.
Best Practices for API Tokens¶
- Use Least Privilege: Assign the minimum permissions necessary for each token.
- Set Expiry: Prefer shorter expiry durations and renew tokens as needed.
- Unique Tokens per Use Case: Create separate tokens for different applications, users, or automation tasks.
- Store Securely: Never share tokens publicly or commit them to source control. Use environment variables or secret managers.
- Rotate Regularly: Periodically revoke and recreate tokens to reduce risk.
- Monitor Usage: Remove unused or expired tokens promptly.
For more details, see the Authentication page.