{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/athenahq-ai/json-schema/athenahq-ai-source-pages-list-request-schema.json",
  "title": "SourcePagesListRequest",
  "description": "Request body for listing per-URL cited pages.",
  "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/SourcePagesListRequest",
  "type": "object",
  "required": [
    "website_id",
    "filters"
  ],
  "properties": {
    "website_id": {
      "type": "string",
      "format": "uuid",
      "description": "The website to list cited URLs for."
    },
    "filters": {
      "allOf": [
        {
          "$ref": "#/$defs/ApiFilters"
        },
        {
          "type": "object",
          "properties": {
            "persona_ids": {
              "type": "array",
              "description": "Persona IDs to filter to (list them with GET /api/v1/personas). Omit for all personas.",
              "items": {
                "type": "string",
                "format": "uuid"
              }
            },
            "prompt_tags": {
              "type": "array",
              "description": "Prompt tag IDs to filter prompts by (list them with GET /api/v1/prompt-tags). An entry can also be `type:high_intent` (branded prompts) or `type:discovery` (non-branded prompts) to filter by prompt type. Omit for all tags.",
              "items": {
                "oneOf": [
                  {
                    "type": "string",
                    "format": "uuid"
                  },
                  {
                    "type": "string",
                    "enum": [
                      "type:discovery",
                      "type:high_intent"
                    ]
                  }
                ]
              }
            },
            "prompt_tags_operator": {
              "type": "string",
              "enum": [
                "is_any_of",
                "has_all_of"
              ],
              "description": "How the tag IDs in prompt_tags combine: is_any_of matches prompts with any listed tag, has_all_of only prompts carrying every listed tag. `type:` entries are not combined with the tags this way: a prompt must also have one of the listed types, and has_all_of accepts at most one `type:` entry, since a prompt has exactly one type. Defaults to is_any_of."
            }
          }
        }
      ]
    },
    "page_num": {
      "type": "integer",
      "minimum": 0,
      "default": 0
    },
    "page_size": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100,
      "default": 30
    },
    "sort_field": {
      "type": "string",
      "enum": [
        "citation_percentage",
        "estimated_impressions",
        "total_mentions",
        "mentions_count",
        "normalized_url",
        "competitor_ids",
        "first_seen"
      ],
      "default": "citation_percentage"
    },
    "sort_direction": {
      "type": "string",
      "enum": [
        "asc",
        "desc"
      ],
      "default": "desc"
    },
    "search": {
      "type": [
        "string",
        "null"
      ],
      "description": "Substring filter on `normalized_url` AND `normalized_root_domain`. Protocol (`https://`), `www.`, query, and fragment are stripped before matching; path is preserved so URL-specific searches still work."
    },
    "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."
    }
  }
}