API Authentication
Secure your API requests with API key authentication.
Getting Your API Key
- 1.Log in to your Chatmefy dashboard
- 2.Go to Settings → API Keys
- 3.Click 'Create New API Key'
- 4.Give it a name (e.g., 'Production API')
- 5.Copy the key immediately — it won't be shown again
Using Your API Key
Include your API key in the Authorization header of every request:
Request Header
Authorization: Bearer sk_live_abc123xyz...cURL Example
curl -X GET "https://api.chatmefy.com/v1/leads" \
-H "Authorization: Bearer sk_live_abc123xyz" \
-H "Content-Type: application/json"API Key Types
sk_live_Live KeysUse for production. Access to real data and conversations.
sk_test_Test KeysUse for development. Isolated sandbox environment.
Security Best Practices
Never expose API keys in client-side code
Use environment variables to store keys
Rotate keys periodically (monthly recommended)
Use separate keys for development and production
Revoke keys immediately if compromised
Use the minimum required permissions
Authentication Errors
| Status | Meaning | Solution |
|---|---|---|
| 401 | Missing or invalid API key | Check Authorization header |
| 403 | Key lacks required permissions | Create key with correct scope |
| 429 | Rate limit exceeded | Wait and retry with backoff |