Back to Docs

Authentication

All API requests require authentication using API keys.

Using API Keys

Include your API key in the Authorization header:

curl https://api.leadmagic.io/v1/enrich \
  -H "Authorization: Bearer pk_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"email": "john@example.com"}'

Security Best Practices

Warning: Never expose your API keys in client-side code or public repositories.

  • Rotate keys regularly - Create new keys and revoke old ones periodically
  • Use scoped keys - Only grant the permissions each key needs
  • Set rate limits - Prevent abuse by limiting requests per minute
  • Monitor usage - Check the dashboard for unusual activity

Rate Limiting

API keys have configurable rate limits. When exceeded, you'll receive a 429 response:

{
  "error": "rate_limit_exceeded",
  "message": "Rate limit exceeded",
  "retryAfter": 30
}