Back to Documentation

API Authentication

Secure your API requests with API keys and OAuth 2.0

API Keys

sent1nels uses API keys to authenticate requests. You can generate and manage API keys from the dashboard.

Generating an API Key

  1. Navigate to Settings → API Keys
  2. Click "Generate New Key"
  3. Provide a name and set permissions
  4. Copy and securely store your key

curl -H "Authorization: Bearer YOUR_API_KEY" \
  https://api.sent1nels.com/v1/agents

OAuth 2.0

For user-facing applications, use OAuth 2.0 for secure authorization.

Authorization Flow

  1. Redirect user to authorization endpoint
  2. User grants permissions
  3. Receive authorization code
  4. Exchange code for access token

POST https://api.sent1nels.com/oauth/token
Content-Type: application/json

{
  "grant_type": "authorization_code",
  "code": "AUTH_CODE",
  "client_id": "YOUR_CLIENT_ID",
  "client_secret": "YOUR_CLIENT_SECRET"
}

Best Practices

  • Never commit API keys to version control
  • Use environment variables for keys
  • Rotate keys regularly (every 90 days)
  • Use least-privilege permissions
  • Monitor API key usage for anomalies