Create a key with only the scopes and site access your integration needs.
-
Open Organization settings → API keys and select Create key.
-
Enter a name, choose the smallest useful scopes, restrict Site access when possible, and optionally set an expiry date. Common scopes are:
Scope Access stats:readAnalytics, realtime and MCP data:exportCSV and ZIP downloads, with the relevant read scope sites:writeCreate, update and delete sites goals:writeCreate, update and delete goals and funnels keys:manageList, create and revoke API keys -
Select Create key, then copy the secret. It is displayed once.
-
Test it from a shell.
Terminal window export SUPERMETRY_URL="https://analytics.example.com"export SUPERMETRY_API_KEY="replace-with-your-key"curl --fail-with-body "$SUPERMETRY_URL/api/public/v1/sites" \-H "Authorization: Bearer $SUPERMETRY_API_KEY"
What you should see: a JSON data array, limited to the sites granted to the key.