{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/athenahq-ai/json-schema/athenahq-ai-sources-list-response-schema.json",
  "title": "SourcesListResponse",
  "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/SourcesListResponse",
  "type": "object",
  "required": [
    "sources",
    "pagination"
  ],
  "properties": {
    "sources": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/SourceItem"
      }
    },
    "pagination": {
      "$ref": "#/$defs/SourcesPagination"
    }
  },
  "$defs": {
    "SourceItem": {
      "type": "object",
      "description": "A domain-grouped source row. Identifies one cited root domain with its citation, mention, and impression metrics for the requested date range.",
      "required": [
        "root_domain",
        "total_mentions",
        "response_count",
        "estimated_impressions",
        "domain_count",
        "mention_percentage",
        "citation_percentage",
        "competitor_mention_percentage",
        "brand_mention_percentage",
        "mentions_count",
        "responses_mentioned_count",
        "competitor_ids",
        "default_source_type",
        "source_type_ids",
        "first_seen"
      ],
      "properties": {
        "root_domain": {
          "type": "string",
          "description": "The cited root domain (display form)."
        },
        "total_mentions": {
          "type": "number",
          "description": "Total citations of this domain (one per citing response) in the date range."
        },
        "response_count": {
          "type": "number",
          "description": "Distinct AI responses citing this domain."
        },
        "estimated_impressions": {
          "type": "number",
          "description": "Estimated impressions attributable to this domain across the date range."
        },
        "domain_count": {
          "type": "number",
          "description": "Distinct subdomain count rolled up under this root domain."
        },
        "mention_percentage": {
          "type": "number",
          "description": "Citations of this domain as a percentage of all matching responses."
        },
        "citation_percentage": {
          "type": "number",
          "description": "Same numerator as `mention_percentage`. Kept for backward compatibility with the existing dashboard wire shape."
        },
        "competitor_mention_percentage": {
          "type": "number",
          "description": "Of the responses citing this domain, the percentage that also mention a tracked competitor."
        },
        "brand_mention_percentage": {
          "type": "number",
          "description": "Of the responses citing this domain, the percentage that mention the website's brand."
        },
        "mentions_count": {
          "type": "number",
          "description": "Per-URL rollup: count of cited URLs on this domain where the brand was mentioned."
        },
        "responses_mentioned_count": {
          "type": "number",
          "description": "Count of citing responses where the brand was mentioned."
        },
        "competitor_ids": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uuid"
          },
          "description": "Tracked competitors mentioned in responses that cite this domain."
        },
        "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 domain (in addition to `default_source_type`)."
        },
        "first_seen": {
          "type": "string",
          "description": "Earliest citation date for this domain in the date range."
        }
      }
    },
    "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)."
        }
      }
    }
  }
}