{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/athenahq-ai/json-schema/athenahq-ai-attribute-observations-request-schema.json",
  "title": "AttributeObservationsRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/athenahq-ai-attributes-api-openapi.yml#/components/schemas/AttributeObservationsRequest",
  "type": "object",
  "properties": {
    "website_id": {
      "type": "string",
      "format": "uuid"
    },
    "filters": {
      "$ref": "#/$defs/ApiFiltersNoCompetitors"
    },
    "entity_ids": {
      "type": "array",
      "maxItems": 100,
      "description": "Entities to return observations for: the `website_id` for your brand, or competitor ids from `GET /api/v1/competitors`. Omit for every entity.",
      "items": {
        "type": "string",
        "format": "uuid"
      }
    },
    "attribute_ids": {
      "type": "array",
      "maxItems": 100,
      "description": "Attributes to return observations for, from `GET /api/v1/attributes`. Omit for every active attribute.",
      "items": {
        "type": "string",
        "format": "uuid"
      }
    },
    "positive": {
      "type": "boolean",
      "description": "`true` for favorable observations only, `false` for critical ones only. Omit for both directions."
    },
    "sort": {
      "type": "string",
      "enum": [
        "intensity",
        "recent"
      ],
      "default": "intensity",
      "description": "`intensity`: strongest first, unscored last, then newest. `recent`: newest first."
    },
    "page_num": {
      "type": "integer",
      "minimum": 0,
      "default": 0,
      "description": "Zero-indexed page number."
    },
    "page_size": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100,
      "default": 40,
      "description": "Rows per page."
    }
  },
  "required": [
    "website_id",
    "filters"
  ],
  "$defs": {
    "ApiFiltersNoCompetitors": {
      "type": "object",
      "description": "The shared filters without competitor_ids, for the brand trait endpoints that do not take it: /api/v1/attributes/cumulative is brand-only, and /api/v1/attributes/observations selects entities with `entity_ids`. Sending competitor_ids is rejected. Use /api/v1/attributes/competitors for per-competitor metrics.",
      "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"
          }
        },
        "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"
        }
      },
      "additionalProperties": false
    },
    "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"
        }
      ]
    }
  }
}