{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/athenahq-ai/json-schema/athenahq-ai-source-pages-list-response-schema.json",
  "title": "SourcePagesListResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/athenahq-ai-sources-api-openapi.yml#/components/schemas/SourcePagesListResponse",
  "type": "object",
  "required": [
    "pages",
    "pagination"
  ],
  "properties": {
    "pages": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/SourcePageItem"
      }
    },
    "pagination": {
      "$ref": "#/$defs/SourcesPagination"
    }
  },
  "$defs": {
    "SourcePageDailyMention": {
      "type": "object",
      "description": "A single day of the per-URL citation sparkline.",
      "required": [
        "date",
        "citation_percentage"
      ],
      "properties": {
        "date": {
          "type": "string",
          "description": "Date (YYYY-MM-DD) the citation percentage was measured on."
        },
        "citation_percentage": {
          "type": "number",
          "description": "Percentage of all responses on this date that cite the URL."
        }
      }
    },
    "SourcePageItem": {
      "type": "object",
      "description": "A per-URL cited page row with metrics + sparkline.",
      "required": [
        "normalized_url",
        "domain",
        "root_domain",
        "normalized_root_domain",
        "total_mentions",
        "estimated_impressions",
        "citation_percentage",
        "mentions_count",
        "competitor_ids",
        "default_source_type",
        "source_type_ids",
        "first_seen",
        "daily_mentions"
      ],
      "properties": {
        "normalized_url": {
          "type": "string",
          "description": "The cited URL after protocol/www/trailing-slash normalization. Domain is lower-cased; path case is preserved."
        },
        "domain": {
          "type": "string",
          "description": "Display-form domain (may include `www.`, subdomains)."
        },
        "root_domain": {
          "type": "string",
          "description": "Display-form root domain."
        },
        "normalized_root_domain": {
          "type": "string",
          "description": "Lower-cased root domain — useful for joining against `POST /api/v1/sources` rows."
        },
        "total_mentions": {
          "type": "number",
          "description": "Total citations of this URL (one per citing response) in the date range."
        },
        "estimated_impressions": {
          "type": "number",
          "description": "Estimated impressions attributable to this URL across the date range."
        },
        "citation_percentage": {
          "type": "number",
          "description": "Citations of this URL as a percentage of all matching responses."
        },
        "mentions_count": {
          "type": "number",
          "description": "Count of citing responses on this URL where the brand was mentioned."
        },
        "competitor_ids": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uuid"
          },
          "description": "Tracked competitors mentioned in responses that cite this URL."
        },
        "default_source_type": {
          "$ref": "#/$defs/SourceTypeClassification"
        },
        "source_type_ids": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uuid"
          },
          "description": "Custom source-type tag UUIDs attached to this URL or its root domain."
        },
        "first_seen": {
          "type": "string",
          "description": "Earliest citation date for this URL in the date range."
        },
        "daily_mentions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/SourcePageDailyMention"
          },
          "description": "Per-day citation percentage sparkline for this URL across the date range. Empty array when no citations occurred."
        }
      }
    },
    "SourceTypeClassification": {
      "type": "string",
      "enum": [
        "owned",
        "competitor",
        "partner",
        "third_party"
      ],
      "description": "How the source row is classified relative to the website. `owned` covers the website's own host, every host listed as an owned domain, and their subdomains; a listed owned URL pattern with a path (for example `reddit.com/user/brand`) makes only the pages under that path `owned`, not the whole host. `competitor` matches tracked competitor root domains. `partner` matches configured affiliate domains. `third_party` is the residual bucket (Wikipedia, news, etc.). Per-website source-type overrides apply in this order: an override on the exact URL decides; a host or path the website lists as owned stays `owned`; a domain-level override then decides, including for hosts that are `owned` only as subdomains of a listed domain."
    },
    "SourcesPagination": {
      "type": "object",
      "description": "Pagination metadata. Unlike `Pagination` (which uses `has_more` lookahead), the sources surfaces expose a precise `total` count — the underlying ClickHouse query computes it as a window function in the same scan, so there's no extra round-trip cost.",
      "required": [
        "page_num",
        "page_size",
        "total"
      ],
      "properties": {
        "page_num": {
          "type": "integer",
          "description": "Zero-indexed page number returned."
        },
        "page_size": {
          "type": "integer",
          "description": "Maximum items per page."
        },
        "total": {
          "type": "integer",
          "description": "Total number of rows matching the filters (across all pages)."
        }
      }
    }
  }
}