# Audiences

Audiences allow tenant administrators to create reusable user or account segments for targeted marketing campaigns, notifications, and analytics.

Audiences support dynamic segmentation based on attributes (e.g. location, customer tier), user roles (`user_type`), and custom profile metadata.

## Audience Types

- **`user`**: Evaluates individual platform users matching filter conditions.
- **`account`**: Evaluates business or seller accounts matching filter conditions.

## Filter Structure

Audiences support either a flat array of filters (implicit AND logic) or grouped logical conditions with `AND` / `OR` operations:

```json
{
  "logic": "AND",
  "groups": [
    {
      "logic": "OR",
      "filters": [
        {
          "dimension": "user_type",
          "operator": "includes",
          "value": "buyer"
        }
      ]
    }
  ]
}
```

### Supported Dimensions

1. **`attribute`**: Matches tenant attribute values (`attribute_id`, `operator`, `value` / `values` / `attribute_value_id`).
2. **`user_type`**: Matches user role tags like `buyer`, `seller`, `customer` (`operator`: `equals`, `includes`, `not_equals`, `in`, `not_in`).
3. **`metadata`**: Evaluates custom JSON properties stored in user or account metadata (`path`, `operator`, `value`).

## Audience Status

- **`draft`**: Default status upon creation.
- **`active`**: Activated audience available for campaigns and scheduled triggers.
- **`inactive`**: Deactivated audience.
