Docs/API/Authentication

API Authentication

Secure your API requests with API key authentication.

Getting Your API Key

  1. 1.Log in to your Chatmefy dashboard
  2. 2.Go to Settings → API Keys
  3. 3.Click 'Create New API Key'
  4. 4.Give it a name (e.g., 'Production API')
  5. 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 Keys

Use for production. Access to real data and conversations.

sk_test_Test Keys

Use 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

StatusMeaningSolution
401Missing or invalid API keyCheck Authorization header
403Key lacks required permissionsCreate key with correct scope
429Rate limit exceededWait and retry with backoff

Start Making Requests