Authentication
All API requests require authentication using an API key.
Getting an API Key
- Log in to the Silent Witness Console
- Navigate to Settings > API Keys
- Click Create API Key
- 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
| Status | Description |
|---|---|
| 401 | Missing or invalid API key |
| 403 | API key valid but lacks permission |
{
"success": false,
"error": "Unauthorized: Invalid or missing API key"
}