API Authentication
Authenticate your API requests using API keys.
API Keys
Include your API key in the x-api-key header:
curl -X GET "https://api.insightagent.io/api/interviews" \
-H "x-api-key: <your-api-key>"
API Key Format:
sk_{environment}_{32-character-hex-string}
Example: sk_live_a1b2c3d4e5f6...
Obtaining an API Key
Create and manage API keys from the InsightAgent dashboard:
- Go to Settings > API Keys
- Click Create API Key and give it a name
- Copy the key immediately — it will only be shown once
Each account can have up to 5 active API keys. You can rename or revoke keys at any time from the same page. Revoking a key takes effect immediately.
API Key Best Practices
Do
- Store keys in environment variables
- Use separate keys for different environments
- Rotate keys periodically
Don't
- Commit keys to version control
- Share keys in plain text
- Use production keys in development
- Expose keys in client-side code
Error Responses
Missing Authentication (400)
{
"error": "Missing authentication headers, provide either an x-api-key or a Authorization header"
}
Invalid Credentials (401)
{
"error": "Invalid authentication headers"
}
Returned when the API key is not recognized or has been revoked.