Customer.io · Schema

Audience Filter

Use `and`, `or`, and `not` to combine segment and attribute conditions. The top-level object accepts one property; nest groups for complex filters.

Behavioral DataBroadcastCampaignsCDPCustomer DataCustomer Data PlatformData IngestionEmailEvent TrackingMarketing AutomationMessagingPush NotificationsSegmentsSMSTransactional EmailA2A
View JSON Schema on GitHub

JSON Schema

customer-io-audience-filter-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/customer-io/json-schema/customer-io-audience-filter-schema.json",
  "title": "Audience Filter",
  "description": "Use `and`, `or`, and `not` to combine segment and 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-customers-api-openapi.yml#/components/schemas/audienceFilter",
  "x-scalar-ignore": true,
  "oneOf": [
    {
      "$ref": "#/$defs/andAudienceFilter"
    },
    {
      "$ref": "#/$defs/orAudienceFilter"
    },
    {
      "$ref": "#/$defs/notAudienceFilter"
    },
    {
      "title": "segment",
      "description": "Filter for people who belong to a segment.",
      "type": "object",
      "properties": {
        "segment": {
          "$ref": "#/$defs/segmentAudienceFilter"
        }
      }
    },
    {
      "title": "audience",
      "type": "object",
      "description": "filter for people who have an attribute or an attribute value.",
      "properties": {
        "attribute": {
          "$ref": "#/$defs/attributeAudienceFilter"
        }
      }
    }
  ],
  "$defs": {
    "andAudienceFilter": {
      "x-scalar-ignore": true,
      "title": "and",
      "type": "object",
      "properties": {
        "and": {
          "type": "array",
          "description": "Match *all* conditions to return results.",
          "items": {
            "type": "object",
            "properties": {
              "or": {
                "type": "array",
                "description": "Returns results matching *any* conditions.",
                "items": {
                  "$ref": "#/$defs/simpleAudienceFilter"
                }
              },
              "not": {
                "description": "Returns people who don't match the condition inside it. `not` takes a single object, not an array. That object can be one condition, or an `and` or `or` group when you want to exclude people who match a combination of conditions.",
                "oneOf": [
                  {
                    "title": "and",
                    "type": "object",
                    "properties": {
                      "and": {
                        "type": "array",
                        "description": "Match *all* conditions to return results.",
                        "items": {
                          "$ref": "#/$defs/simpleAudienceFilter"
                        }
                      }
                    }
                  },
                  {
                    "title": "or",
                    "type": "object",
                    "properties": {
                      "or": {
                        "type": "array",
                        "description": "Match *any* condition to return results.",
                        "items": {
                          "$ref": "#/$defs/simpleAudienceFilter"
                        }
                      }
                    }
                  },
                  {
                    "title": "segment",
                    "type": "object",
                    "properties": {
                      "segment": {
                        "$ref": "#/$defs/segmentAudienceFilter"
                      }
                    }
                  },
                  {
                    "title": "attribute",
                    "type": "object",
                    "properties": {
                      "attribute": {
                        "$ref": "#/$defs/attributeAudienceFilter"
                      }
                    }
                  }
                ]
              },
              "segment": {
                "$ref": "#/$defs/segmentAudienceFilter"
              },
              "attribute": {
                "$ref": "#/$defs/attributeAudienceFilter"
              }
            }
          }
        }
      }
    },
    "attributeAudienceFilter": {
      "x-scalar-ignore": true,
      "title": "attribute",
      "description": "Filter your audience by attribute.",
      "type": "object",
      "required": [
        "field",
        "operator"
      ],
      "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 a person in the audience has the attribute; `eq` returns results if the audience has the attribute 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."
        },
        "inverse": {
          "type": "boolean",
          "default": false,
          "description": "Set to `true` to match people who *don't* meet the condition."
        }
      }
    },
    "complexAudienceFilter": {
      "x-scalar-ignore": true,
      "title": "People Filter",
      "type": "object",
      "description": "Filter people with `and`, `or`, and `not` groups made from `segment` and `attribute` conditions.",
      "properties": {
        "and": {
          "type": "array",
          "description": "Returns results matching *all* conditions.",
          "items": {
            "$ref": "#/$defs/simpleAudienceFilter"
          }
        },
        "or": {
          "type": "array",
          "description": "Returns results matching *any* conditions.",
          "items": {
            "$ref": "#/$defs/simpleAudienceFilter"
          }
        },
        "not": {
          "description": "Returns people who don't match conditions. `not` takes a single object, not an array. That object can be one condition, or an `and` or `or` group when you want to exclude people who match a combination of conditions.",
          "oneOf": [
            {
              "title": "and",
              "type": "object",
              "properties": {
                "and": {
                  "type": "array",
                  "description": "Match *all* conditions to return results.",
                  "items": {
                    "$ref": "#/$defs/simpleAudienceFilter"
                  }
                }
              }
            },
            {
              "title": "or",
              "type": "object",
              "properties": {
                "or": {
                  "type": "array",
                  "description": "Match *any* condition to return results.",
                  "items": {
                    "$ref": "#/$defs/simpleAudienceFilter"
                  }
                }
              }
            },
            {
              "title": "segment",
              "type": "object",
              "properties": {
                "segment": {
                  "$ref": "#/$defs/segmentAudienceFilter"
                }
              }
            },
            {
              "title": "attribute",
              "type": "object",
              "properties": {
                "attribute": {
                  "$ref": "#/$defs/attributeAudienceFilter"
                }
              }
            }
          ]
        },
        "segment": {
          "$ref": "#/$defs/segmentAudienceFilter"
        },
        "attribute": {
          "$ref": "#/$defs/attributeAudienceFilter"
        }
      }
    },
    "notAudienceFilter": {
      "x-scalar-ignore": true,
      "title": "not",
      "description": "Returns people who don't match the condition inside it. `not` takes a single object, not an array. That object can be one condition, or an `and` or `or` group when you want to exclude people who match a combination of conditions.",
      "oneOf": [
        {
          "title": "and",
          "type": "object",
          "properties": {
            "and": {
              "type": "array",
              "description": "Match *all* conditions to return results.",
              "items": {
                "$ref": "#/$defs/complexAudienceFilter"
              }
            }
          }
        },
        {
          "title": "or",
          "type": "object",
          "properties": {
            "or": {
              "type": "array",
              "description": "Match *any* condition to return results.",
              "items": {
                "$ref": "#/$defs/complexAudienceFilter"
              }
            }
          }
        },
        {
          "title": "segment",
          "type": "object",
          "properties": {
            "segment": {
              "$ref": "#/$defs/segmentAudienceFilter"
            }
          }
        },
        {
          "title": "attribute",
          "type": "object",
          "properties": {
            "attribute": {
              "$ref": "#/$defs/attributeAudienceFilter"
            }
          }
        }
      ]
    },
    "orAudienceFilter": {
      "x-scalar-ignore": true,
      "title": "or",
      "type": "object",
      "properties": {
        "or": {
          "type": "array",
          "description": "Match *any* condition to return results.",
          "items": {
            "type": "object",
            "properties": {
              "and": {
                "type": "array",
                "description": "Returns results matching *all* conditions.",
                "items": {
                  "$ref": "#/$defs/simpleAudienceFilter"
                }
              },
              "not": {
                "description": "Returns people who don't match the condition inside it. `not` takes a single object, not an array. That object can be one condition, or an `and` or `or` group when you want to exclude people who match a combination of conditions.",
                "oneOf": [
                  {
                    "title": "and",
                    "type": "object",
                    "properties": {
                      "and": {
                        "type": "array",
                        "description": "Match *all* conditions to return results.",
                        "items": {
                          "$ref": "#/$defs/simpleAudienceFilter"
                        }
                      }
                    }
                  },
                  {
                    "title": "or",
                    "type": "object",
                    "properties": {
                      "or": {
                        "type": "array",
                        "description": "Match *any* condition to return results.",
                        "items": {
                          "$ref": "#/$defs/simpleAudienceFilter"
                        }
                      }
                    }
                  },
                  {
                    "title": "segment",
                    "type": "object",
                    "properties": {
                      "segment": {
                        "$ref": "#/$defs/segmentAudienceFilter"
                      }
                    }
                  },
                  {
                    "title": "attribute",
                    "type": "object",
                    "properties": {
                      "attribute": {
                        "$ref": "#/$defs/attributeAudienceFilter"
                      }
                    }
                  }
                ]
              },
              "segment": {
                "$ref": "#/$defs/segmentAudienceFilter"
              },
              "attribute": {
                "$ref": "#/$defs/attributeAudienceFilter"
              }
            }
          }
        }
      }
    },
    "segmentAudienceFilter": {
      "x-scalar-ignore": true,
      "title": "segment",
      "type": "object",
      "description": "Provide the `id` of a segment containing people you want to search for.",
      "properties": {
        "id": {
          "type": "integer",
          "description": "The ID of the segment you want to return people from."
        },
        "inverse": {
          "type": "boolean",
          "default": false,
          "description": "Set to `true` to match people who *aren't* in the segment."
        }
      }
    },
    "simpleAudienceFilter": {
      "x-scalar-ignore": true,
      "anyOf": [
        {
          "title": "segment",
          "description": "Filter for people who belong to a segment.",
          "type": "object",
          "properties": {
            "segment": {
              "$ref": "#/$defs/segmentAudienceFilter"
            }
          }
        },
        {
          "title": "audience",
          "type": "object",
          "description": "filter for people who have an attribute or an attribute value.",
          "properties": {
            "attribute": {
              "$ref": "#/$defs/attributeAudienceFilter"
            }
          }
        }
      ]
    }
  }
}

Work with this as data

Every JSON Schema here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for schemas

4 MCP tools reach this
  • find_json_schemasBrowse and filter every JSON Schema in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This JSON Schema
curl "https://apis.io/api/v1/json-schemas/customer-io-audience-filter"
All schemas
curl "https://apis.io/api/v1/json-schemas?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.