# Audience selection

Select an audience of passes for scheduled updates or other operations.


## Atomic selector {#atomicselector}

Determines the property type you want to target. This can be tag, segment, template, pass or externalId.

[Jump to examples ↓](#atomicselector-examples)

- **`externalId`** `string[string]`

  The pass external ID. Must also include a template.

  Example: `1234`

- **`passId`** `number[number]`

  The pass ID.

  Example: `1234`

- **`segment`** `array[string]`

  The segment ID.

  Example: `00256e0b-b02f-4f12-a77f-4c3d57078330`

- **`tag`** `array[string]`

  A tag is arbitrary metadata string used to identify and target passes.

  Example: `cool_tag,cool_cool_tag`

- **`templateId`** `number[string]`

  The template ID.

  Example: `1234`


**Used in:**

- [Get schedule]({{< ref "/developer/rest-api/wallet/operations/schedules/" >}}#getschedule)
- [List schedules]({{< ref "/developer/rest-api/wallet/operations/schedules/" >}}#listschedules)
- [Schedule an update or push notification]({{< ref "/developer/rest-api/wallet/operations/schedules/" >}}#scheduleupdate)
- [Update schedule]({{< ref "/developer/rest-api/wallet/operations/schedules/" >}}#updateschedule)

**Examples**

*Example atomic selector tag*

```json
{
  "audience": {
      "tag": "TZ_PST"
  }
}

```

*Example atomic selector segment*

```json
{
  "audience": {
      "segment": "3b13666df-e5b3-4e42-8919-f8d63bd7ce2a"
  }
}

```

*Example atomic selector template*

```json
{
  "audience": {
      "templateId": 1234
  }
}

```

*Example atomic selector pass*

```json
{
  "audience": {
      "passId": 1234
  }
}

```

*Example atomic selector external ID*

```json
{
  "audience": {
    "and": [
      { "externalId": "test_ext_id" },
      { "templateId": "12345" }
    ]
  }
}

```

---

## Audience selector {#audienceselector}

Determines the passes you want to target.

[Jump to examples ↓](#audienceselector-examples)

**One of:**

- [Compound selector]({{< ref "/developer/rest-api/wallet/schemas/audience-selection/" >}}#compoundselector)

  Compound selectors combine boolean operators (AND, OR, or NOT) with atomic or nested compound selectors. The syntax can be either implicit, using an array of values associated with an atomic selector, or explicit, employing a boolean operator followed by an array of atomic expression objects.

- [Atomic selector]({{< ref "/developer/rest-api/wallet/schemas/audience-selection/" >}}#atomicselector)

  Determines the property type you want to target. This can be tag, segment, template, pass or externalId.

- `string`

  All passes.


**Used in:**

- [Get schedule]({{< ref "/developer/rest-api/wallet/operations/schedules/" >}}#getschedule)
- [List schedules]({{< ref "/developer/rest-api/wallet/operations/schedules/" >}}#listschedules)
- [Schedule an update or push notification]({{< ref "/developer/rest-api/wallet/operations/schedules/" >}}#scheduleupdate)
- [Update schedule]({{< ref "/developer/rest-api/wallet/operations/schedules/" >}}#updateschedule)

**Examples**

*Example pass objects tagged for baseball or basketball and in time zone PST*

```json
{
  "audience": {
      "AND": [
        {
            "OR": [
              {
                  "tag": "baseball"
              },
              {
                  "tag": "basketball"
              }
            ]
        },
        {
            "tag": "TZ_PST"
        }
      ]
  }              
}

```

*Example pass objects tagged for time zone ET and not for time zone PST*

```json
{
  "audience": {
      "AND": [
        {
            "tag": "TZ_ET"
        },
        {
            "NOT": {
              "tag": "TZ_PST"
            }
        }
      ]
  }              
}

```

---

## Compound selector {#compoundselector}

Compound selectors combine boolean operators (AND, OR, or NOT) with atomic or nested compound selectors. The syntax can be either implicit, using an array of values associated with an atomic selector, or explicit, employing a boolean operator followed by an array of atomic expression objects.

[Jump to examples ↓](#compoundselector-examples)

**One of:**

- [Atomic selector]({{< ref "/developer/rest-api/wallet/schemas/audience-selection/" >}}#atomicselector)

  Determines the property type you want to target. This can be tag, segment, template, pass or externalId.

  AND selector

  - **`AND`** `array`
    **One of:**

    - [Compound selector]({{< ref "/developer/rest-api/wallet/schemas/audience-selection/" >}}#compoundselector)

      Compound selectors combine boolean operators (AND, OR, or NOT) with atomic or nested compound selectors. The syntax can be either implicit, using an array of values associated with an atomic selector, or explicit, employing a boolean operator followed by an array of atomic expression objects.

    - [Atomic selector]({{< ref "/developer/rest-api/wallet/schemas/audience-selection/" >}}#atomicselector)

      Determines the property type you want to target. This can be tag, segment, template, pass or externalId.


  OR selector

  - **`OR`** `array`
    **One of:**

    - [Compound selector]({{< ref "/developer/rest-api/wallet/schemas/audience-selection/" >}}#compoundselector)

      Compound selectors combine boolean operators (AND, OR, or NOT) with atomic or nested compound selectors. The syntax can be either implicit, using an array of values associated with an atomic selector, or explicit, employing a boolean operator followed by an array of atomic expression objects.

    - [Atomic selector]({{< ref "/developer/rest-api/wallet/schemas/audience-selection/" >}}#atomicselector)

      Determines the property type you want to target. This can be tag, segment, template, pass or externalId.


  NOT selector

  - **`NOT`** `array`
    **One of:**

    - [Compound selector]({{< ref "/developer/rest-api/wallet/schemas/audience-selection/" >}}#compoundselector)

      Compound selectors combine boolean operators (AND, OR, or NOT) with atomic or nested compound selectors. The syntax can be either implicit, using an array of values associated with an atomic selector, or explicit, employing a boolean operator followed by an array of atomic expression objects.

    - [Atomic selector]({{< ref "/developer/rest-api/wallet/schemas/audience-selection/" >}}#atomicselector)

      Determines the property type you want to target. This can be tag, segment, template, pass or externalId.



**Used in:**

- [Get schedule]({{< ref "/developer/rest-api/wallet/operations/schedules/" >}}#getschedule)
- [List schedules]({{< ref "/developer/rest-api/wallet/operations/schedules/" >}}#listschedules)
- [Schedule an update or push notification]({{< ref "/developer/rest-api/wallet/operations/schedules/" >}}#scheduleupdate)
- [Update schedule]({{< ref "/developer/rest-api/wallet/operations/schedules/" >}}#updateschedule)

**Examples**

*Example implicit OR*

```json
{
  "audience": {
      "tag": [
        "apples",
        "oranges",
        "bananas"
      ]
  }
}

```

*Example explicit OR*

```json
{
  "audience": {
      "OR": [
        {
            "tag": "apples"
        },
        {
            "tag": "oranges"
        },
        {
            "tag": "bananas"
        }
      ]
  }
}

```

---

