API Keys
API keys are bearer tokens that authenticate requests to the Chatbot Platform API.Creating an API Key
1
Go to Settings
Navigate to your team settings in the dashboard.
2
Open API Keys
Click API Keys in the sidebar.
3
Create New Key
Click Create API Key.Provide:
- Name: Descriptive name (e.g., “Production Server”)
- Permissions: Select scopes (all by default)
4
Copy Key
Copy the generated key immediately - it won’t be shown again.Format:
sk_live_abc123xyz...5
Store Securely
Save the key in your environment variables or secrets manager.
API keys provide full access to your team’s resources. Never share them or commit them to version control.
Using API Keys
Include your API key in theAuthorization header:
Environment Variables
Store keys as environment variables: Bash:Key Types
Live Keys
Production keys with full access:Test Keys (Coming Soon)
Sandbox keys for development:Permissions and Scopes
API keys can have restricted permissions:Creating Restricted Keys
For security, create keys with minimal required permissions:Authentication Errors
Invalid Key
- Key is incorrect
- Key was deleted
- Wrong key format
Expired Key (Coming Soon)
Insufficient Permissions
Key Management
Rotating Keys
Periodically rotate API keys for security:1
Create New Key
Generate a new API key with the same permissions.
2
Update Applications
Deploy the new key to all services using it.
3
Verify
Confirm all services are using the new key successfully.
4
Delete Old Key
Remove the old key to prevent unauthorized access.
Revoking Keys
Immediately revoke a key if compromised:1
Go to API Keys
Navigate to API Keys settings.
2
Find Key
Locate the compromised key.
3
Delete
Click Delete to revoke immediately.
4
Create New
Generate a replacement key.
Webhook Authentication
For incoming webhooks (callbacks, bot messages), verify requests using signatures:Webhook Signature
Incoming webhooks include a signature header:Verifying Signatures (Coming Soon)
Security Best Practices
Use Environment Variables
Never hardcode API keys in source code
Rotate Regularly
Change keys every 90 days or when employees leave
Minimal Permissions
Grant only necessary scopes per key
Secure Storage
Store keys in environment variables or secrets managers
Secure Storage
Do:- Use environment variables
- Store in secrets managers (AWS Secrets Manager, HashiCorp Vault)
- Encrypt at rest
- Restrict access to keys
- Commit to Git
- Store in plaintext files
- Share via email or chat
- Use same key across all environments
Production vs Development
Use separate keys for each environment:Rate Limiting
API keys are subject to rate limits. See API Introduction for details.Troubleshooting
Authentication Fails
Check:- Key is correct and complete
- Authorization header format:
Bearer YOUR_KEY - No extra spaces or characters
- Key hasn’t been deleted
Intermittent Failures
Possible Causes:- Rate limiting
- Clock skew (for signatures)
- Network issues
- Implement exponential backoff
- Sync system clock
- Add retry logic
Key Not Working After Creation
Wait a few seconds: Keys may take 5-10 seconds to propagate.Next Steps
API Introduction
Learn about API basics
Bot Management
API endpoints for bots (coming soon)