Overview
API keys are authentication tokens that allow applications to access Metoro’s API without requiring user credentials. Each API key:- Is associated with specific roles and permissions
- Has a configurable expiration date for enhanced security
- Can be revoked at any time
- Is tied to a service user account within your organization
Creating API Keys
To create a new API key:- Navigate to Settings → Developer → API Keys
- Click the Create API Key button
- Configure your API key:
- Name: Provide a descriptive name (e.g., “Production CI/CD Pipeline”)
- Roles: Select one or more roles to define the permissions for this key
- Expiration: Choose an expiration period (30 days, 60 days, 90 days, 180 days, or 1 year)
- Click Create API Key
- Important: Copy and securely store the generated token. You won’t be able to view it again after closing the dialog.
API Key Format
API keys follow the format:metoro_secret_<random_token>
Example: metoro_secret_YWJjZGVmZ2hpams...
Using API Keys
Include your API key in theAuthorization
header when making requests to the Metoro API:
Example: Fetching logs
Managing API Keys
Viewing API Keys
The API Keys section displays all active keys with:- Name: The descriptive name you provided
- Roles: Assigned permissions
- Created: When the key was created
- Created By: The user who created the key
- Last Used: Most recent API call using this key
- Expires: Expiration date of the key
Revoking API Keys
To revoke an API key:- Navigate to Settings → Developer → API Keys
- Find the key you want to revoke
- Click the delete button (trash icon) in the Actions column
- Confirm the deletion
Security Best Practices
Key Management
- Use descriptive names: Make it clear what each key is used for
- Assign minimal permissions: Only grant the roles necessary for the specific use case
- Set expiration dates: All keys must have an expiration date (maximum 1 year)
- Rotate regularly: Create new keys and update your applications before old keys expire
- Monitor usage: Review the “Last Used” timestamp to identify unused keys
Storage and Handling
- Never commit to version control: Store API keys in environment variables or secure secret management systems
- Use different keys for different environments: Separate keys for development, staging, and production
- Encrypt in transit: Always use HTTPS when making API calls
- Limit key exposure: Only share keys with team members who need them
Permissions and Roles
API keys inherit permissions from the roles assigned during creation. The key can only perform actions allowed by its assigned roles. Common role assignments for API keys:- Read-Only Access: For monitoring dashboards and reporting tools
- Metrics Writer: For applications that push custom metrics
- Alert Manager: For automation that manages alerts and incidents
- Full Access: For CI/CD pipelines that need comprehensive access
Rate Limiting
API keys are subject to rate limiting to ensure platform stability:- Default limit: 1000 requests per minute
- Burst capacity: 100 requests per second
- Response headers: Include rate limit information
Troubleshooting
Invalid API Key
If you receive a401 Unauthorized
error:
- Verify the key is correctly formatted with the
metoro_secret_
prefix - Check if the key has expired
- Ensure the key hasn’t been revoked
- Confirm you’re using the correct Authorization header format
Insufficient Permissions
If you receive a403 Forbidden
error:
- Review the roles assigned to your API key
- Verify the operation requires permissions your key has
- Consider creating a new key with appropriate roles
Expired Keys
Expired keys return a401 Unauthorized
error. To resolve:
- Create a new API key with appropriate permissions
- Update your application with the new key
- Delete the expired key from the dashboard
API Reference
For detailed API documentation and available endpoints, see the API Reference.Support
If you need help with API keys or encounter issues:- Contact your organization administrator for permission-related questions
- Reach out to Metoro Support for technical assistance
- Check our API status page for service availability