# polymorfa audience

> Manage campaign audiences and their members.

## Commands

- [polymorfa audience create](https://docs.polymorfa.com/cli/audience/create): Create an audience. --csv reads a spreadsheet and sends up to 1000 members inline; --file-id imports a file already uploaded through the API.
- [polymorfa audience members add](https://docs.polymorfa.com/cli/audience/members-add): Add up to 1000 members to an audience. Repeated phone numbers are skipped and invalid entries are reported, not added.
- [polymorfa audience members list](https://docs.polymorfa.com/cli/audience/members-list): List one page of an audience’s members.
- [polymorfa audience members remove](https://docs.polymorfa.com/cli/audience/members-remove): Remove one member from an audience.

## polymorfa audience create

Create an audience. --csv reads a spreadsheet and sends up to 1000 members inline; --file-id imports a file already uploaded through the API.

### Usage

```bash
polymorfa audience create [flags]
```

### Flags

- `--csv <value>` (value). Read members from this spreadsheet and send them inline.
- `--file-id <value>` (value). Storage ID of a file already uploaded through the API. Requires --mapping.
- `--idempotency-key <value>` (value). Send this Idempotency-Key header. None is generated when omitted.
- `--mapping <value>` (value). Read the column mapping JSON ({"phone": "...", "variables": {...}}) from a file or stdin (-).
- `--name <value>` (value, required). Audience name.
- `--phone-column <value>` (value). Header naming the phone column. Defaults to phone.
- `--variable <value>` (value, repeatable). Map a template variable to a column, as name=column. Repeatable; quote a column name that contains spaces.

Also accepts the [global flags](https://docs.polymorfa.com/cli#global-flags).

### Examples

```bash
polymorfa audience create --name "August launch" --csv contacts.csv --variable firstName="First name"
```

```bash
polymorfa audience create --name "August launch" --file-id upload_1 --mapping mapping.json
```

## polymorfa audience members add

Add up to 1000 members to an audience. Repeated phone numbers are skipped and invalid entries are reported, not added.

### Usage

```bash
polymorfa audience members add AUDIENCE [flags]
```

### Arguments

- `AUDIENCE` (required). Audience ID.

### Flags

- `--csv <value>` (value). Read members from this spreadsheet and send them inline.
- `--idempotency-key <value>` (value). Send this Idempotency-Key header. The API does not replay appends, so the request is sent once and not retried.
- `--input <value>` (value). Read a JSON array of {phone, variables} from a file or stdin (-).
- `--phone-column <value>` (value). Header naming the phone column. Defaults to phone.
- `--variable <value>` (value, repeatable). Map a template variable to a column, as name=column. Repeatable; quote a column name that contains spaces.

Also accepts the [global flags](https://docs.polymorfa.com/cli#global-flags).

### Examples

```bash
polymorfa audience members add 018f0000-0000-7000-8000-000000000001 --csv contacts.csv
```

## polymorfa audience members list

List one page of an audience’s members.

### Usage

```bash
polymorfa audience members list AUDIENCE [flags]
```

### Arguments

- `AUDIENCE` (required). Audience ID.

### Flags

- `--cursor <value>` (value). Continue from this opaque cursor.
- `--limit <value>` (value). Request this many members. The API defaults to 25.

Also accepts the [global flags](https://docs.polymorfa.com/cli#global-flags).

## polymorfa audience members remove

Remove one member from an audience.

### Usage

```bash
polymorfa audience members remove AUDIENCE PHONE [flags]
```

### Arguments

- `AUDIENCE` (required). Audience ID.
- `PHONE` (required). Member phone number in international format.

### Flags

Also accepts the [global flags](https://docs.polymorfa.com/cli#global-flags).
