Skip to main content

Authentication

All API requests require authentication using an API key.

Getting an API Key

  1. Log in to the Silent Witness Console
  2. Navigate to Settings > API Keys
  3. Click Create API Key
  4. Copy and securely store your key (it won't be shown again)

Using Your API Key

Include the API key in the X-API-Key header:

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

Environment Variables

Store your API key in an environment variable:

# .env file (never commit this!)
API_KEY=sk-your-api-key-here

Authentication Errors

StatusDescription
401Missing or invalid API key
403API key valid but lacks permission
{
"success": false,
"error": "Unauthorized: Invalid or missing API key"
}