Skip to content

Authentication and API keys

Create a scoped API key and authenticate public API requests.

Create a key with only the scopes and site access your integration needs.

  1. Open Organization settings → API keys and select Create key.

  2. 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:read Analytics, realtime and MCP
    data:export CSV and ZIP downloads, with the relevant read scope
    sites:write Create, update and delete sites
    goals:write Create, update and delete goals and funnels
    keys:manage List, create and revoke API keys
  3. Select Create key, then copy the secret. It is displayed once.

  4. 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.