# inboxjot segments

Manage segments and their members.

## segments list

List segments.

```sh
inboxjot segments list [options]
```

| Option                | Description                                                  |
| --------------------- | ------------------------------------------------------------ |
| `--type <KIND>`       | Show only segments of this type. One of `static`, `dynamic`. |
| `--query <QUERY>`     | Show segments whose name matches this text.                  |
| `-n, --limit <LIMIT>` | Show at most this many rows. Default: `50`.                  |
| `--all`               | Show every row, one page after another.                      |
| `--after <CURSOR>`    | Show the rows after this cursor.                             |
| `--before <CURSOR>`   | Show the rows before this cursor.                            |

```sh
inboxjot segments list --type dynamic
```

## segments inspect

Show a segment and its rules.

```sh
inboxjot segments inspect <SEGMENT>
```

| Argument  | Description                   |
| --------- | ----------------------------- |
| `SEGMENT` | Segment name or ID. Required. |

```sh
inboxjot segments inspect "Engaged customers"
```

## segments create

Create a segment.

```sh
inboxjot segments create [options]
```

| Option                        | Description                                                                                  |
| ----------------------------- | -------------------------------------------------------------------------------------------- |
| `--name <NAME>`               | Segment name, such as "Engaged customers".                                                   |
| `--type <KIND>`               | Segment type \[default: dynamic with --conditions, else static]. One of `static`, `dynamic`. |
| `--description <DESCRIPTION>` | Segment description.                                                                         |
| `--conditions <JSON>`         | Rules of a dynamic segment as JSON, or @file to read them from a file.                       |

```sh
inboxjot segments create --name "Beta testers" --type static
inboxjot segments create --name "Pro plan" --type dynamic --conditions @pro.json
```

## segments update

Change a segment.

```sh
inboxjot segments update <SEGMENT> [options]
```

| Argument  | Description                   |
| --------- | ----------------------------- |
| `SEGMENT` | Segment name or ID. Required. |

| Option                        | Description                                           |
| ----------------------------- | ----------------------------------------------------- |
| `--name <NAME>`               | New segment name.                                     |
| `--description <DESCRIPTION>` | New segment description.                              |
| `--conditions <JSON>`         | New rules as JSON, or @file to read them from a file. |
| `--clear <FIELD>`             | Clear a field. One of `description`.                  |

```sh
inboxjot segments update seg_123 --name "Early customers"
```

## segments delete

Delete a segment.

```sh
inboxjot segments delete <SEGMENT>
```

| Argument  | Description                   |
| --------- | ----------------------------- |
| `SEGMENT` | Segment name or ID. Required. |

```sh
inboxjot segments delete seg_123
```

## segments members list

List the contacts in a segment.

```sh
inboxjot segments members list <SEGMENT> [options]
```

| Argument  | Description                   |
| --------- | ----------------------------- |
| `SEGMENT` | Segment name or ID. Required. |

| Option                | Description                                         |
| --------------------- | --------------------------------------------------- |
| `--query <QUERY>`     | Show members whose name or email matches this text. |
| `-n, --limit <LIMIT>` | Show at most this many rows. Default: `50`.         |
| `--all`               | Show every row, one page after another.             |
| `--after <CURSOR>`    | Show the rows after this cursor.                    |
| `--before <CURSOR>`   | Show the rows before this cursor.                   |

```sh
inboxjot segments members list "Beta testers"
```

## segments members add

Add contacts to a static segment.

```sh
inboxjot segments members add <SEGMENT> <CONTACT>
```

| Argument  | Description                                                          |
| --------- | -------------------------------------------------------------------- |
| `SEGMENT` | Segment name or ID. Required.                                        |
| `CONTACT` | Contact ID or email, or - to read one per line from stdin. Required. |

```sh
inboxjot segments members add "Beta testers" riti@example.com
```

## segments members remove

Remove contacts from a static segment.

```sh
inboxjot segments members remove <SEGMENT> <CONTACT>
```

| Argument  | Description                                                          |
| --------- | -------------------------------------------------------------------- |
| `SEGMENT` | Segment name or ID. Required.                                        |
| `CONTACT` | Contact ID or email, or - to read one per line from stdin. Required. |

```sh
inboxjot segments members remove "Beta testers" riti@example.com
```
