API Keys
Manage API keys for secure Sendable integration.
API Key Basics
Each API key:
- Is unique to a session
- Has full access to that session
- Can be revoked at any time
- Is only shown once at creation
Creating an API Key
Step-by-Step
- Select a session from dashboard
- Go to "API Keys" tab
- Click "Generate New Key"
- Copy the key immediately
- Store it securely
⚠️ Important: The key is only shown once. If you lose it, you must create a new one.
API Key Management
View All Keys
In the API Keys tab, see:
- Key ID (first 8 characters)
- Created date
- Last used
- Status (Active/Revoked)
Revoke a Key
If a key is compromised:
- Find the key in the list
- Click "Revoke"
- Confirm revocation
- The key is immediately disabled
Key Usage Statistics
Monitor key usage:
- Requests per day
- Success rate
- Error rate
- Last used timestamp
Security Best Practices
Store Keys Safely
❌ Never do this:
// BAD: Hardcoded key
const apiKey = 'sk_live_abc123'✅ Do this instead:
// GOOD: Environment variable
const apiKey = process.env.SENDABLE_API_KEYUse .env Files
Create .env:
SENDABLE_API_KEY=sk_live_abc123Add to .gitignore:
.env
.env.local
.env.productionRotate Keys Regularly
Set a rotation schedule:
- Development: Monthly
- Production: Quarterly
Rotation process:
- Generate new key
- Update application config
- Test with new key
- Revoke old key
- Monitor for errors
Separate Environments
Use different keys for different environments:
| Environment | Key Prefix | Session |
|---|---|---|
| Development | sk_dev_ | Dev Session |
| Staging | sk_staging_ | Staging Session |
| Production | sk_live_ | Production Session |
Use Cases
Single Application
One app, one session, one key:
App → API Key → Sendable SessionMulti-Tenant Application
Different keys for different customers:
Customer A → API Key A → Session A
Customer B → API Key B → Session BMicroservices
Each service gets its own key:
Notification Service → Key 1
Chat Service → Key 2
Marketing Service → Key 3Troubleshooting
"Invalid API Key" Error
- Check key is copied correctly (no extra spaces)
- Verify key hasn't been revoked
- Confirm key belongs to correct session
- Ensure
x-api-keyheader is used
Rate Limit Errors
If you see 429 Too Many Requests:
- Check your current usage in dashboard
- Implement retry with backoff
- Consider upgrading your plan
Key Not Working
- Verify session is connected
- Check session health status
- Try regenerating the key
- Contact support if persists
API Key Limits
| Plan | Keys per Session | Rate Limit |
|---|---|---|
| Free | 3 | 60/min |
| Starter | 10 | 300/min |
| Pro | Unlimited | 1000/min |
| Enterprise | Unlimited | Custom |
Monitoring
Track API key usage in dashboard:
- Total requests
- Failed requests
- Average response time
- Error breakdown
Set up alerts for:
- Unusual traffic spikes
- High error rates
- Key nearing rate limits