Skip to Content
Sendable Docs

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.

ActionCovers
readGET 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)
writeOther POST, PUT, PATCH, and DELETE routes
adminDestructive 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.

ResourceRoutes
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: read on 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

  1. Select a session from dashboard
  2. Go to "API Keys" tab
  3. Click "Generate New Key"
  4. Choose permissions (Full access by default)
  5. Copy the key immediately
  6. 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:

  1. Find the key in the list
  2. Click "Revoke"
  3. Confirm revocation
  4. 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_KEY

Use .env Files

Create .env:

SENDABLE_API_KEY=sk_live_abc123

Add to .gitignore:

.env
.env.local
.env.production

Rotate Keys Regularly

Set a rotation schedule:

  • Development: Monthly
  • Production: Quarterly

Rotation process:

  1. Generate new key
  2. Update application config
  3. Test with new key
  4. Revoke old key
  5. Monitor for errors

Separate Environments

Use different keys for different environments:

EnvironmentKey PrefixSession
Developmentsk_dev_Dev Session
Stagingsk_staging_Staging Session
Productionsk_live_Production Session

Use Cases

Single Application

One app, one session, one key:

App → API Key → Sendable Session

Multi-Tenant Application

Different keys for different customers:

Customer A → API Key A → Session A
Customer B → API Key B → Session B

Microservices

Each service gets its own key:

Notification Service → Key 1
Chat Service → Key 2
Marketing Service → Key 3

Troubleshooting

"Invalid API Key" Error

  1. Check key is copied correctly (no extra spaces)
  2. Verify key hasn't been revoked
  3. Confirm key belongs to correct session
  4. Ensure x-api-key header is used

Rate Limit Errors

If you see 429 Too Many Requests:

  1. Check your current usage in dashboard
  2. Implement retry with backoff
  3. Consider upgrading your plan

Key Not Working

  1. Verify session is connected
  2. Check session health status
  3. Try regenerating the key
  4. Contact support if persists

API Key Limits

PlanKeys per SessionRate Limit
Free360/min
Starter10300/min
ProUnlimited1000/min
EnterpriseUnlimitedCustom

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

On this page