Skip to main content

Authentication

All API requests require an API key passed via the X-API-Key header. See also the Authentication API Reference for a quick-reference version.

Making Authenticated Requests

curl "https://api.silentwitness.ai/api/cases" \
-H "X-API-Key: sk-your-api-key-here"

Getting an API Key

  1. Log into the Silent Witness dashboard
  2. Navigate to Settings > API Keys
  3. Click Create API Key
  4. Copy the key — it won't be shown again

API Key Format

API keys start with sk- and are 64 characters long:

sk-a1b2c3d4e5f6...

Environment Variables

Store your API key in environment variables — never hardcode it in source code.

export API_KEY="sk-your-api-key-here"

curl "https://api.silentwitness.ai/api/cases" \
-H "X-API-Key: $API_KEY"

Account Association

  • API keys are tied to your account — all usage is billed to your account
  • Cases created via API keys appear in your dashboard alongside UI-created cases
  • Each API key has independent rate limits

Authentication Errors

If the API key is missing or invalid, you'll receive a 401 response:

{
"success": false,
"error": "Invalid API key",
"error_code": "unauthorized",
"error_type": "authentication_error",
"request_id": "req_abc123"
}

Security Best Practices

  • Never commit API keys to version control
  • Use environment variables in all environments
  • Rotate keys periodically from the dashboard
  • Use separate keys for development and production
  • If a key is compromised, revoke it immediately from the dashboard