API Keys
API keys are bearer tokens that authenticate requests to the Chatbot Platform API.Creating an API Key
Create New Key
Click Create API Key.Provide:
- Name: Descriptive name (e.g., “Production Server”)
- Permissions: Select scopes (all by default)
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:| Scope | Access |
|---|---|
bots:read | View bots |
bots:write | Create/update bots |
integrations:read | View integrations |
integrations:write | Create/update integrations |
channels:read | View channels |
channels:write | Create/update channels |
conversations:read | View conversations |
conversations:write | Delete conversations |
agent-loops:read | View agent loops |
agent-loops:write | Create/run agent loops |
admin | Full access to everything |
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:Revoking Keys
Immediately revoke a key if compromised:
Deleted keys stop working immediately.
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)