{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/reddit/json-schema/reddit-components-schema-ad-account-history-filter-schema.json",
  "title": "components_schema_ad_account_history_filter",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/reddit-ad-account-history-api-openapi.yml#/components/schemas/components_schema_ad_account_history_filter",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "start_time": {
      "type": "string",
      "description": "Start of the time window for filtering changes.",
      "format": "date-time"
    },
    "end_time": {
      "type": "string",
      "description": "End of the time window for filtering changes.",
      "format": "date-time"
    },
    "member_ids": {
      "type": "array",
      "description": "Filter by the member IDs who made the changes.",
      "items": {
        "type": "string"
      }
    },
    "change_types": {
      "type": "array",
      "description": "Filter by change types.",
      "items": {
        "type": "string",
        "enum": [
          "AD_ACCOUNT",
          "AD",
          "AD_GROUP",
          "AUDIENCE",
          "BID",
          "BUDGET",
          "CAMPAIGN",
          "STATUS",
          "TARGETING"
        ]
      }
    },
    "entity_id_filters": {
      "type": "array",
      "title": "EntityIdFilters",
      "description": "Expanded ID filters for specific campaigns, ad groups, or ads.",
      "items": {
        "type": "object",
        "title": "EntityIdFilter",
        "additionalProperties": false,
        "required": [
          "entity_ids",
          "entity_type"
        ],
        "properties": {
          "entity_ids": {
            "type": "array",
            "description": "Filter by entity IDs.",
            "items": {
              "type": "string"
            }
          },
          "entity_type": {
            "type": "string",
            "description": "Filter by entity type. Use the most specific type needed, or the parent type with `include_child_entities` to widen scope.",
            "enum": [
              "AD",
              "AD_GROUP",
              "CAMPAIGN"
            ]
          },
          "include_child_entities": {
            "type": "boolean",
            "description": "Whether to include nested entities. Defaults to `false`."
          }
        }
      }
    },
    "entity_field_filters": {
      "type": "array",
      "title": "EntityFieldFilters",
      "deprecated": true,
      "description": "This filter is deprecated and no longer used for history filtering. It is ignored if provided. Use `change_types` to filter history by entity field changes.",
      "items": {
        "type": "object",
        "title": "EntityFieldFilter",
        "additionalProperties": false,
        "required": [
          "entity_fields",
          "entity_type"
        ],
        "properties": {
          "entity_fields": {
            "type": "array",
            "description": "Filter by entity fields.",
            "items": {
              "type": "string"
            }
          },
          "entity_type": {
            "type": "string",
            "description": "Filter by entity type. Use the most specific type needed, or the parent type with `include_child_entities` to widen scope.",
            "enum": [
              "AD",
              "AD_ACCOUNT",
              "AD_GROUP",
              "AUDIENCE",
              "CAMPAIGN"
            ]
          }
        }
      }
    },
    "entity_name_filters": {
      "type": "array",
      "title": "EntityNameFilters",
      "description": "Expanded name filters for specific campaigns, ad groups, or ads.",
      "items": {
        "type": "object",
        "title": "EntityNameFilter",
        "additionalProperties": false,
        "required": [
          "entity_names",
          "entity_type",
          "operator"
        ],
        "properties": {
          "entity_names": {
            "type": "array",
            "description": "Filter by entity names.",
            "items": {
              "type": "string"
            }
          },
          "entity_type": {
            "type": "string",
            "description": "Filter by entity type.",
            "enum": [
              "AD",
              "AD_GROUP",
              "CAMPAIGN"
            ]
          },
          "operator": {
            "type": "string",
            "description": "The operator to filter on.",
            "enum": [
              "EQUALS",
              "LIKE"
            ]
          },
          "include_child_entities": {
            "type": "boolean",
            "description": "Whether to include nested entities. Defaults to `false`."
          }
        }
      }
    }
  }
}