{
  "aod": "0.1",
  "provider": {
    "name": "Ironfang Ltd - Ironfang Analytics API",
    "url": "https://ironfang.com/analytics",
    "portalUrl": "https://portal.ironfang.com",
    "apisJsonUrl": "https://ironfang.com/apis.json"
  },
  "maturity": "console-only",
  "account": {
    "required": true,
    "signupUrl": "https://id.ironfang.com/signup?return_to=https%3A%2F%2Fportal.ironfang.com%2Fproducts%2Fanalytics",
    "agentPolicy": "unspecified",
    "prerequisites": [
      "An email address (or a Google account).",
      "Your country, declared at signup."
    ],
    "plans": [
      {
        "name": "Free",
        "requiredFor": "Every account, with no card: a free allowance on every meter, renewed on the first day of each UTC calendar month. When an allowance runs out, that work stops until the next month and nothing is charged.",
        "url": "https://ironfang.com/pricing#analytics"
      },
      {
        "name": "Pay as you go",
        "requiredFor": "Usage past the free allowances at graduated rates, within the monthly usage limit before VAT the account sets and any product limit; work that would pass a limit is refused before it starts. Switched on, paused and limited in the portal by a person with billing rights; one itemised invoice a month for every product.",
        "url": "https://ironfang.com/pricing#analytics"
      }
    ],
    "termsOfService": {
      "url": "https://ironfang.com/legal/terms",
      "acceptance": "implicit"
    }
  },
  "verification": [
    {
      "name": "Email verification",
      "description": "A verification link is emailed at signup. It confirms the address; API keys can be minted before it is clicked.",
      "blocking": false,
      "expectedLatency": "minutes"
    }
  ],
  "registration": {
    "applicationNoun": "API key",
    "owner": "organization",
    "mechanisms": [
      {
        "type": "console-only",
        "description": "Sign in to the portal, open API keys under Developers, choose the scopes (analytics:* or narrower) and mint. The key belongs to the organisation and is shown once.",
        "baseUrl": "https://portal.ironfang.com/developers/api-keys",
        "docsUrls": [
          "https://ironfang.com/analytics/docs#api-keys"
        ],
        "auth": "Browser session at id.ironfang.com (email and password, or Google)."
      }
    ]
  },
  "authentication": {
    "methods": [
      {
        "id": "platform-api-key",
        "type": "bearer-env",
        "env": [
          "IRONFANG_API_KEY"
        ],
        "header": "Authorization",
        "scheme": "Bearer",
        "tokenPrefix": "if_live_",
        "bootstrap": "A person signs in to https://portal.ironfang.com/developers/api-keys and mints a key with the scopes it needs. The key is shown once.",
        "notes": "Send the key as a bearer token to https://api.ironfang.com/analytics. Scopes: analytics:*, analytics:sites:read, analytics:sites:write, analytics:sessions:read, analytics:sessions:delete."
      }
    ]
  },
  "credentials": [
    {
      "type": "api-key",
      "fields": {
        "key": "The secret, prefixed if_live_, sent as a bearer token."
      },
      "ttl": "Until revoked.",
      "rotation": "Mint a replacement in the portal, move traffic to it, revoke the old key. No API for either step.",
      "oneTimeDisplay": true
    }
  ],
  "scopes": {
    "model": "scope-strings",
    "vocabularyUrl": "https://ironfang.com/analytics/docs#api-keys",
    "notes": "Ironfang Analytics API: analytics:*, analytics:sites:read, analytics:sites:write, analytics:sessions:read, analytics:sessions:delete"
  },
  "gaps": [
    "API keys are minted, scoped and revoked by a person in the portal; there is no API to create or rotate them.",
    "There is no sandbox: the free monthly allowances are the trial, against production.",
    "No changelog page is published yet; the OpenAPI contracts carry the current version."
  ],
  "securityProfile": {
    "tier": "normal",
    "senderConstraining": "none"
  },
  "flow": {
    "args": [
      {
        "name": "IRONFANG_API_KEY",
        "description": "An API key minted in the portal with the analytics:sites:read scope (or analytics:*).",
        "required": true
      }
    ],
    "steps": [
      {
        "id": "verify-key",
        "description": "Prove the key works and read the sites. Requires analytics:sites:read.",
        "auth": "platform-api-key",
        "request": {
          "method": "GET",
          "url": "https://api.ironfang.com/analytics/v1/sites",
          "headers": {
            "Authorization": "Bearer {args.IRONFANG_API_KEY}",
            "Accept": "application/json"
          }
        },
        "onStatus": {
          "200": {
            "action": "continue",
            "message": "The key is valid; the body holds the sites."
          },
          "401": {
            "action": "fail",
            "message": "The key is missing, malformed or revoked."
          },
          "403": {
            "action": "fail",
            "message": "The key exists but lacks analytics:sites:read."
          }
        }
      }
    ],
    "outputs": {
      "sites": "{steps.verify-key.body}"
    }
  },
  "economics": {
    "pricingUrl": "https://ironfang.com/pricing#analytics",
    "freeTier": "Free each UTC calendar month on every account, with no card: 5,000 recordings. Recordings are kept 28 days as standard. A recording is counted once it is finalised as kept: playable, and not discarded.",
    "rateLimitsUrl": "https://ironfang.com/analytics/docs#limits"
  }
}
