# inboxjot contacts

Manage contacts.

## contacts list

List contacts.

```sh
inboxjot contacts list [options]
```

| Option                | Description                                                                                            |
| --------------------- | ------------------------------------------------------------------------------------------------------ |
| `--query <QUERY>`     | Show contacts whose name or email matches this text.                                                   |
| `--segment <SEGMENT>` | Show only contacts in this segment.                                                                    |
| `--status <STATUS>`   | Show only contacts with this status. One of `subscribed`, `pending`, `not-subscribed`, `unsubscribed`. |
| `-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 contacts list --status subscribed
inboxjot contacts list --segment seg_123 --all --json
```

## contacts inspect

Show a contact.

```sh
inboxjot contacts inspect <CONTACT>
```

| Argument  | Description                    |
| --------- | ------------------------------ |
| `CONTACT` | Contact ID or email. Required. |

```sh
inboxjot contacts inspect riti@example.com
```

## contacts create

Add a contact, or change the contact with that email.

```sh
inboxjot contacts create [options]
```

| Option                      | Description                                                                      |
| --------------------------- | -------------------------------------------------------------------------------- |
| `--email <EMAIL>`           | Email address of the contact.                                                    |
| `--first-name <FIRST_NAME>` | First name.                                                                      |
| `--last-name <LAST_NAME>`   | Last name.                                                                       |
| `--language <LANGUAGE>`     | Language code, such as en or pt-BR.                                              |
| `--notes <NOTES>`           | Private notes.                                                                   |
| `--property <KEY=VALUE>`    | Set a property, such as plan=pro; numbers, true, false and null keep their type. |
| `--subscribed <BOOL>`       | Subscribe to or unsubscribe from all email. One of `true`, `false`.              |
| `--segment <SEGMENT>`       | Add the contact to this static segment.                                          |

```sh
inboxjot contacts create --email riti@example.com --first-name Riti --property plan=pro
inboxjot contacts create --email sukha@example.com --subscribed true --segment seg_123
```

## contacts update

Change a contact.

```sh
inboxjot contacts update <CONTACT> [options]
```

| Argument  | Description                    |
| --------- | ------------------------------ |
| `CONTACT` | Contact ID or email. Required. |

| Option                             | Description                                                                      |
| ---------------------------------- | -------------------------------------------------------------------------------- |
| `--first-name <FIRST_NAME>`        | First name.                                                                      |
| `--last-name <LAST_NAME>`          | Last name.                                                                       |
| `--language <LANGUAGE>`            | Language code, such as en or pt-BR.                                              |
| `--notes <NOTES>`                  | Private notes.                                                                   |
| `--property <KEY=VALUE>`           | Set a property, such as plan=pro; numbers, true, false and null keep their type. |
| `--subscribed <BOOL>`              | Subscribe to or unsubscribe from all email. One of `true`, `false`.              |
| `--subscribe-to <TOPIC>`           | Subscribe the contact to this topic.                                             |
| `--unsubscribe-from <TOPIC>`       | Unsubscribe the contact from this topic.                                         |
| `--subscribe-to-brand <BRAND>`     | Subscribe the contact to this brand.                                             |
| `--unsubscribe-from-brand <BRAND>` | Unsubscribe the contact from this brand and all its topics.                      |
| `--clear <FIELD>`                  | Clear a field. One of `first-name`, `last-name`, `notes`.                        |

```sh
inboxjot contacts update riti@example.com --property plan=team
inboxjot contacts update riti@example.com --subscribe-to top_123
inboxjot contacts update riti@example.com --unsubscribe-from-brand "Acme Labs"
```

## contacts delete

Delete a contact.

```sh
inboxjot contacts delete <CONTACT>
```

| Argument  | Description                    |
| --------- | ------------------------------ |
| `CONTACT` | Contact ID or email. Required. |

```sh
inboxjot contacts delete riti@example.com
```

## contacts erase

Erase all data for an email address.

```sh
inboxjot contacts erase <EMAIL>
```

| Argument | Description                       |
| -------- | --------------------------------- |
| `EMAIL`  | Email address to erase. Required. |

```sh
inboxjot contacts erase riti@example.com --yes
```

## contacts import

Import contacts from a CSV file.

```sh
inboxjot contacts import <FILE> [options]
```

| Argument | Description                           |
| -------- | ------------------------------------- |
| `FILE`   | CSV file with a header row. Required. |

| Option                | Description                                                  |
| --------------------- | ------------------------------------------------------------ |
| `--segment <SEGMENT>` | Add the contacts to this static segment ID.                  |
| `--dry-run`           | Print how the columns map to contact fields and stop.        |
| `--timeout <TIMEOUT>` | Stop waiting for the import after this long. Default: `10m`. |

```sh
inboxjot contacts import customers.csv --dry-run
inboxjot contacts import customers.csv --segment seg_123
```

## contacts export

Export contacts to a CSV file.

```sh
inboxjot contacts export [options]
```

| Option                | Description                                                  |
| --------------------- | ------------------------------------------------------------ |
| `--segment <SEGMENT>` | Export only the contacts in this segment, by name or ID.     |
| `-o, --output <PATH>` | File to write; defaults to contacts-\<date>.csv.             |
| `--timeout <TIMEOUT>` | Stop waiting for the export after this long. Default: `10m`. |

```sh
inboxjot contacts export --output contacts.csv
```
