---
title: "openemail threads"
description: "Every command in this namespace, with its arguments, flags and examples."
url: "https://openemail.uk/docs/cli/reference/threads"
area: "CLI"
category: "Reference"
---

# openemail threads

Every command in this namespace, with its arguments, flags and examples.

## Commands

### `openemail threads list`

List one page of threads in a folder

```bash
openemail threads list [flags]
```

Returns one page of threads from the mailbox index, ordered by each thread's latest message with the newest first unless `sort` says otherwise. A row is only `object` and `id`, so call `get` for the messages, labels and unread state.

`sort`, `--date-from`, `--date-to` and `--from-contacts` are the thread list's own controls: the four orders, a date range read against the newest message on each thread, and a filter to mail from saved contacts. Every order pages to the end, and a cursor carries on in the order it was handed out in, so send the same filters with it.

`folder` defaults to `inbox` and is matched against label ids after being upper cased, so `sent`, `archive`, `spam`, `trash`, `draft`, `snoozed`, `starred` and `unread` all work, `bin` is read as `trash`, and a user label id works as a folder too. A name that matches nothing returns an empty page rather than an error. `--label-ids` narrows the folder further: a thread must carry the folder label and every id you pass.

`query` takes the mailbox search syntax. Plain words must all appear, and each matches loosely: case, accents and separators are ignored and part of a longer word counts, so `min` finds "Benjamin". A quoted phrase is matched as written apart from case and accents, so `"ben jamin"` does not find "Ben-Jamin" while `"quarterly invoice"` finds "Quarterly invoice". When nothing matches exactly, close spellings are returned instead, so `benjimin` finds "Benjamin": a plain word, or the value of `from:`, `to:`, `cc:`, `subject:`, `body:`, `filename:` or `label:`, may differ from the start of a word by one typo when it has four to seven letters and by two when it has eight or more, while a quoted phrase, a word containing a digit, a shorter word and an excluded word still match exactly, and the pages that follow keep matching the same way. Filler words such as `the`, `about` or `emails` are dropped from a list of plain words when something else is left to search for, so `emails from john` searches for `john` alone. Operators such as `from:`, `to:`, `subject:`, `label:`, `is:unread`, `has:pdf`, `after:2026/01/31` and `newer_than:7d` narrow it, and `OR`, parentheses and a leading `-` combine them. Recipients are stored as one list without roles and never hold a Bcc, so `cc:` reads the same field as `to:` and `bcc:` matches nothing of its own. `from:me` is mail you sent, and `to:me` is mail carrying one of your own addresses, aliases included, among its recipients or as the address it was delivered to.

Words and the `from:`, `to:`, `cc:`, `subject:` and `body:` operators read only the newest message on each thread: its sender, its recipients, its subject and the first 4,000 characters of its body with markup stripped. `filename:` and `has:` read every attachment on the whole conversation, and `label:`, `in:` and `is:` read the whole conversation. A plain word also matches the name of any attachment on the conversation, whichever message carried it. A sealed message has no body text to match. The search stays inside `folder` unless the query names a folder itself, with `in:` or a folder `is:` such as `is:sent`, and `in:anywhere` searches every folder, on its own as well as beside other terms. A drafts listing is the exception and stays in drafts whatever the query names.

Dates read the newest activity on the thread, in UTC. `after:` includes the day it names and `before:` excludes it, and a date can be written `YYYY/MM/DD`, `YYYY-MM-DD`, `YYYYMMDD`, as a bare year, or as epoch seconds or milliseconds. A short date reads day first (`16/09/2026`), unless the second number cannot be a month (`09/16/2026`), and a number above 12 settles it either way. The API pages with an opaque `pageToken`, which the SDK hands back as `nextCursor` and accepts as `--cursor`.

Add `--all` to walk every page: a table on a terminal, one JSON object per line when piped or with `--ndjson`, and one `{ items, hasMore, nextCursor }` document with `--json`. `--max <n>` stops after that many items.

- Scopes: `threads:read`.
- Needs a sign-in.
- Aliases: `ls`.

**Flags**

