API Key Authentication
The First Answer API uses API keys to authenticate requests. Every request to the/v1/ endpoints must include a valid API key in the request headers.
Obtaining an API Key
Create a new key
Click Create API Key and give it a descriptive name (e.g. “Production Dashboard”, “Internal Analytics”).
Using Your API Key
Include the API key in theapi-key header of every request:
Key Expiration
API keys are valid for 6 months from the date of creation. After expiration, requests made with the key will return a401 error:
Error Responses
Missing API Key
If noapi-key header is provided, the API will return:
401
Invalid API Key
If the key is incorrect or has been revoked:401
Expired API Key
If the key has passed its expiration date:401
Best Practices
Use environment variables
Use environment variables
Never hardcode API keys in your source code. Store them as environment variables:
Rotate keys periodically
Rotate keys periodically
Don’t wait for keys to expire. Create a new key, update your integrations, then revoke the old one.
Use descriptive names
Use descriptive names
Name your keys after their purpose (e.g. “Looker Dashboard”, “Internal Slack Bot”) so you can easily manage and revoke them.
Revoke unused keys
Revoke unused keys
If a key is no longer needed, revoke it immediately in your API settings. This prevents unauthorized access.
Never expose keys client-side
Never expose keys client-side
API keys should only be used in server-side code. Never include them in frontend JavaScript, mobile apps, or any publicly accessible code.