API Keys
Manage authentication credentials for Nadi.
Key Types
API Key
Authenticates API requests (used by Shipper):
NADI_API_KEY=nadi_api_xxxxxxxxxxxxxScope: Account-level Use: Shipper agent, API access
Application Key
Identifies a specific project:
NADI_APP_KEY=nadi_app_xxxxxxxxxxxxxScope: Project-level Use: SDKs, error tagging
Managing API Keys
View Your API Key
- Click your profile icon
- Go to Settings → API Tokens
- View or copy your API key
Regenerate API Key
If compromised:
- Go to Settings → API Tokens
- Click Regenerate
- Update all Shipper configurations
- Old key is immediately invalidated
Immediate Invalidation
Regenerating immediately invalidates the old key. Update all deployments first to avoid service interruption.
Managing Application Keys
View App Key
- Go to Settings → Projects
- Select the project
- View the application key
Regenerate App Key
- Go to project settings
- Click Regenerate App Key
- Update SDK configurations
- Redeploy applications
Key Security
Best Practices
Do
- Store keys in environment variables
- Use secrets management (Vault, AWS Secrets Manager)
- Rotate keys periodically
- Use different keys per environment
Don't
- Commit keys to version control
- Share keys via chat/email
- Use production keys in development
- Expose API keys in client-side code
Environment Variables
bash
# .env (never commit)
NADI_API_KEY=nadi_api_xxxxxxxxxxxxx
NADI_APP_KEY=nadi_app_xxxxxxxxxxxxxSecrets Management
AWS Secrets Manager
bash
aws secretsmanager create-secret \
--name nadi/api-key \
--secret-string "nadi_api_xxxxxxxxxxxxx"HashiCorp Vault
bash
vault kv put secret/nadi api_key="nadi_api_xxxxxxxxxxxxx"Kubernetes Secrets
yaml
apiVersion: v1
kind: Secret
metadata:
name: nadi-credentials
type: Opaque
stringData:
api-key: nadi_api_xxxxxxxxxxxxx
app-key: nadi_app_xxxxxxxxxxxxxKey Rotation
Rotation Schedule
| Environment | Recommendation |
|---|---|
| Development | On demand |
| Staging | Monthly |
| Production | Quarterly |
Rotation Process
- Prepare - Ensure you can quickly update all configs
- Regenerate - Create new key
- Update - Deploy new key to all services
- Verify - Confirm services are working
- Monitor - Watch for authentication errors
Zero-Downtime Rotation
For API keys with Shipper:
- Update Shipper configs with new key
- Restart Shipper instances
- Verify events are flowing
- Then regenerate (invalidate old key)
Audit Log
Track key usage:
- Go to Settings → Activity Log
- Filter by "API Key" actions
- View creation, regeneration, usage
Multiple Keys
Per-Service Keys
For microservices, use separate app keys:
| Service | App Key |
|---|---|
| Frontend | nadi_app_frontend_xxx |
| Backend | nadi_app_backend_xxx |
| Worker | nadi_app_worker_xxx |
Benefits
- Isolate services
- Track per-service errors
- Revoke without affecting others
Troubleshooting
"Invalid API Key"
- Verify key is correct (no extra spaces)
- Check key hasn't been regenerated
- Confirm using API key (not app key)
"Application Not Found"
- Verify app key is correct
- Confirm project exists
- Check using app key (not API key)
"Rate Limited"
- Check rate limits in dashboard
- Implement sampling if needed
- Contact support for limit increase
API Reference
Authentication Header
bash
curl -H "Authorization: Bearer NADI_API_KEY" \
https://nadi.pro/api/projectsVerify Key
bash
curl -H "Authorization: Bearer YOUR_API_KEY" \
https://nadi.pro/api/auth/verifyResponse:
json
{
"valid": true,
"organization": "your-org",
"created_at": "2024-01-01T00:00:00Z"
}Next Steps
- Projects - Manage projects
- Team Management - Manage team members