{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/athenahq-ai/json-schema/athenahq-ai-sources-list-request-schema.json",
  "title": "SourcesListRequest",
  "description": "Request body for listing domain-grouped sources.",
  "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/SourcesListRequest",
  "type": "object",
  "required": [
    "website_id",
    "filters"
  ],
  "properties": {
    "website_id": {
      "type": "string",
      "format": "uuid",
      "description": "The website to list sources for."
    },
    "filters": {
      "$ref": "#/$defs/ApiFilters"
    },
    "page_num": {
      "type": "integer",
      "minimum": 0,
      "default": 0,
      "description": "Zero-indexed page number."
    },
    "page_size": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100,
      "default": 30,
      "description": "Number of rows per page (1–100)."
    },
    "sort_field": {
      "type": "string",
      "enum": [
        "citation_percentage",
        "mention_percentage",
        "competitor_mention_percentage",
        "brand_mention_percentage",
        "estimated_impressions",
        "total_mentions",
        "domain_count",
        "mentions_count",
        "root_domain",
        "response_count",
        "first_seen"
      ],
      "default": "citation_percentage",
      "description": "Column to sort by."
    },
    "sort_direction": {
      "type": "string",
      "enum": [
        "asc",
        "desc"
      ],
      "default": "desc"
    },
    "search": {
      "type": [
        "string",
        "null"
      ],
      "description": "Substring filter on `normalized_root_domain`. Protocol (`https://`), `www.`, path, query, and fragment are stripped before matching, so a full URL like `https://www.example.com/foo` collapses to `example.com`."
    },
    "mentioned": {
      "$ref": "#/$defs/SourcesMentionedFilter"
    },
    "competitors_mentioned": {
      "$ref": "#/$defs/SourcesMentionedFilter"
    }
  },
  "$defs": {
    "ApiFilters": {
      "type": "object",
      "description": "Filters for querying responses and metrics. Pass location filters in the JSON body as `filters.location_ids`.",
      "required": [
        "start_date"
      ],
      "properties": {
        "schedule_id": {
          "$ref": "#/$defs/PromptScheduleSelection"
        },
        "start_date": {
          "type": "string",
          "format": "date-time",
          "description": "Filter start date (UTC)"
        },
        "end_date": {
          "type": "string",
          "format": "date-time",
          "description": "Filter end date (UTC)"
        },
        "models": {
          "type": "array",
          "description": "Filter by AI models",
          "items": {
            "type": "string",
            "enum": [
              "chatgpt",
              "perplexity",
              "gemini",
              "google_ai_overview",
              "copilot",
              "claude",
              "ai_mode",
              "grok",
              "deepseek",
              "meta_ai",
              "mistral"
            ]
          }
        },
        "prompt_ids": {
          "type": "array",
          "description": "Filter by specific prompt IDs",
          "items": {
            "type": "string",
            "format": "uuid"
          }
        },
        "competitor_ids": {
          "type": "array",
          "description": "Filter by specific competitor IDs",
          "items": {
            "type": "string",
            "format": "uuid"
          }
        },
        "location_ids": {
          "type": "array",
          "description": "Filter by location IDs. Pass this in the JSON body as `filters.location_ids`, even when filtering by a single location. Use IDs returned by `GET /api/v1/locations`.",
          "items": {
            "type": "string",
            "format": "uuid"
          }
        },
        "prompt_status": {
          "type": "string",
          "enum": [
            "active",
            "paused"
          ],
          "description": "Filter by prompt status"
        },
        "prompt_type": {
          "type": "string",
          "enum": [
            "branded",
            "non_branded"
          ],
          "description": "Filter by prompt type"
        }
      }
    },
    "PromptScheduleSelection": {
      "description": "Select one streaming schedule. Use the selection returned by GET /api/v1/prompt-schedules. Default includes all pre-cutover history and ad hoc runs; archived schedules retain results. The retired manual token is accepted as an alias of default. This field takes one schedule; a list returns 400.",
      "default": "default",
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "default",
            "manual"
          ]
        },
        {
          "type": "string",
          "format": "uuid"
        }
      ]
    },
    "SourcesMentionedFilter": {
      "type": "string",
      "enum": [
        "yes",
        "no"
      ],
      "description": "If `yes`, only count sources where your brand was mentioned in the citing response. If `no`, only count sources where your brand was NOT mentioned. Omit the field to count every cited source."
    }
  }
}