- `--folder <value>` (default `"inbox"`): Label the threads must carry, case insensitive. Defaults to `inbox`, and `bin` is read as `trash`.
- `--query <value>`: Mailbox search. Plain words must all appear and match loosely, a quoted phrase has to appear as written, filler words are dropped when something else is left to search for, and operators such as `from:ada`, `has:pdf` and `in:anywhere` narrow it.
- `--label-ids <a,b>` (repeatable): Label ids a thread must all carry on top of `folder`, matched exactly. An array is sent comma separated.
- `--sort <value>` (default `"newest"`): `newest` (the default), `oldest`, `sender` or `subject`, the four orders of the thread list in the app. `sender` and `subject` are alphabetical, newest first within one sender or subject.
- `--date-from <when>`: Keeps threads whose newest message arrived at or after this instant. A `Date` or an ISO 8601 string with a time and an offset.
- `--date-to <when>`: Keeps threads whose newest message arrived at or before this instant. Both ends are included, and `--date-from` after `--date-to` is a 422.
- `--from-contacts`: When true, keeps only threads whose newest message came from a saved contact. A key limited to some addresses reads the contacts its owner saved.
- `--limit <n>`: Threads per page, a whole number from 1 to 100. Defaults to 25.
- `--cursor <value>`: The `nextCursor` of the previous page, passed back unchanged.
- `--all`: Fetch every page and stream the items as they arrive.
- `--max <n>`: Stop after this many items. Implies `--all`.
- `--ndjson`: Print every item as one JSON object per line. Implies `--all`

**Examples**

```bash
openemail threads list
```

With optional flags

```bash
openemail threads list --folder inbox --query 'from:ada has:pdf' --sort oldest
```

Walk every page and stop after 100 items

```bash
openemail threads list --all --max 100
```

One JSON object per line when piped

```bash
openemail threads list --all > threads.ndjson
```

