Overview
Our API uses bearer token authentication. You’ll need to include your API key in theAuthorization header of every request.
Getting your API key
- Log into your dashboard
- Navigate to your workspace settings
- Click on “API Keys” section
- Click “Generate new API key”
- Copy and securely store your key
Using your API key
Include your API key in theAuthorization header:
Example request
Security best practices
1. Keep keys secret
Never expose API keys in:- Client-side code
- Public repositories
- Log files
- Error messages
2. Use environment variables
Store API keys in environment variables:3. Rotate keys regularly
Periodically rotate your API keys:- Generate a new key
- Update your application
- Revoke the old key
4. Use separate keys per environment
Create different keys for:- Development
- Staging
- Production
5. Monitor key usage
Regularly review your API key usage in the dashboard to detect any unusual activity.Revoking API keys
If a key is compromised:- Go to your workspace settings
- Find the compromised key
- Click “Revoke”
- Generate a new key immediately
Revoked keys stop working immediately. Update your applications before revoking keys in production.
API key permissions
API keys inherit the permissions of the workspace they’re created in. Each key can:- Send messages
- Retrieve message history
- Access workspace settings
- Manage phone numbers
Troubleshooting
401 Unauthorized
This error means your API key is invalid or missing:- Check that the key is included in the header
- Verify the key hasn’t been revoked
- Ensure you’re using the correct key format:
Bearer YOUR_KEY
403 Forbidden
This error means your key doesn’t have permission for this action:- Verify you’re accessing the correct workspace
- Check that your workspace has the required features enabled