Skip to the documentation
CLI

nextmail subscriptions

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

Commands

The newsletters and mailing lists the mailbox receives: list them by sender or by domain, unsubscribe, and move what they send.

Every command here also takes the global flags, such as --json, --profile and --dry-run. See the global flags

nextmail subscriptions list

List subscriptions

Scopesthreads:readNeeds a sign-inAliasesls

Usage

nextmail subscriptions list [flags]

Resolves the newsletters and mailing lists the mailbox receives, as the Subscriptions page of the app shows them: one row per sender and the address it writes to, found from the List-Unsubscribe header of the mail it sends. Each row says how much mail the sender sent, how much of it is unread, readPercent (the share of it you read, 0 to 100) and how much arrived in the last 30 days, how it lets you unsubscribe, and the rule that keeps moving its new mail when there is one.

suggested marks an active sender worth leaving: it can be unsubscribed, sent at least 5 emails, wrote in the last 30 days and has 10% or less of its mail read. suggested: true lists only those.

status is active, the default, kept for the ones you chose to keep with keep, or unsubscribed. q searches the sender, and sort is recent, most, emails (most mail overall), read (least read first), unread or name. Paging is by offset: total counts every match and hasMore says whether another page follows.

A key limited to particular addresses lists only the subscriptions delivered to them, and address narrows the list to one address.

Flags

--status <value>

active, kept or unsubscribed. Defaults to active.

Default"active"
--q <value>

Searches the sender name and address.

--sort <value>

recent, most, emails, read, unread or name. Defaults to recent.

Default"recent"
--suggested

Only the senders worth unsubscribing from, the rows whose suggested is true.

--limit <n>

Rows per page, 1 to 200, defaulting to 50.

Default50
--offset <n>

How many rows to skip.

Default0
--address <value>

Only the subscriptions delivered to this address.

Examples

nextmail subscriptions list
With optional flags
nextmail subscriptions list --sort emails --limit 20
Print the raw JSON
nextmail subscriptions list --json

Also available in

API
GET /subscriptions
TypeScript
nextmail.subscriptions.list()
Python
subscriptions.list()
Ruby
subscriptions.list
PHP
subscriptions->list
Go
Subscriptions.List
Java
subscriptions().list
C#
Subscriptions.ListAsync

nextmail subscriptions list-domains

List subscriptions by domain

Scopesthreads:readNeeds a sign-in

Usage

nextmail subscriptions list-domains [flags]

Resolves the same subscriptions as list, one row per sender domain with the counts of its senders added up, so a company that writes from several addresses is one row. unsubscribable counts the senders on the domain that can be unsubscribed without a person opening a page, which is what unsubscribeDomain acts on, and readPercent is the share of the domain's mail you read.

It takes the same filters as list, and suggested: true lists the domains of the suggested senders.

Flags

--status <value>

active, kept or unsubscribed. Defaults to active.

Default"active"
--q <value>

Searches the sender name and address.

--sort <value>

recent, most, emails, read, unread or name. Defaults to recent.

Default"recent"
--suggested

Only the senders worth unsubscribing from, the rows whose suggested is true.

--limit <n>

Rows per page, 1 to 200, defaulting to 50.

Default50
--offset <n>

How many rows to skip.

Default0
--address <value>

Only the subscriptions delivered to this address.

Examples

nextmail subscriptions list-domains
With optional flags
nextmail subscriptions list-domains --sort most
Print the raw JSON
nextmail subscriptions list-domains --json

Also available in

API
GET /subscriptions/domains
TypeScript
nextmail.subscriptions.listDomains()
Python
subscriptions.list_domains()
Ruby
subscriptions.list_domains
PHP
subscriptions->listDomains
Go
Subscriptions.ListDomains
Java
subscriptions().listDomains
C#
Subscriptions.ListDomainsAsync

nextmail subscriptions keep

Keep subscriptions you want

Scopesthreads:writeNeeds a sign-in

Usage

nextmail subscriptions keep <ids...> [flags]

Marks active subscriptions as ones you want, as Keep on the Subscriptions page does: they move from active to kept, are never suggested again and are left alone by unsubscribeDomain. kept: false puts kept subscriptions back to active.

updated holds the subscriptions that changed. A subscription already in that state, or one you unsubscribed from, comes back in skipped, and an id that is unknown or delivered to an address the key does not reach in missing.

Arguments

<ids...>RequiredOne or more

1 to 100 subscription ids from list. A repeated id counts once.

Flags

--kept

true keeps them, false puts them back to active. Defaults to true.

Defaulttrue
--data <json|@file|->

The whole body as JSON, inline, from a file with @path, or - for standard input. Flags override its keys.

Examples

