{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/customer-io/json-schema/customer-io-object-filter-schema.json",
  "title": "Object Filter",
  "description": "Use `and`, `or`, and `not` to combine object attribute conditions. The top-level object accepts one property; nest groups for complex filters.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/customer-io-objects-api-openapi.yml#/components/schemas/objectFilter",
  "x-scalar-ignore": true,
  "oneOf": [
    {
      "$ref": "#/$defs/objectFilterAnd"
    },
    {
      "$ref": "#/$defs/objectFilterOr"
    },
    {
      "$ref": "#/$defs/objectFilterNot"
    },
    {
      "title": "object attribute",
      "type": "object",
      "description": "A simple filter to find objects matching an attribute condition.",
      "properties": {
        "object_attribute": {
          "$ref": "#/$defs/objectattributeFilter"
        }
      }
    }
  ],
  "$defs": {
    "objectFilterAnd": {
      "x-scalar-ignore": true,
      "title": "and",
      "type": "object",
      "properties": {
        "and": {
          "type": "array",
          "description": "Match *all* conditions to return results.",
          "items": {
            "type": "object",
            "properties": {
              "object_attribute": {
                "$ref": "#/$defs/objectattributeFilter"
              }
            }
          }
        }
      }
    },
    "objectFilterNot": {
      "x-scalar-ignore": true,
      "title": "not",
      "type": "object",
      "properties": {
        "not": {
          "type": "object",
          "description": "Returns results if a condition is false. While and/or support an array of items, `not` supports a single condition.",
          "properties": {
            "object_attribute": {
              "$ref": "#/$defs/objectattributeFilter"
            }
          }
        }
      }
    },
    "objectFilterOr": {
      "x-scalar-ignore": true,
      "title": "or",
      "type": "object",
      "properties": {
        "or": {
          "type": "array",
          "description": "Match *any* condition to return results.",
          "items": {
            "type": "object",
            "properties": {
              "object_attribute": {
                "$ref": "#/$defs/objectattributeFilter"
              }
            }
          }
        }
      }
    },
    "object_type_id": {
      "x-scalar-ignore": true,
      "type": "string",
      "description": "The object type an object belongs to—like \"Companies\" or \"Accounts\". Object type IDs are string-formatted integers that begin at `1` and increment for each new type."
    },
    "objectattributeFilter": {
      "x-scalar-ignore": true,
      "title": "object attribute",
      "description": "Filter your objects by their attributes.",
      "type": "object",
      "required": [
        "field",
        "operator",
        "type_id"
      ],
      "properties": {
        "field": {
          "type": "string",
          "description": "The name of the attribute you want to filter against."
        },
        "operator": {
          "type": "string",
          "description": "Determine how to evaluate criteria against the field—`exists` returns results if an object has the attribute; `eq` returns results an object's attribute exists and the attribute has the `value` you specify.",
          "enum": [
            "eq",
            "exists"
          ]
        },
        "value": {
          "type": "string",
          "description": "The value you want to match for this attribute. You must include a value if you use the `eq` operator."
        },
        "type_id": {
          "$ref": "#/$defs/object_type_id"
        }
      }
    }
  }
}