Security
Authentication
All API requests must be authenticated with an API key. Send your key as a Bearer token in the
Authorization header over HTTPS.
API key authentication flow
- Create an API key in your platform dashboard.
- Store it in a secure environment variable, not in source code.
- Include the key in every request as a Bearer token.
- Rotate keys regularly and revoke compromised keys immediately.
Authorization header example
Authorization: Bearer <YOUR_API_KEY>
Environment variable recommendation
Use environment variables to inject credentials at runtime. This reduces accidental key leaks in code repositories and CI logs.
export CLOUD_API_KEY="<YOUR_API_KEY>"
curl https://api.example.com/v1/projects \
-H "Authorization: Bearer $CLOUD_API_KEY"
Security best practices
- Never hardcode API keys in frontend bundles, mobile binaries, or public repositories.
- Use least-privilege keys scoped to the minimum required permissions.
- Rotate keys on a fixed schedule and after personnel or system access changes.
- Audit request logs for unusual activity and unauthorized usage patterns.
- Always use HTTPS; reject plaintext transport in all environments.
Common auth error responses
| Status | Meaning | Typical fix |
|---|---|---|
| 401 Unauthorized | Missing, malformed, or invalid API key. | Verify Bearer format and key value; ensure key is active. |
| 403 Forbidden | Key is valid but lacks required scope or access rights. | Update key permissions or use a key with correct project scope. |