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, unless you give it permissions
- Can be revoked at any time
- Is only shown once at creation
Permissions
A key can be limited to the parts of the API it needs. Permissions are a list of resource:action pairs. Keys created without permissions keep full access.
In the dashboard, pick Permissions when you create or edit a key (session keys under Session > API Keys, account keys under Settings > API Keys): Full access, Read only, Send only, Webhook manager, or Custom to choose actions per resource. The key list shows each key's permissions; hover a badge to see the exact scopes.
| Action | Covers |
|---|---|
read | GET routes, and POST routes that only look data up (/v1/contacts/check, /v1/contacts/status, /v1/contacts/devices, /v1/contacts/disappearing-duration, /v1/message/history, /v1/presence/subscribe, /v1/newsletters/:id/subscribe-updates) |
write | Other POST, PUT, PATCH, and DELETE routes |
admin | Destructive or account-wide changes: session create, restart, end, logout, and delete; chat delete and clear; group and community participant changes; profile, privacy, default disappearing timer, and blocklist changes; newsletter delete, owner transfer, and admin demote; webhook create, update, delete, and secret rotation |
Actions do not include each other: a key with message:write can send but cannot list messages unless it also has message:read.
| Resource | Routes |
|---|---|
session | /v1/session/* |
message | /v1/message/*, /v1/messages |
media | /v1/media, /v1/message/:messageId/media* |
chats | /v1/chats/* (except labels), /v1/chats.recent |
contacts | /v1/contacts/* |
groups | /v1/groups/* |
communities | /v1/communities/* |
account | /v1/account/* |
labels | /v1/labels/*, /v1/chats/:chatId/labels/*, message labels |
business | /v1/business/* |
status | /v1/status/* |
newsletters | /v1/newsletters/* |
calls | /v1/calls/* |
webhooks | /webhooks/* |
events | /v1/events |
presence | /v1/presence/* |
Common sets:
- Read only:
readon every resource. - Send only:
message:write,media:write,chats:read,contacts:read. Good for bots and AI agents that only send. - Webhook manager:
webhooks:read,webhooks:write,webhooks:admin,events:read.
A request the key is not allowed to make gets 403 with the missing permission:
{ "error": "insufficient_scope", "message": "api key is missing the chats:read permission", "required": "chats:read" }Creating an API Key
Step-by-Step
- Select a session from dashboard
- Go to "API Keys" tab
- Click "Generate New Key"
- Choose permissions (Full access by default)
- 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