nextmail subscriptions keep sub_7d2c1f0a9b3e4c5d6e7f8a9b
Print the raw JSON
nextmail subscriptions keep sub_7d2c1f0a9b3e4c5d6e7f8a9b --json

Also available in

API
POST /subscriptions/batch-keep
TypeScript
nextmail.subscriptions.keep()
Python
subscriptions.keep()
Ruby
subscriptions.keep
PHP
subscriptions->keep
Go
Subscriptions.Keep
Java
subscriptions().keep
C#
Subscriptions.KeepAsync

nextmail subscriptions unsubscribe

Unsubscribe from a sender

Scopesthreads:writeNeeds a sign-in
Asks you to confirm

Usage

nextmail subscriptions unsubscribe <id> [flags]

Unsubscribes the way the sender asks for it: a one-click request to its unsubscribe address when it offers one, otherwise an unsubscribe email sent from the address the mail arrived at. 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. bin also moves every conversation from the sender to the Bin, and archive archives them instead. bin wins when both are true.

A sender that gives no way to unsubscribe is a 422 unsubscribe_unsupported, and one whose one-click request failed with no address to write to is a 502 unsubscribe_refused. A subscription delivered to an address the key does not reach is a 404.

Arguments

<id>Required

The subscription, from list.

Flags

--bin

Also move every conversation from the sender to the Bin. Defaults to false.

Defaultfalse
--archive

Also archive every conversation from the sender. Defaults to false.

Defaultfalse
--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
nextmail subscriptions unsubscribe sub_7d2c1f0a9b3e4c5d6e7f8a9b
With optional flags
nextmail subscriptions unsubscribe sub_7d2c1f0a9b3e4c5d6e7f8a9b --bin
Skip the confirmation, for scripts
nextmail subscriptions unsubscribe sub_7d2c1f0a9b3e4c5d6e7f8a9b --yes

Also available in

API
POST /subscriptions/{id}/unsubscribe
TypeScript
nextmail.subscriptions.unsubscribe()
Python
subscriptions.unsubscribe()
Ruby
subscriptions.unsubscribe
PHP
subscriptions->unsubscribe
Go
Subscriptions.Unsubscribe
Java
subscriptions().unsubscribe
C#
Subscriptions.UnsubscribeAsync

nextmail subscriptions unsubscribe-many

Unsubscribe from up to 100 senders in one call

Scopesthreads:writeNeeds a sign-in
Asks you to confirm

Usage

nextmail subscriptions unsubscribe-many <ids...> [flags]

Unsubscribes from each subscription in ids the way unsubscribe does for one, as Unsubscribe on a selection of the Subscriptions page does, and reports the rest instead of failing. unsubscribed holds the ones done with a one-click request or an unsubscribe email.

A sender that only unsubscribes on its own page comes back in links with the url a person has to open, and stays active until somebody does. skipped holds the ones already unsubscribed (already_unsubscribed) or that give no way to unsubscribe (no_method), failed the ones whose sender did not accept it, and missing the ids that are unknown or delivered to an address the key does not reach.

archive also archives every conversation from the senders that were unsubscribed, and bin moves them to the Bin instead.

Arguments

<ids...>RequiredOne or more

1 to 100 subscription ids from list, for example the rows whose suggested is true. A repeated id counts once.

Flags

--archive

Also archive every conversation from the senders. Defaults to false.

Defaultfalse
--bin

Also move every conversation from the senders to the Bin. Defaults to false.

Defaultfalse
--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
nextmail subscriptions unsubscribe-many sub_7d2c1f0a9b3e4c5d6e7f8a9b
With optional flags
nextmail subscriptions unsubscribe-many sub_7d2c1f0a9b3e4c5d6e7f8a9b --archive
Skip the confirmation, for scripts
nextmail subscriptions unsubscribe-many sub_7d2c1f0a9b3e4c5d6e7f8a9b --yes

Also available in

API
POST /subscriptions/batch-unsubscribe
TypeScript
nextmail.subscriptions.unsubscribeMany()
Python
subscriptions.unsubscribe_many()
Ruby
subscriptions.unsubscribe_many
PHP
subscriptions->unsubscribeMany
Go
Subscriptions.UnsubscribeMany
Java
subscriptions().unsubscribeMany
C#
Subscriptions.UnsubscribeManyAsync

nextmail subscriptions unsubscribe-domain

Unsubscribe from a whole domain

Scopesthreads:writeNeeds a sign-in
Asks you to confirm

Usage

nextmail subscriptions unsubscribe-domain <domain> [flags]

Unsubscribes from every sender on a domain that can be unsubscribed without a person opening a page, with a one-click request or an unsubscribe email, as the domain view of the Subscriptions page does. unsubscribed counts the senders it worked for, skipped the senders that only offer a page and failed the ones that did not accept it.

