API key types
| Key Type | Prefix | Use Case | Permissions |
|---|---|---|---|
| Secret key | sk_live_ / sk_test_ | Server-side API calls | Full access |
| Publishable key | pk_live_ / pk_test_ | Client SDK initialization | Read-only, limited |
Using API keys
Server-side requests
Include your secret key in theAuthorization header:
SDK initialization
Use publishable keys when initializing client SDKs:- iOS
- Android
- React Native
- Web
Environments
Each environment has separate API keys:| Environment | Key Prefixes | Purpose |
|---|---|---|
| Production | sk_live_, pk_live_ | Live traffic, real data |
| Staging | sk_test_, pk_test_ | Testing, development |
Obtaining API keys
Admin Portal
- Go to Settings → API Keys
- View existing keys or create new ones
- Copy the key (shown only once for secret keys)
Key permissions
Secret keys have full access. Publishable keys are restricted to:- Fetching feed content (read-only)
- Sending engagement events
- Reading public configuration
- Create, update, or delete content
- Access analytics data
- Modify configuration
- Manage webhooks
Key management
Rotating keys
To rotate a compromised or expired key:- Go to Settings → API Keys
- Click Create New Key
- Update your application with the new key
- Delete the old key once migration is complete
Revoking keys
Immediately revoke compromised keys:- Go to Settings → API Keys
- Find the compromised key
- Click Revoke
401 Unauthorized response.
Key metadata
Add descriptions to track key usage:Authentication errors
| Status | Error Code | Description |
|---|---|---|
401 | UNAUTHORIZED | Missing or invalid API key |
401 | KEY_REVOKED | API key has been revoked |
403 | FORBIDDEN | Key lacks required permissions |
403 | ENVIRONMENT_MISMATCH | Using test key on production endpoint |
Error response example
Security best practices
Use environment variables
Use environment variables
Store keys in environment variables, not in code:
Restrict key permissions
Restrict key permissions
Create separate keys for different services. If one is compromised, impact is limited.
Monitor key usage
Monitor key usage
Review API key usage in Settings → API Keys → Usage. Look for unusual patterns that might indicate compromise.
Use staging keys for development
Use staging keys for development
Never use production keys during development. Use staging keys to avoid accidental data modification.
Implement key rotation schedules
Implement key rotation schedules
Rotate keys periodically (e.g., quarterly) as a security practice, not just when compromised.
