Key types
Write key — Safe to use in browser or mobile client-side code. Write keys can only track events and callidentify(). They cannot access reports or delete data. Write keys use the prefix sk_write_.
Secret key — Must never be exposed in client-side code or committed to source control. Secret keys have full API access, including reading reports and deleting users. Secret keys use the prefix sk_live_.
Finding your API keys
1
Log in to your Saytics dashboard
Go to app.saytics.com and sign in to your account.
2
Open Settings → API Keys
Navigate to Settings in the sidebar, then select API Keys.
3
Copy the key you need
Copy your write key for client-side code, or your secret key for server-side integrations.
How to authenticate
Pass your key in theAuthorization header on every request:
Authentication errors
If authentication fails, the API returns a401 status with one of the following error bodies:
Rotating your API keys
To rotate a key without causing downtime:- Create a new key in Settings → API Keys.
- Update your application or environment variables to use the new key.
- Deploy your changes and verify requests are succeeding.
- Revoke the old key from the dashboard.