Authentication
All API requests require authentication using an API key.Getting Your API Key
- Log in to livchat.ai/dashboard
- Navigate to Settings > API Keys
- Click Create API Key
- Copy your key immediately (it won’t be shown again)
Using Your API Key
Include your API key in theAuthorization header:
API Key Types
| Prefix | Environment | Usage |
|---|---|---|
lc_live_ | Production | Live WhatsApp messages |
lc_test_ | Test | Testing and development |
Scopes
API keys have scopes that limit what they can access:| Scope | Access |
|---|---|
whatsapp:* | Full access to all WhatsApp endpoints |
whatsapp:messages | Send and manage messages |
whatsapp:contacts | Access contact information |
whatsapp:session | Manage WhatsApp session |
whatsapp:groups | Manage groups |
whatsapp:webhook | Configure webhooks |
Error Responses
401 Unauthorized
- Missing
Authorizationheader - Invalid or expired API key
- Malformed key format
403 Forbidden
- API key doesn’t have permission for the requested endpoint
- Request a new key with the required scopes
Best Practices
Use environment variables
Use environment variables
Store API keys in environment variables, not in code:
Rotate keys periodically
Rotate keys periodically
Create new API keys and revoke old ones regularly for security.
Use minimal scopes
Use minimal scopes
Only request the scopes your application needs.
Monitor usage
Monitor usage
Check the dashboard for API key usage and suspicious activity.
Rate Limits
API requests are rate limited to ensure fair usage:| Plan | Requests/minute | Requests/day |
|---|---|---|
| Free | 60 | 1,000 |
| Pro | 300 | 10,000 |
| Enterprise | Custom | Custom |