openemail threads
Every command in this namespace, with its arguments, flags and examples.
Commands
Read, search, label, trash, snooze and mute conversations in the mailbox, read the inbox one tab at a time, and choose the tab the mail of a sender always goes to.
Every command here also takes the global flags, such as --json, --profile and --dry-run. See the global flags
threads listthreads getthreads updatethreads trashthreads snoozethreads unsnoozethreads mutethreads unmutethreads list-messagesthreads get-messagethreads list-attachmentsthreads list-notesthreads create-notethreads update-notethreads delete-notethreads reorder-notesthreads countsthreads summarythreads reply-suggestionsthreads restorethreads deletethreads unsubscribethreads get-eventthreads list-sender-categoriesthreads set-sender-categorythreads clear-sender-categorythreads get-teamthreads assignthreads unassignthreads mark-donethreads reopenthreads list-commentsthreads create-commentthreads update-commentthreads delete-comment
openemail threads list
List one page of threads in a folder
lsUsage
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. category keeps one inbox tab, primary, promotions, updates, social or forums, where primary is every thread in no other tab.
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. is:muted finds muted threads, is:waiting the threads with a reminder nobody has answered yet, and category:promotions one inbox tab in any folder. 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.
With semantic: true the plain words of query match by meaning rather than spelling. Describe the mail in a few words, flight to Berlin or invoices I still owe, in any language, and the threads closest in meaning come back best match first, together with every thread the words match as text, which ranks above one that only means the same. A thread is kept only when it is clearly closer to the words than the rest of the mailbox, so a description nothing fits returns only the text matches. Operators and filters narrow it as usual, sort does not apply, and a query with no plain words is a text search whatever semantic says. Meaning is read from the whole conversation, newest messages first, so an earlier message counts too, and a workspace that turned search by meaning off in its settings gets a text search instead.
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.
Flags
--folder <value>Label the threads must carry, case insensitive. Defaults to
inbox, andbinis read astrash.Default"inbox"--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:pdfandin:anywherenarrow it.--label-ids <a,b>RepeatableLabel ids a thread must all carry on top of
folder, matched exactly. An array is sent comma separated.--sort <value>newest(the default),oldest,senderorsubject, the four orders of the thread list in the app.senderandsubjectare alphabetical, newest first within one sender or subject.Default"newest"--date-from <when>Keeps threads whose newest message arrived at or after this instant. A
Dateor 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-fromafter--date-tois a 422.--from-contactsWhen true, keeps only threads whose newest message came from a saved contact. A key limited to some addresses reads the contacts its owner saved.
--semanticWhen true, the plain words of
querymatch by meaning instead of spelling, in any language, and the closest threads come first along with every thread the words match as text. Operators and the other filters still apply andsortdoes not. Ignored when the workspace has search by meaning turned off.--category <value>Keeps only the threads sorted into this inbox tab:
primary,promotions,updates,socialorforums.primaryis every thread in no other tab. Inquery,category:promotionsfilters the same way in any folder.--address <value>Keeps only the threads delivered to this address, the address filter of the thread list. One the key does not reach returns nothing rather than failing.
--limit <n>Threads per page, a whole number from 1 to 100. Defaults to 25.
--cursor <value>The
nextCursorof the previous page, passed back unchanged.--allFetch every page and stream the items as they arrive.
--max <n>Stop after this many items. Implies
--all.--ndjsonPrint every item as one JSON object per line. Implies
--all
Examples
openemail threads listopenemail threads list --folder inbox --query 'from:ada has:pdf' --sort oldestopenemail threads list --all --max 100openemail threads list --all > threads.ndjsonAlso available in
- API
GET /threads- TypeScript
threads.list()- Python
threads.list()- Ruby
threads.list- PHP
threads->list- Go
Threads.List- Java
threads().list- C#
Threads.ListAsync
openemail threads get
Read a thread with every message on it
showviewUsage
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.
Arguments
<id>RequiredThread id, as returned by
listor carried on a message.
Examples
openemail threads get CAHk7pQ2x9LmZ4-mail.example.comopenemail threads get CAHk7pQ2x9LmZ4-mail.example.com --jsonAlso available in
- API
GET /threads/{id}- TypeScript
threads.get()- Python
threads.get()- Ruby
threads.get- PHP
threads->get- Go
Threads.Get- Java
threads().get- C#
Threads.GetAsync
openemail threads update
Mark a thread read or unread and change its labels
editUsage
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.
Arguments
<id>RequiredThread id.
Flags
--readtrueremovesUNREAD,falseadds it.--add-label-ids <a,b>RepeatableLabel ids to put on the thread, at most 50, each naming a label, never
TRASH,SNOOZEDorDRAFT.--remove-label-ids <a,b>RepeatableLabel ids to take off the thread, at most 50, never
TRASH,SNOOZEDorDRAFT.--data <json|@file|->The whole
patchas JSON, inline, from a file with @path, or - for standard input. Flags override its keys.
Examples
openemail threads update CAHk7pQ2x9LmZ4-mail.example.com --read --add-label-ids ARCHIVE,USER_RECEIPTS --remove-label-ids INBOXopenemail threads update CAHk7pQ2x9LmZ4-mail.example.com --read --add-label-ids ARCHIVE,USER_RECEIPTS --remove-label-ids INBOX --jsonAlso available in
- API
PATCH /threads/{id}- TypeScript
threads.update()- Python
threads.update()- Ruby
threads.update- PHP
threads->update- Go
Threads.Update- Java
threads().update- C#
Threads.UpdateAsync
openemail threads trash
Move a thread to the Bin
Usage
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.
Arguments
<id>RequiredThread id.
Examples
openemail threads trash CAHk7pQ2x9LmZ4-mail.example.comopenemail threads trash CAHk7pQ2x9LmZ4-mail.example.com --yesAlso available in
- API
POST /threads/{id}/trash- TypeScript
threads.trash()- Python
threads.trash()- Ruby
threads.trash- PHP
threads->trash- Go
Threads.Trash- Java
threads().trash- C#
Threads.TrashAsync
openemail threads snooze
Hide a thread until a set time
Usage
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.
Arguments
<id>RequiredThread id.
<wake-at>RequiredWhen the thread should return, a future instant.
Examples
openemail threads snooze CAHk7pQ2x9LmZ4-mail.example.com 2026-10-01T00:00:00Zopenemail threads snooze CAHk7pQ2x9LmZ4-mail.example.com 2026-10-01T00:00:00Z --jsonAlso available in
- API
POST /threads/{id}/snooze- TypeScript
threads.snooze()- Python
threads.snooze()- Ruby
threads.snooze- PHP
threads->snooze- Go
Threads.Snooze- Java
threads().snooze- C#
Threads.SnoozeAsync
openemail threads unsnooze
Bring a snoozed thread back now
Usage
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.
Arguments
<id>RequiredThread id.
Examples
openemail threads unsnooze CAHk7pQ2x9LmZ4-mail.example.comopenemail threads unsnooze CAHk7pQ2x9LmZ4-mail.example.com --jsonAlso available in
openemail threads mute
Mute a thread
Usage
openemail threads mute <id> [flags]
Mutes a conversation, as Mute does in the app. A thread in the inbox moves to the archive, and from then on new mail in it goes straight to the archive, unread, with no push, sound or desktop notice. A webhook for that mail carries muted: true.
Thread state belongs to the whole workspace, so the thread is muted for everyone on it, and mail addressed only to you does not bring it back. Calling it again changes nothing, which is why the SDK retries it. update with MUTE in addLabelIds does the same.
Arguments
<id>RequiredThread id.
Examples
openemail threads mute CAHk7pQ2x9LmZ4-mail.example.comopenemail threads mute CAHk7pQ2x9LmZ4-mail.example.com --jsonAlso available in
- API
POST /threads/{id}/mute- TypeScript
threads.mute()- Python
threads.mute()- Ruby
threads.mute- PHP
threads->mute- Go
Threads.Mute- Java
threads().mute- C#
Threads.MuteAsync
openemail threads unmute
Take the mute off a thread
Usage
openemail threads unmute <id> [flags]
Takes the mute off, so the next message in the thread arrives in the inbox and alerts people again.
The thread stays where it is. Move it back with update and INBOX in addLabelIds if you want it in the inbox now. A thread that is not muted is left as it is, which is why the SDK retries this call.
Arguments
<id>RequiredThread id.
Examples
openemail threads unmute CAHk7pQ2x9LmZ4-mail.example.comopenemail threads unmute CAHk7pQ2x9LmZ4-mail.example.com --jsonAlso available in
- API
POST /threads/{id}/unmute- TypeScript
threads.unmute()- Python
threads.unmute()- Ruby
threads.unmute- PHP
threads->unmute- Go
Threads.Unmute- Java
threads().unmute- C#
Threads.UnmuteAsync
openemail threads list-messages
List the messages of a thread in a fixed shape
Usage
openemail threads list-messages <id> [flags]
Returns every message on the thread, oldest first, as MailboxMessageResource: from, to, cc, bcc and replyTo as { name, email }, date as an ISO 8601 instant, messageId, inReplyTo and references, the body as text and html, the attachments without their bytes, the headers OpenEmail keeps and encryption. Unsent draft replies are in the list with draft: true.
These fields are a contract: they are added to, never renamed or taken away, whatever the mailbox stores underneath. threads.get still returns each message the way the mailbox stored it, so use this when your code reads messages field by field.
text is the plain text body, or the text drawn from the HTML when the message came as HTML only. html is null for a plain text message. headers holds From, To, Cc, Reply-To, Subject, Date, Message-ID, In-Reply-To, References, List-Unsubscribe and List-Unsubscribe-Post when the message had them, and nothing else, because the rest of what it arrived with is not kept.
Arguments
<id>RequiredThread id, as returned by
list.
Examples
openemail threads list-messages thr_2b8e4c1a9d7f4e3b8a6c5d0eopenemail threads list-messages thr_2b8e4c1a9d7f4e3b8a6c5d0e --jsonAlso available in
openemail threads get-message
Read one message of a thread in a fixed shape
Usage
openemail threads get-message <id> <message-id> [flags]
Returns one message as MailboxMessageResource, the shape listMessages lists. 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.
The emailId of an email.received webhook is the messageId to pass here, beside its threadId.
Arguments
<id>RequiredThread id the message belongs to.
<message-id>RequiredThe message, as
idon a messagelistMessagesreturns.
Examples
openemail threads get-message thr_2b8e4c1a9d7f4e3b8a6c5d0e msg_7c2e9a41b3d84f6e9a0c1d2eopenemail threads get-message thr_2b8e4c1a9d7f4e3b8a6c5d0e msg_7c2e9a41b3d84f6e9a0c1d2e --jsonAlso available in
openemail threads list-attachments
List a message's attachments with their content
Usage
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.
Arguments
<id>RequiredThread id the message belongs to.
<message-id>RequiredMessage id from that thread's
messages.
Examples
openemail threads list-attachments CAHk7pQ2x9LmZ4-mail.example.com msg_7c2e9a41b3d84f6e9a0c1d2eopenemail threads list-attachments CAHk7pQ2x9LmZ4-mail.example.com msg_7c2e9a41b3d84f6e9a0c1d2e --jsonAlso available in
openemail threads list-notes
List the notes on a thread
Usage
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.
Arguments
<id>RequiredThread id.
Examples
openemail threads list-notes CAHk7pQ2x9LmZ4-mail.example.comopenemail threads list-notes CAHk7pQ2x9LmZ4-mail.example.com --jsonAlso available in
openemail threads create-note
Add a note to a thread
Usage
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.
Arguments
<id>RequiredThread 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,purpleorpink. Defaults todefault.--pinnedKeeps the note above the others. Defaults to false.
--data <json|@file|->The whole
bodyas JSON, inline, from a file with @path, or - for standard input. Flags override its keys.
Examples
openemail threads create-note CAHk7pQ2x9LmZ4-mail.example.com --content 'Waiting on the signed contract before replying.'openemail threads create-note CAHk7pQ2x9LmZ4-mail.example.com --content 'Waiting on the signed contract before replying.' --body-color yellow --pinnedopenemail threads create-note CAHk7pQ2x9LmZ4-mail.example.com --data @thread.jsonAlso available in
openemail threads update-note
Change a note
Usage
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.
Arguments
<id>RequiredThread id.
<note-id>RequiredThe note's id, from
listNotes.
Flags
--content <value>The new text, up to 20,000 characters.
--patch-color <value>The new colour.
--pinnedPins or unpins it.
--data <json|@file|->The whole
patchas JSON, inline, from a file with @path, or - for standard input. Flags override its keys.
Examples
openemail threads update-note CAHk7pQ2x9LmZ4-mail.example.com b3d1f0c2-7a4e-4f7b-9c1d-2e8f6a5b4c3d --no-pinnedopenemail threads update-note CAHk7pQ2x9LmZ4-mail.example.com b3d1f0c2-7a4e-4f7b-9c1d-2e8f6a5b4c3d --no-pinned --jsonAlso available in
openemail threads delete-note
Delete a note
Usage
openemail threads delete-note <id> <note-id> [flags]
Deletes a note for good. There is no bin for notes.
Arguments
<id>RequiredThread id.
<note-id>RequiredThe note's id, from
listNotes.
Examples
openemail threads delete-note CAHk7pQ2x9LmZ4-mail.example.com b3d1f0c2-7a4e-4f7b-9c1d-2e8f6a5b4c3dopenemail threads delete-note CAHk7pQ2x9LmZ4-mail.example.com b3d1f0c2-7a4e-4f7b-9c1d-2e8f6a5b4c3d --yesAlso available in
openemail threads reorder-notes
Arrange the notes on a thread
Usage
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.
Arguments
<id>RequiredThread id.
<ids...>RequiredOne or moreEvery note id on the thread, in the order you want them.
Examples
openemail threads reorder-notes CAHk7pQ2x9LmZ4-mail.example.com CAHk7pQ2x9LmZ4-mail.example.comopenemail threads reorder-notes CAHk7pQ2x9LmZ4-mail.example.com CAHk7pQ2x9LmZ4-mail.example.com --jsonAlso available in
openemail threads counts
Count the mail in each folder
Usage
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, how many drafts are waiting, how many conversations each of your labels has in each folder, how many inbox conversations sit in each inbox tab, 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 draft, whose count is the drafts waiting to be sent and whose unread is always 0, then unread, whose count is the unread conversations in the inbox. labels has one row for each of your labels and each folder it has conversations in, { id, folder, count, unread }, so a label with nothing in a folder has no row for it. categories has one row for each inbox tab, { category, count, unread }, counting inbox conversations only: primary, promotions, updates, social and forums, where primary is everything not sorted into another tab. unlabelled counts the inbox conversations that carry none of your labels, with count, unread and the same count for each tab under categories, which is what the inbox of the app lists unless Labelled mail is ticked in its Filters menu. addresses counts the inbox per address the mail was delivered to, with null for mail that recorded none. team counts the team views of a shared inbox for the person the key or app acts for: assigned the open conversations assigned to them, unassigned the open conversations nobody has, each with count and unread, and mentions the conversations outside Spam and the bin where a team comment mentions them, with count, unread and unseen, the conversations with a mention newer than the last time they opened its comments in the app. A conversation is open while it is in the inbox.
A key limited to particular addresses counts only the mail that arrived at them and the drafts written from them. address narrows every count to one address, and one the key does not reach counts nothing rather than failing.
Flags
--address <value>Count only the mail delivered to this address.
Examples
openemail threads countsopenemail threads counts --jsonAlso available in
- API
GET /threads/counts- TypeScript
threads.counts()- Python
threads.counts()- Ruby
threads.counts- PHP
threads->counts- Go
Threads.Counts- Java
threads().counts- C#
Threads.CountsAsync
openemail threads summary
Read the summary of a thread
Usage
openemail threads summary <id> [flags]
Resolves the short AI summary the reading pane shows above a thread. A summary is written the first time it is asked for and then kept, and the first request after a newer message arrives writes it again, so reading one is cheap.
state is ready with the text in summary, pending while the first one is being written, failed when the last try did not work, or none when there is nothing to summarise, such as a thread holding a message that arrived encrypted, whose body OpenEmail never reads. While a newer summary is being written, the one before it comes back as ready. A pending answer starts the writing, so ask again a few seconds later, and after a failed one asking again tries once more.
Arguments
<id>RequiredThread id.
Examples
openemail threads summary CAHk7pQ2x9LmZ4-mail.example.comopenemail threads summary CAHk7pQ2x9LmZ4-mail.example.com --jsonAlso available in
openemail threads reply-suggestions
Suggest replies to a thread
Usage
openemail threads reply-suggestions <id> [flags]
Resolves up to three short replies to the latest message of the thread, the ones the reading pane offers under it. Each has a label, a few words that say what it answers, and a body, the reply itself in plain text, ready to send with emails.send or to keep with drafts.create. They are written in the language of that message and the voice of the mail this workspace sends, from the conversation, what was written to this correspondent before, what is known about their organisation and, when the message asks for a time, the busy times of the calendar.
Suggestions are written once for each new message and kept, so asking again is free until another message arrives. state is ready with the suggestions, pending while they are being written, so ask again a few seconds later, or none when the message needs no reply: your own reply came last, or it is a newsletter, an automated notice, mail from a no-reply address, spam or an encrypted message. Every thread is none in a workspace that turned replySuggestions off with settings.update.
sources names the knowledge base items the suggestions drew on: the pinned notes at the levels of the receiving address and the items whose passages matched the message, each a KnowledgeSourceRef with id, title, kind, scope and url. It is empty when none were used.
Arguments
<id>RequiredThread id.
Examples
openemail threads reply-suggestions CAHk7pQ2x9LmZ4-mail.example.comopenemail threads reply-suggestions CAHk7pQ2x9LmZ4-mail.example.com --jsonAlso available in
openemail threads restore
Take a thread out of the Bin
Usage
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.
Arguments
<id>RequiredThread id.
Examples
openemail threads restore CAHk7pQ2x9LmZ4-mail.example.comopenemail threads restore CAHk7pQ2x9LmZ4-mail.example.com --jsonAlso available in
openemail threads delete
Delete a thread for good
rmdelremoveUsage
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.
Arguments
<id>RequiredThread id.
Examples
openemail threads delete CAHk7pQ2x9LmZ4-mail.example.comopenemail threads delete CAHk7pQ2x9LmZ4-mail.example.com --yesAlso available in
- API
DELETE /threads/{id}- TypeScript
threads.delete()- Python
threads.delete()- Ruby
threads.delete- PHP
threads->delete- Go
Threads.Delete- Java
threads().delete- C#
Threads.DeleteAsync
openemail threads unsubscribe
Unsubscribe from the sender of a thread
Usage
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.
Arguments
<id>RequiredThread id.
Examples
openemail threads unsubscribe CAHk7pQ2x9LmZ4-mail.example.comopenemail threads unsubscribe CAHk7pQ2x9LmZ4-mail.example.com --yesAlso available in
openemail threads get-event
Read the event a thread carries
Usage
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.
Arguments
<id>RequiredThread id, as
threads.listreturns it.
Examples
openemail threads get-event thr_6d1a9c4e2b7f30d85e1c4a92openemail threads get-event thr_6d1a9c4e2b7f30d85e1c4a92 --jsonAlso available in
openemail threads list-sender-categories
List the senders that always go to one inbox tab
Usage
openemail threads list-sender-categories [flags]
Resolves the senders whose mail always goes to one inbox tab, by address. New mail is sorted into Primary, Promotions, Updates, Social or Forums by plain rules, and a choice saved here wins over them. list takes category to read one tab.
The choices belong to the workspace and apply to every address in it. A workspace holds at most 2,000 of them, and they come back as one plain array with no paging.
Examples
openemail threads list-sender-categoriesopenemail threads list-sender-categories --jsonAlso available in
openemail threads set-sender-category
Always sort a sender into one inbox tab
Usage
openemail threads set-sender-category <email> <category> [flags]
Saves the tab for one sender and moves the inbox threads whose newest message is from them, up to the newest 1,000, into it. Mail from them is sorted there from now on, whatever the rules would say. Saving again replaces the choice.
A workspace holds at most 2,000 choices, and the call past that is a 422 sender_category_limit_reached. They apply to every address in the workspace, so a key or an app limited to particular addresses or domains can read them but not change them, and gets a 422 capability_unsupported.
Arguments
<email>RequiredThe address of the sender, compared without case.
<category>RequiredThe inbox tab their mail goes to:
primary,promotions,updates,socialorforums.
Examples
openemail threads set-sender-category [email protected] promotionsopenemail threads set-sender-category [email protected] promotions --jsonAlso available in
openemail threads clear-sender-category
Remove the tab chosen for a sender
Usage
openemail threads clear-sender-category <email> [flags]
Removes the choice, so new mail from the sender is sorted by the rules again. Threads already sorted stay where they are.
Arguments
<email>RequiredThe address of the sender, compared without case.
Examples
openemail threads clear-sender-category [email protected]openemail threads clear-sender-category [email protected] --yesAlso available in
openemail threads get-team
Read who has a thread
Usage
openemail threads get-team <id> [flags]
Resolves the thread as the team sees it: who it is assigned to, who marked it done, how many comments it has, who else is writing a reply in the app right now, and everyone who can see it.
Only people who can see a thread can be given it or mentioned on it: the workspace owner, members who reach every address, and members who hold its address or its domain. A key acts for the workspace owner.
Arguments
<id>RequiredThread id.
Examples
openemail threads get-team CAHk7pQ2x9LmZ4-mail.example.comopenemail threads get-team CAHk7pQ2x9LmZ4-mail.example.com --jsonAlso available in
openemail threads assign
Assign a thread
Usage
openemail threads assign <id> <assignee-id> [flags]
Gives the thread to one person, who is emailed unless they assigned it to themselves.
Only people who can see a thread can be given it or mentioned on it: the workspace owner, members who reach every address, and members who hold its address or its domain. A key acts for the workspace owner.
Arguments
<id>RequiredThread id.
<assignee-id>RequiredThe user id of the person to give it to, as
getTeamlists them inteam.
Examples
openemail threads assign CAHk7pQ2x9LmZ4-mail.example.com usr_2f9c1dopenemail threads assign CAHk7pQ2x9LmZ4-mail.example.com usr_2f9c1d --jsonAlso available in
- API
PUT /threads/{id}/assignee- TypeScript
threads.assign()- Python
threads.assign()- Ruby
threads.assign- PHP
threads->assign- Go
Threads.Assign- Java
threads().assign- C#
Threads.AssignAsync
openemail threads unassign
Unassign a thread
Usage
openemail threads unassign <id> [flags]
Leaves the thread with nobody.
Arguments
<id>RequiredThread id.
Examples
openemail threads unassign CAHk7pQ2x9LmZ4-mail.example.comopenemail threads unassign CAHk7pQ2x9LmZ4-mail.example.com --yesAlso available in
openemail threads mark-done
Mark a thread done
Usage
openemail threads mark-done <id> [flags]
Archives the thread for everyone and records who marked it done. A new reply brings it back to the inbox, and reopen moves it back by hand.
Arguments
<id>RequiredThread id.
Examples
openemail threads mark-done CAHk7pQ2x9LmZ4-mail.example.comopenemail threads mark-done CAHk7pQ2x9LmZ4-mail.example.com --jsonAlso available in
openemail threads reopen
Reopen a thread
Usage
openemail threads reopen <id> [flags]
Moves a done thread back to the inbox for everyone.
Arguments
<id>RequiredThread id.
Examples
openemail threads reopen CAHk7pQ2x9LmZ4-mail.example.comopenemail threads reopen CAHk7pQ2x9LmZ4-mail.example.com --jsonAlso available in
- API
POST /threads/{id}/reopen- TypeScript
threads.reopen()- Python
threads.reopen()- Ruby
threads.reopen- PHP
threads->reopen- Go
Threads.Reopen- Java
threads().reopen- C#
Threads.ReopenAsync
openemail threads list-comments
List the comments on a thread
Usage
openemail threads list-comments <id> [flags]
Resolves the team comments on one thread, oldest first. Everyone who can see the thread reads them, and the sender never does.
Arguments
<id>RequiredThread id.
Examples
openemail threads list-comments CAHk7pQ2x9LmZ4-mail.example.comopenemail threads list-comments CAHk7pQ2x9LmZ4-mail.example.com --jsonAlso available in
openemail threads create-comment
Comment on a thread
Usage
openemail threads create-comment <id> --body <value> [flags] openemail threads create-comment <id> --data <json|@file|-> [flags]
Adds a comment for the team. Everybody in mentions is emailed.
Only people who can see a thread can be given it or mentioned on it: the workspace owner, members who reach every address, and members who hold its address or its domain. A key acts for the workspace owner.
Arguments
<id>RequiredThread id.
Flags
--body <value>What the comment says, up to 10,000 characters. Leading and trailing spaces are trimmed. Required, here or in
--data.--mentions <a,b>RepeatableThe user ids of people to mention, at most 20. Each has to be able to see the thread.
Default[]--data <json|@file|->The whole
bodyas JSON, inline, from a file with @path, or - for standard input. Flags override its keys.
Examples
openemail threads create-comment CAHk7pQ2x9LmZ4-mail.example.com --body 'Can you take this one?'openemail threads create-comment CAHk7pQ2x9LmZ4-mail.example.com --body 'Can you take this one?' --mentions usr_2f9c1dopenemail threads create-comment CAHk7pQ2x9LmZ4-mail.example.com --data @thread.jsonAlso available in
openemail threads update-comment
Change a comment
Usage
openemail threads update-comment <id> <comment-id> --body <value> [flags] openemail threads update-comment <id> <comment-id> --data <json|@file|-> [flags]
Replaces the text and the mentions of a comment. Only its author can change it, and anybody newly mentioned is emailed.
Arguments
<id>RequiredThread id.
<comment-id>RequiredThe comment id, as
listCommentsreturns it.
Flags
--body <value>The new text, up to 10,000 characters. Required, here or in
--data.--mentions <a,b>RepeatableThe user ids it mentions now, at most 20. Leave it out to mention nobody.
Default[]--data <json|@file|->The whole
bodyas JSON, inline, from a file with @path, or - for standard input. Flags override its keys.
Examples
openemail threads update-comment CAHk7pQ2x9LmZ4-mail.example.com tcm_8a1f --body 'Done, sent the quote.'openemail threads update-comment CAHk7pQ2x9LmZ4-mail.example.com tcm_8a1f --data @thread.jsonAlso available in
openemail threads delete-comment
Delete a comment
Usage
openemail threads delete-comment <id> <comment-id> [flags]
Deletes a comment for good. Its author can delete it, and so can the workspace owner, which a key acts for.
Arguments
<id>RequiredThread id.
<comment-id>RequiredThe comment id, as
listCommentsreturns it.
Examples
openemail threads delete-comment CAHk7pQ2x9LmZ4-mail.example.com tcm_8a1fopenemail threads delete-comment CAHk7pQ2x9LmZ4-mail.example.com tcm_8a1f --yes