All articles

Authentication

Authentication

All API requests must be authenticated using an API key sent via the Authorization header.

Obtaining an API Key

  1. Log in to your dashboard
  2. Navigate to Settings → API Keys
  3. Click Generate New Key

Using Your API Key

Include the key in the Authorization header of every request as a Bearer token.

Security Best Practices

  • Never commit API keys to source control
  • Use environment variables
  • Rotate keys regularly

Code Samples

Authenticated cURL request
bash
curl https://api.example.com/v2/users \
  -H "Authorization: Bearer YOUR_API_KEY"
Using fetch in JS
javascript
const response = await fetch('https://api.example.com/v2/users', {
  headers: {
    'Authorization': `Bearer ${process.env.API_KEY}`
  }
});
const data = await response.json();