Senders you kept with keep are left alone. bin also moves their conversations to the Bin, archive archives them instead, and address keeps it to the subscriptions delivered to one address. A key limited to particular addresses acts only on the subscriptions delivered to them.

Arguments

<domain>Required

The sender domain, from listDomains.

Flags

--bin

Also move the conversations to the Bin. Defaults to false.

Defaultfalse
--archive

Also archive the conversations. Defaults to false.

Defaultfalse
--address <value>

Only the subscriptions delivered to this address.

--data <json|@file|->

The whole body as JSON, inline, from a file with @path, or - for standard input. Flags override its keys.

Examples

nextmail subscriptions unsubscribe-domain news.acme.com
Skip the confirmation, for scripts
nextmail subscriptions unsubscribe-domain news.acme.com --yes

Also available in

API
POST /subscriptions/domains/{domain}/unsubscribe
TypeScript
nextmail.subscriptions.unsubscribeDomain()
Python
subscriptions.unsubscribe_domain()
Ruby
subscriptions.unsubscribe_domain
PHP
subscriptions->unsubscribeDomain
Go
Subscriptions.UnsubscribeDomain
Java
subscriptions().unsubscribeDomain
C#
Subscriptions.UnsubscribeDomainAsync

nextmail subscriptions move

Move what a sender sent

Scopesthreads:writeNeeds a sign-in

Usage

nextmail subscriptions move <id> --destination <value> [flags]
nextmail subscriptions move <id> --data <json|@file|-> [flags]

Moves every conversation from the sender to the archive, the Bin or a label, as the Subscriptions page does. destination is archive, bin or label, and label needs --label-id, or the call is a 422 label_not_found.

With future, the default, a rule keeps doing it to new mail from the sender to that address, which also needs rules:write. --rule-name names that rule. future: false drops a rule made that way before, when the key holds rules:write.

Arguments

<id>Required

The subscription, from list.

Flags

--destination <value>

archive, bin or label. Required, here or in --data.

--label-id <value>

The label to file under, for label.

--future

Keep doing it to new mail with a rule. Defaults to true.

Defaulttrue
--rule-name <value>

A name for that rule.

--data <json|@file|->

The whole body as JSON, inline, from a file with @path, or - for standard input. Flags override its keys.

Examples

nextmail subscriptions move sub_7d2c1f0a9b3e4c5d6e7f8a9b --destination archive
Read the whole body from a JSON file
nextmail subscriptions move sub_7d2c1f0a9b3e4c5d6e7f8a9b --data @subscriptions.json

Also available in

API
POST /subscriptions/{id}/move
TypeScript
nextmail.subscriptions.move()
Python
subscriptions.move()
Ruby
subscriptions.move
PHP
subscriptions->move
Go
Subscriptions.Move
Java
subscriptions().move
C#
Subscriptions.MoveAsync

nextmail subscriptions move-many

Move what up to 100 senders sent

Scopesthreads:writeNeeds a sign-in

Usage

nextmail subscriptions move-many <ids...> --destination <value> [flags]
nextmail subscriptions move-many <ids...> --data <json|@file|-> [flags]

Moves every conversation from each subscription in ids to the archive, the Bin or a label, the way move does for one, as Archive on a selection of the Subscriptions page does. destination is archive, bin or label, and label needs --label-id, or the call is a 422 label_not_found.

With future, the default, a rule per sender keeps doing it to new mail, which also needs rules:write. moved counts the conversations moved across every sender, updated holds the subscriptions whose mail moved, failed the ones that could not be moved and missing the ids that are unknown or delivered to an address the key does not reach.

Arguments

<ids...>RequiredOne or more

1 to 100 subscription ids from list. A repeated id counts once.

Flags

--destination <value>

archive, bin or label. Required, here or in --data.

--label-id <value>

The label to file under, for label.

--future

Keep doing it to new mail with a rule per sender. Defaults to true.

Defaulttrue
--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
nextmail subscriptions move-many sub_7d2c1f0a9b3e4c5d6e7f8a9b --destination archive
With optional flags
nextmail subscriptions move-many sub_7d2c1f0a9b3e4c5d6e7f8a9b --destination archive --no-future
Read the whole body from a JSON file
nextmail subscriptions move-many sub_7d2c1f0a9b3e4c5d6e7f8a9b --data @subscriptions.json

Also available in

API
POST /subscriptions/batch-move
TypeScript
nextmail.subscriptions.moveMany()
Python
subscriptions.move_many()
Ruby
subscriptions.move_many
PHP
subscriptions->moveMany
Go
Subscriptions.MoveMany
Java
subscriptions().moveMany
C#
Subscriptions.MoveManyAsync