API Keys
API keys are managed through the AttractOS dashboard, not via API. Create, name, and revoke keys at Settings > API Keys. Each key provides full access to your account's data via the REST API and has its own rate limit counter.
Creating an API Key
- Log in to attractos.com/dashboard
- Go to Settings in the sidebar
- Click API Keys
- Click Generate New Key
- Enter a name (e.g., "Production Server", "Analytics Dashboard")
- Copy the key immediately—it won't be shown again
Key Format
API keys are random 32-character strings. They do not contain any encoded information about your account or permissions.
Example: a4b7c9d2e5f8g1h3i6j9k2l5m8n1o4p7 Don't confuse API keys with site keys:
- API key — For REST API authentication (keep secret)
- Site key — For tracking script (
ak_..., safe to expose)
Managing Keys
Viewing Keys
The dashboard shows all your API keys with:
- Name — The label you assigned
- Last 4 characters — For identification (e.g., "...1o4p7")
- Created date — When the key was generated
- Last used — Most recent API request (if available)
Revoking Keys
- Go to Settings > API Keys
- Find the key to revoke
- Click the Revoke button
- Confirm the action
Revoked keys stop working immediately. Any requests using that key will receive 401 INVALID_KEY errors.
Security Best Practices
Never commit keys to git
Use environment variables or secrets management. Add .env to .gitignore.
Rotate keys periodically
Create a new key, update your apps, then revoke the old one. Do this every 90 days.
Use descriptive names
Name keys by environment/purpose: "Production API", "Staging", "Analytics Script".
One key per environment
Don't share keys between dev/staging/production. This limits blast radius if compromised.
Key Limits by Plan
| Plan | Max Keys | Rate Limit (per key) |
|---|---|---|
| Free | 3 | 60 requests/min |
| Pro | 10 | 600 requests/min |
Rate limits are tracked independently per key. If you have 3 keys on Free, each can make 60 requests/minute (180 total across all keys).