Also available in: API [`GET /threads`](https://openemail.uk/docs/api/reference/threads#get-threads); SDK [`threads.list()`](https://openemail.uk/docs/sdk/reference/threads#list).

### `openemail threads get`

Read a thread with every message on it

```bash
openemail threads get <id> [flags]
```

Returns the whole conversation, oldest message first, with the labels the thread sits in and its unread state. Unsent draft replies are included in `messages` with `isDraft: true`, which is why `messageCount`, the length of `messages`, can be higher than `totalReplies`, which counts only real messages.

Messages are passed through as the mailbox stored them, so `MessageResource` is an open record rather than a fixed field list. The one field the API commits to is `encryption`. When `encryption.format` is `pgp-mime`, `pgp-inline` or `smime-encrypted`, the message is sealed and its body is empty or holds armour. `pgp-signed` and `smime-signed` are ordinary readable mail. A message with no `encryption` at all was stored before detection existed, so its absence says nothing about whether it was plaintext.

Each message's `tags` and `unread` are overwritten on read with the thread's current labels and unread flag, so they describe the thread and not that one message.

- Scopes: `threads:read`.
- Needs a sign-in.
- Aliases: `show`, `view`.

**Arguments**

- `<id>` (required): Thread id, as returned by `list` or carried on a message.

**Examples**

```bash
openemail threads get CAHk7pQ2x9LmZ4-mail.example.com
```

Print the raw JSON

```bash
openemail threads get CAHk7pQ2x9LmZ4-mail.example.com --json
```

Also available in: API [`GET /threads/{id}`](https://openemail.uk/docs/api/reference/threads#get-threads-id); SDK [`threads.get()`](https://openemail.uk/docs/sdk/reference/threads#get).

### `openemail threads update`

Mark a thread read or unread and change its labels

```bash
openemail threads update <id> [flags]
```

Adds and removes labels on a thread in one call. `read` is shorthand for the `UNREAD` label: `true` removes it and `false` adds it. At least one of `read`, a non empty `--add-label-ids` or a non empty `--remove-label-ids` is required, each list takes at most 50 ids, and any other key is a 422 because the body is strict.

Folders are labels too, so archiving is `addLabelIds: ['ARCHIVE']` with `removeLabelIds: ['INBOX']`, the same pair the app uses. `TRASH`, `SNOOZED` and `DRAFT` are refused in either list with 422 `label_not_directly_settable`, because each needs a step this route cannot take. Use `trash` and `snooze` for those.

User label ids come from `labels.list`, and the system ids such as `ARCHIVE`, `STARRED` and `UNREAD` are taken in any case. An id in `--add-label-ids` that names no label is refused with 422 `label_not_found` and nothing on the thread changes, so create the label with `labels.create` first. An unknown id in `--remove-label-ids` is not an error, since the thread cannot carry it. Removals are applied before additions, so an id in both lists ends up on the thread.

- Scopes: `threads:write`.
- Needs a sign-in.
- Aliases: `edit`.

**Arguments**

- `<id>` (required): Thread id.

**Flags**

- `--read`: `true` removes `UNREAD`, `false` adds it.
- `--add-label-ids <a,b>` (repeatable): Label ids to put on the thread, at most 50, each naming a label, never `TRASH`, `SNOOZED` or `DRAFT`.
- `--remove-label-ids <a,b>` (repeatable): Label ids to take off the thread, at most 50, never `TRASH`, `SNOOZED` or `DRAFT`.
- `--data <json|@file|->`: The whole `patch` as JSON, inline, from a file with @path, or - for standard input. Flags override its keys.

**Examples**

With optional flags

```bash
openemail threads update CAHk7pQ2x9LmZ4-mail.example.com --read --add-label-ids ARCHIVE,USER_RECEIPTS --remove-label-ids INBOX
```

Print the raw JSON

```bash
openemail threads update CAHk7pQ2x9LmZ4-mail.example.com --read --add-label-ids ARCHIVE,USER_RECEIPTS --remove-label-ids INBOX --json
```

Also available in: API [`PATCH /threads/{id}`](https://openemail.uk/docs/api/reference/threads#patch-threads-id); SDK [`threads.update()`](https://openemail.uk/docs/sdk/reference/threads#update).

### `openemail threads trash`

Move a thread to the Bin

```bash
openemail threads trash <id> [flags]
```

Adds `TRASH` and removes `INBOX`, `SPAM`, `SNOOZED` and `ARCHIVE` in one step, which is what the app's delete does. Doing half of that through `update` would leave the thread listed in both the Bin and its old folder, which is why `update` refuses `TRASH`.

Nothing is deleted. The thread stays readable with `get` and lists under `folder: 'trash'`. Calling this on a thread that is already in the Bin changes nothing and returns the same body, which is why the SDK retries it.

- Scopes: `threads:write`.
- Needs a sign-in.
- Asks you to confirm.

**Arguments**

- `<id>` (required): Thread id.

**Examples**

```bash
openemail threads trash CAHk7pQ2x9LmZ4-mail.example.com
```

Skip the confirmation, for scripts

```bash
openemail threads trash CAHk7pQ2x9LmZ4-mail.example.com --yes
```

Also available in: API [`POST /threads/{id}/trash`](https://openemail.uk/docs/api/reference/threads#post-threads-id-trash); SDK [`threads.trash()`](https://openemail.uk/docs/sdk/reference/threads#trash).

### `openemail threads snooze`

Hide a thread until a set time

```bash
openemail threads snooze <id> <wake-at> [flags]
```

Adds `SNOOZED`, removes `INBOX` and stores a wake time, all in one call. Both halves matter: the label hides the thread and the stored wake time is what brings it back. A thread labelled `SNOOZED` any other way would never return, which is why `update` refuses that label.

`wakeAt` takes a `Date` or an ISO 8601 string. The SDK converts a `Date` with `toISOString()`, and the server answers 422 `invalid_parameter` on `wakeAt` when the value does not parse or is not in the future. Snoozing a thread that is already snoozed replaces its wake time.

Threads are woken by an hourly sweep, so one comes back at the first sweep after `wakeAt`, up to about an hour late. Opening the Snoozed folder in the app wakes overdue threads straight away. A thread always wakes into the inbox.

- Scopes: `threads:write`.
- Needs a sign-in.

**Arguments**

- `<id>` (required): Thread id.
- `<wake-at>` (required): When the thread should return, a future instant.

**Examples**

```bash
openemail threads snooze CAHk7pQ2x9LmZ4-mail.example.com 2026-10-01T00:00:00Z
```

Print the raw JSON

```bash
openemail threads snooze CAHk7pQ2x9LmZ4-mail.example.com 2026-10-01T00:00:00Z --json
```

Also available in: API [`POST /threads/{id}/snooze`](https://openemail.uk/docs/api/reference/threads#post-threads-id-snooze); SDK [`threads.snooze()`](https://openemail.uk/docs/sdk/reference/threads#snooze).

### `openemail threads unsnooze`

Bring a snoozed thread back now

```bash
openemail threads unsnooze <id> [flags]
```

Adds `INBOX`, removes `SNOOZED` and deletes the stored wake time, so the thread returns immediately and the hourly sweep leaves it alone afterwards.

A thread that is not snoozed is left where it is, so an archived thread stays archived, and the response still reports `snoozedUntil: null`.

- Scopes: `threads:write`.
- Needs a sign-in.

**Arguments**

- `<id>` (required): Thread id.

**Examples**

```bash
openemail threads unsnooze CAHk7pQ2x9LmZ4-mail.example.com
```

Print the raw JSON

```bash
openemail threads unsnooze CAHk7pQ2x9LmZ4-mail.example.com --json
```

Also available in: API [`POST /threads/{id}/unsnooze`](https://openemail.uk/docs/api/reference/threads#post-threads-id-unsnooze); SDK [`threads.unsnooze()`](https://openemail.uk/docs/sdk/reference/threads#unsnooze).

### `openemail threads list-attachments`

List a message's attachments with their content

```bash
openemail threads list-attachments <id> <message-id> [flags]
```

Returns the attachments of one message with each file's bytes inlined as base64 in `content`. The thread is checked first and then the message, so a `messageId` that is not on that thread is a 404 even when it exists elsewhere in the mailbox. Take message ids from the `messages` of `threads.get`.

This is the display list. The ciphertext of an encrypted envelope is in it and downloads like any other file, named `encrypted-message.asc` when it arrived without a name. The PGP/MIME version part and any detached signature are held out on purpose. Every part keeps its id in the message's `encryption.parts`, and for those two the id is a correlation key only: no route returns their bytes.

Every file comes back whole in a single response, with no size cap and no range reads, so a message carrying large files makes a large response.

- Scopes: `threads:read`.
- Needs a sign-in.

**Arguments**

- `<id>` (required): Thread id the message belongs to.
- `<message-id>` (required): Message id from that thread's `messages`.

**Examples**

```bash
openemail threads list-attachments CAHk7pQ2x9LmZ4-mail.example.com message_4c1b257a
```

Print the raw JSON

```bash
openemail threads list-attachments CAHk7pQ2x9LmZ4-mail.example.com message_4c1b257a --json
```

Also available in: API [`GET /threads/{id}/messages/{messageId}/attachments`](https://openemail.uk/docs/api/reference/threads#get-threads-id-messages-messageid-attachments); SDK [`threads.listAttachments()`](https://openemail.uk/docs/sdk/reference/threads#listAttachments).

### `openemail threads list-notes`

List the notes on a thread

```bash
openemail threads list-notes <id> [flags]
```

Resolves every note on one thread, the Notes panel of the reading pane: pinned notes first, then the rest in the order they were arranged.

Notes are private to a person. A key reads and writes the notes of the workspace owner, and an app those of the person who connected it. A key limited to particular addresses reaches only the notes on threads that arrived at them.

- Scopes: `threads:read`.
- Needs a sign-in.

**Arguments**

- `<id>` (required): Thread id.

**Examples**

```bash
openemail threads list-notes CAHk7pQ2x9LmZ4-mail.example.com
```

Print the raw JSON

```bash
openemail threads list-notes CAHk7pQ2x9LmZ4-mail.example.com --json
```

Also available in: API [`GET /threads/{id}/notes`](https://openemail.uk/docs/api/reference/notes#get-threads-id-notes); SDK [`threads.listNotes()`](https://openemail.uk/docs/sdk/reference/threads#listNotes).

### `openemail threads create-note`

Add a note to a thread

```bash
openemail threads create-note <id> --content <value> [flags]
openemail threads create-note <id> --data <json|@file|-> [flags]
```

Pins a private note to a thread, as the Notes panel does. A new note goes after the others, and `pinned` keeps it at the top.

Notes are private to a person. A key reads and writes the notes of the workspace owner, and an app those of the person who connected it. A key limited to particular addresses reaches only the notes on threads that arrived at them.

- Scopes: `threads:write`.
- Needs a sign-in.

**Arguments**

- `<id>` (required): Thread id.

**Flags**

- `--content <value>`: The text of the note, up to 20,000 characters. Leading and trailing spaces are trimmed. Required, here or in `--data`.
- `--body-color <value>`: One of the eight the app offers: `default`, `red`, `orange`, `yellow`, `green`, `blue`, `purple` or `pink`. Defaults to `default`.
- `--pinned`: Keeps the note above the others. Defaults to false.
- `--data <json|@file|->`: The whole `body` as JSON, inline, from a file with @path, or - for standard input. Flags override its keys.

**Examples**

The required values only

```bash
openemail threads create-note CAHk7pQ2x9LmZ4-mail.example.com --content 'Waiting on the signed contract before replying.'
```

With optional flags

```bash
openemail threads create-note CAHk7pQ2x9LmZ4-mail.example.com --content 'Waiting on the signed contract before replying.' --body-color yellow --pinned
```

Read the whole body from a JSON file

```bash
openemail threads create-note CAHk7pQ2x9LmZ4-mail.example.com --data @thread.json
```

Also available in: API [`POST /threads/{id}/notes`](https://openemail.uk/docs/api/reference/notes#post-threads-id-notes); SDK [`threads.createNote()`](https://openemail.uk/docs/sdk/reference/threads#createNote).

### `openemail threads update-note`

Change a note

```bash
openemail threads update-note <id> <note-id> [flags]
```

Changes the text of a note, its colour or whether it is pinned. Give at least one of the three. A note id that is not on this thread is a 404, even when the note exists on another thread.

- Scopes: `threads:write`.
- Needs a sign-in.

**Arguments**

- `<id>` (required): Thread id.
- `<note-id>` (required): The note's id, from `listNotes`.

**Flags**

- `--content <value>`: The new text, up to 20,000 characters.
- `--patch-color <value>`: The new colour.
- `--pinned`: Pins or unpins it.
- `--data <json|@file|->`: The whole `patch` as JSON, inline, from a file with @path, or - for standard input. Flags override its keys.

**Examples**

With optional flags

```bash
openemail threads update-note CAHk7pQ2x9LmZ4-mail.example.com b3d1f0c2-7a4e-4f7b-9c1d-2e8f6a5b4c3d --no-pinned
```

Print the raw JSON

```bash
openemail threads update-note CAHk7pQ2x9LmZ4-mail.example.com b3d1f0c2-7a4e-4f7b-9c1d-2e8f6a5b4c3d --no-pinned --json
```

Also available in: API [`PATCH /threads/{id}/notes/{noteId}`](https://openemail.uk/docs/api/reference/notes#patch-threads-id-notes-noteid); SDK [`threads.updateNote()`](https://openemail.uk/docs/sdk/reference/threads#updateNote).

### `openemail threads delete-note`

Delete a note

```bash
openemail threads delete-note <id> <note-id> [flags]
```

Deletes a note for good. There is no bin for notes.

- Scopes: `threads:write`.
- Needs a sign-in.
- Asks you to confirm.

**Arguments**

- `<id>` (required): Thread id.
- `<note-id>` (required): The note's id, from `listNotes`.

**Examples**

```bash
openemail threads delete-note CAHk7pQ2x9LmZ4-mail.example.com b3d1f0c2-7a4e-4f7b-9c1d-2e8f6a5b4c3d
```

Skip the confirmation, for scripts

```bash
openemail threads delete-note CAHk7pQ2x9LmZ4-mail.example.com b3d1f0c2-7a4e-4f7b-9c1d-2e8f6a5b4c3d --yes
```

Also available in: API [`DELETE /threads/{id}/notes/{noteId}`](https://openemail.uk/docs/api/reference/notes#delete-threads-id-notes-noteid); SDK [`threads.deleteNote()`](https://openemail.uk/docs/sdk/reference/threads#deleteNote).

### `openemail threads reorder-notes`

Arrange the notes on a thread

```bash
openemail threads reorder-notes <id> <ids...> [flags]
```

Sets the order of every note on a thread at once, first to last, as dragging them in the Notes panel does. Pinned notes still come first.

`ids` has to name every note on the thread exactly once. Anything else is a 422 `invalid_parameter` on `ids`, and nothing moves.

- Scopes: `threads:write`.
- Needs a sign-in.

**Arguments**

- `<id>` (required): Thread id.
- `<ids...>` (required): Every note id on the thread, in the order you want them.

**Examples**

```bash
openemail threads reorder-notes CAHk7pQ2x9LmZ4-mail.example.com CAHk7pQ2x9LmZ4-mail.example.com
```

Print the raw JSON

```bash
openemail threads reorder-notes CAHk7pQ2x9LmZ4-mail.example.com CAHk7pQ2x9LmZ4-mail.example.com --json
```

Also available in: API [`POST /threads/{id}/notes/reorder`](https://openemail.uk/docs/api/reference/notes#post-threads-id-notes-reorder); SDK [`threads.reorderNotes()`](https://openemail.uk/docs/sdk/reference/threads#reorderNotes).

### `openemail threads counts`

Count the mail in each folder

```bash
openemail threads counts [flags]
```

Resolves what the sidebar of the app shows: how many conversations each folder holds and how many of them are unread, and how many inbox conversations arrived at each address of the workspace.

`folders` has one row per folder, named by its label id in lower case: `inbox`, `sent`, `spam`, `archive`, `trash` and `snoozed`, then `unread`, whose `count` is the unread conversations in the inbox. `addresses` counts the inbox per address the mail was delivered to, with `null` for mail that recorded none.

A key limited to particular addresses counts only the mail that arrived at them. `address` narrows every count to one address, and one the key does not reach counts nothing rather than failing.

- Scopes: `threads:read`.
- Needs a sign-in.

**Flags**

- `--address <value>`: Count only the mail delivered to this address.

**Examples**

```bash
openemail threads counts
```

Print the raw JSON

```bash
openemail threads counts --json
```

Also available in: API [`GET /threads/counts`](https://openemail.uk/docs/api/reference/threads#get-threads-counts); SDK [`threads.counts()`](https://openemail.uk/docs/sdk/reference/threads#counts).

### `openemail threads summary`

Read the summary of a thread

```bash
openemail threads summary <id> [flags]
```

Resolves the short AI summary the reading pane shows above a thread. A summary is written once and kept, and written again when a new message arrives, so reading one is cheap.

`state` is `ready` with the text in `summary`, `pending` while one is being written, or `none` when there is nothing to summarise, such as a thread holding a message that arrived encrypted, whose body OpenEmail never reads. A `pending` answer starts the writing, so ask again a few seconds later.

- Scopes: `threads:read`.
- Needs a sign-in.

**Arguments**

- `<id>` (required): Thread id.

**Examples**

```bash
openemail threads summary CAHk7pQ2x9LmZ4-mail.example.com
```

Print the raw JSON

```bash
openemail threads summary CAHk7pQ2x9LmZ4-mail.example.com --json
```

Also available in: API [`GET /threads/{id}/summary`](https://openemail.uk/docs/api/reference/threads#get-threads-id-summary); SDK [`threads.summary()`](https://openemail.uk/docs/sdk/reference/threads#summary).

### `openemail threads restore`

Take a thread out of the Bin

```bash
openemail threads restore <id> [flags]
```

Puts a thread back in the inbox, out of the Bin and out of Spam, which is what Restore from Bin and Move to inbox do in the app. It is the undo of `trash`.

Calling it on a thread that is already in the inbox changes nothing and returns the same body, which is why the SDK retries it.

- Scopes: `threads:write`.
- Needs a sign-in.

**Arguments**

- `<id>` (required): Thread id.

**Examples**

```bash
openemail threads restore CAHk7pQ2x9LmZ4-mail.example.com
```

Print the raw JSON

```bash
openemail threads restore CAHk7pQ2x9LmZ4-mail.example.com --json
```

Also available in: API [`POST /threads/{id}/restore`](https://openemail.uk/docs/api/reference/threads#post-threads-id-restore); SDK [`threads.restore()`](https://openemail.uk/docs/sdk/reference/threads#restore).

### `openemail threads delete`

Delete a thread for good

```bash
openemail threads delete <id> [flags]
```

Deletes every message in a thread, with its attachments, which is what Delete from Bin does in the app. It cannot be undone.

It works on a thread in any folder, so call `trash` instead when you only mean to throw the thread away: a trashed thread stays readable and `restore` brings it back.

- Scopes: `threads:write`.
- Needs a sign-in.
- Asks you to confirm.
- Aliases: `rm`, `del`, `remove`.

**Arguments**

- `<id>` (required): Thread id.

**Examples**

```bash
openemail threads delete CAHk7pQ2x9LmZ4-mail.example.com
```

Skip the confirmation, for scripts

```bash
openemail threads delete CAHk7pQ2x9LmZ4-mail.example.com --yes
```

Also available in: API [`DELETE /threads/{id}`](https://openemail.uk/docs/api/reference/threads#delete-threads-id); SDK [`threads.delete()`](https://openemail.uk/docs/sdk/reference/threads#delete).

### `openemail threads unsubscribe`

Unsubscribe from the sender of a thread

```bash
openemail threads unsubscribe <id> [flags]
```

Does what the Unsubscribe button of the reading pane does: finds the subscription behind the newest message of the thread that carries a `List-Unsubscribe` header and unsubscribes from it the way the sender asks for, with a one-click request or an unsubscribe email. A sender that only offers a page cannot be unsubscribed by a program, so `method` is `link` and `url` is the page a person has to open.

A thread with no unsubscribe header is a 422 `unsubscribe_unsupported`, and a thread delivered to no address the key covers is a 404.

- Scopes: `threads:write`.
- Needs a sign-in.
- Asks you to confirm.

**Arguments**

- `<id>` (required): Thread id.

**Examples**

```bash
openemail threads unsubscribe CAHk7pQ2x9LmZ4-mail.example.com
```

Skip the confirmation, for scripts

```bash
openemail threads unsubscribe CAHk7pQ2x9LmZ4-mail.example.com --yes
```

Also available in: API [`POST /threads/{id}/unsubscribe`](https://openemail.uk/docs/api/reference/subscriptions#post-threads-id-unsubscribe); SDK [`threads.unsubscribe()`](https://openemail.uk/docs/sdk/reference/threads#unsubscribe).

### `openemail threads get-event`

Read the event a thread carries

```bash
openemail threads get-event <id> [flags]
```

Returns the calendar event that came with an invitation in the thread, as the invitation card of the reading pane shows it. Answer it with `calendar.respondToEvent`.

- Scopes: `calendar:read`.
- Needs a sign-in.

**Arguments**

- `<id>` (required): Thread id, as `threads.list` returns it.

**Examples**

```bash
openemail threads get-event thr_6d1a9c4e2b7f30d85e1c4a92
```

Print the raw JSON

```bash
openemail threads get-event thr_6d1a9c4e2b7f30d85e1c4a92 --json
```

Also available in: API [`GET /threads/{id}/event`](https://openemail.uk/docs/api/reference/calendar#get-threads-id-event); SDK [`threads.getEvent()`](https://openemail.uk/docs/sdk/reference/threads#getEvent).
