Skip to content

API overview

Check the public API base URL, versioning and error format before building an integration.

Make one authenticated request to confirm the URL and key your integration will use.

  1. Set your instance URL and API key.

    Terminal window
    export SUPERMETRY_URL="https://analytics.example.com"
    export SUPERMETRY_API_KEY="replace-with-your-key"
  2. Request the sites visible to the key.

    Terminal window
    curl --fail-with-body "$SUPERMETRY_URL/api/public/v1/sites" \
    -H "Authorization: Bearer $SUPERMETRY_API_KEY" \
    -H "Accept: application/json"
  3. Keep integration requests under /api/public/v1. The v1 path is the API version; dashboard routes under /api/private are unversioned and use login sessions instead.

  4. Handle non-success responses as RFC 9457 application/problem+json. A validation error has this shape:

    {
    "type": "https://supermetry.com/problems/bad-request",
    "title": "Bad request",
    "status": 400,
    "detail": "period is required"
    }

    401 means the key is missing or invalid, 403 means a scope is missing, 404 can hide an inaccessible resource, and 429 includes Retry-After.

What you should see: a JSON object with a data array containing the sites the key can access.