Перейти к документации
API

Подписки

Каждая операция этой группы: что она принимает, что возвращает и какими ошибками может ответить.

Операции

Newsletters and mailing lists the mailbox receives, found from the List-Unsubscribe header of the mail they send, as the Subscriptions page of the app shows them. Unsubscribe from one sender or a whole domain, or move what they sent and keep moving what they send.

GET/subscriptions

List subscriptions

Разрешенияthreads:readЧитает

One row per sender and address it writes to, with how much mail it sent, how much of it is unread and how much arrived in the last 30 days. A key or an app limited to particular addresses lists only the subscriptions delivered to them.

Requires the threads:read scope.

Параметры запроса

statusstring

active lists what still arrives, unsubscribed what you left.

Одно из"active""unsubscribed"По умолчанию"active"
qstring

Searches the sender name and address.

До 200 символов
sortstring

recent puts the newest mail first, most the senders with the most mail, unread those with the most unread, name sorts by sender.

Одно из"recent""most""unread""name"По умолчанию"recent"
limitinteger

Rows per page.

Не меньше 1Не больше 200По умолчанию50
offsetinteger

How many rows to skip, for the next page.

Не меньше 0По умолчанию0
addressstring

Only the subscriptions delivered to this address. One the key does not reach lists nothing.

От 3 до 320 символов

Возвращает

A page of subscriptions.

Ошибки

Ошибки, которые может вернуть любая операция400401403404422500Каталог ошибок

Также доступно в

SDK
subscriptions.list()
CLI
openemail subscriptions list
MCP
listSubscriptions

GET/subscriptions/domains

List subscriptions by domain

Разрешенияthreads:readЧитает

The same subscriptions, one row per sender domain with the counts of its senders added up, so a company that writes from several addresses is one row.

Requires the threads:read scope.

Параметры запроса

statusstring

active lists what still arrives, unsubscribed what you left.

Одно из"active""unsubscribed"По умолчанию"active"
qstring

Searches the sender name and address.

До 200 символов
sortstring

recent puts the newest mail first, most the senders with the most mail, unread those with the most unread, name sorts by sender.

Одно из"recent""most""unread""name"По умолчанию"recent"
limitinteger

Rows per page.

Не меньше 1Не больше 200По умолчанию50
offsetinteger

How many rows to skip, for the next page.

Не меньше 0По умолчанию0
addressstring

Only the subscriptions delivered to this address. One the key does not reach lists nothing.

От 3 до 320 символов

Возвращает

A page of sender domains.

Ошибки

Ошибки, которые может вернуть любая операция400401403404422500Каталог ошибок

Также доступно в

SDK
subscriptions.listDomains()
CLI
openemail subscriptions list-domains
MCP
listSubscriptionDomains

POST/subscriptions/domains/{domain}/unsubscribe

Unsubscribe from a whole domain

Разрешенияthreads:writeОтправляет почту

Unsubscribes from every sender on the domain that can be unsubscribed without a person opening a page, with one-click or by email. skipped counts the senders that only offer a page, and failed the ones that did not accept it. Unsubscribing works the way the sender asks for it: a one-click request to its unsubscribe address when it offers one, an unsubscribe email from the address the mail arrived at when it gives a mailto, and otherwise the sender's own unsubscribe page in url, which a person has to open. method says which.

Requires the threads:write scope.

Параметры пути

domainstringОбязательно

The sender domain, as GET /subscriptions/domains returns it.

Тело запроса

binboolean

Also move every conversation from the senders to the Bin.

По умолчаниюfalse
addressstring

Only the subscriptions delivered to this address.

От 3 до 320 символов

Возвращает

What happened to each sender, counted.

Ошибки

Ошибки, которые может вернуть любая операция400401403404422500Каталог ошибок

Также доступно в

SDK
subscriptions.unsubscribeDomain()
CLI
openemail subscriptions unsubscribe-domain
MCP
unsubscribeSubscriptionDomain

POST/subscriptions/{id}/unsubscribe

Unsubscribe from a sender

Разрешенияthreads:writeОтправляет почту

Unsubscribing works the way the sender asks for it: a one-click request to its unsubscribe address when it offers one, an unsubscribe email from the address the mail arrived at when it gives a mailto, and otherwise the sender's own unsubscribe page in url, which a person has to open. method says which. With bin, every conversation from the sender also moves to the Bin.

Requires the threads:write scope.

Параметры пути

idstringОбязательно

The subscription, as GET /subscriptions returns it.

Тело запроса

binboolean

Also move every conversation from the sender to the Bin.

По умолчаниюfalse

Возвращает

How it was unsubscribed.

Ошибки

422

unsubscribe_unsupported: the sender gives no way to unsubscribe.

502

unsubscribe_refused: the sender did not accept the one-click request and gives no address to write to.

Ошибки, которые может вернуть любая операция400401403404500Каталог ошибок

Также доступно в

SDK
subscriptions.unsubscribe()
CLI
openemail subscriptions unsubscribe
MCP
unsubscribeSubscription

POST/subscriptions/{id}/move

Move what a sender sent

Разрешенияthreads:writeИзменяет данные

Moves every conversation from the sender to the archive, the Bin or a label. With future, the default, a rule keeps doing it to new mail from the sender to that address, which also needs rules:write. future: false drops a rule made that way before.

Requires the threads:write scope.

Параметры пути

idstringОбязательно

The subscription, as GET /subscriptions returns it.

Тело запроса

destinationstringОбязательно

archive, bin or label.

Одно из"archive""bin""label"
labelIdstring

The label to file under when destination is label.

Может быть nullОт 1 до 200 символов
futureboolean

Also keep doing it to new mail from the sender, with a rule. Needs rules:write.

По умолчаниюtrue
ruleNamestring

A name for that rule.

Может быть nullДо 100 символов

Возвращает

How many conversations moved, and the rule.

Ошибки

Ошибки, которые может вернуть любая операция400401403404422500Каталог ошибок

Также доступно в

SDK
subscriptions.move()
CLI
openemail subscriptions move
MCP
moveSubscription

POST/threads/{id}/unsubscribe

Unsubscribe from the sender of a thread

Разрешенияthreads:writeОтправляет почту

The Unsubscribe button of the reading pane: finds the subscription behind the newest message of the thread that carries a List-Unsubscribe header and unsubscribes from it. Unsubscribing works the way the sender asks for it: a one-click request to its unsubscribe address when it offers one, an unsubscribe email from the address the mail arrived at when it gives a mailto, and otherwise the sender's own unsubscribe page in url, which a person has to open. method says which.

Requires the threads:write scope.

Параметры пути

idstringОбязательно

The thread, as GET /threads returns it.

Возвращает

How it was unsubscribed.

Ошибки

422

unsubscribe_unsupported: the sender gives no way to unsubscribe.

502

unsubscribe_refused: the sender did not accept the one-click request and gives no address to write to.

Ошибки, которые может вернуть любая операция400401403404500Каталог ошибок

Также доступно в

SDK
threads.unsubscribe()
CLI
openemail threads unsubscribe
MCP
unsubscribeThread

Объекты

DomainUnsubscribeResultobject

objectstring
Одно из"domain_unsubscribe"
domainstring
unsubscribedinteger
skippedinteger

Senders that only offer a page.

failedinteger
binnedinteger

Subscriptionobject

objectstring
Одно из"subscription"
idstring
senderEmailstring
senderNamestring
Может быть null
recipientstring

The address the mail arrives at.

statusstring
Одно из"active""unsubscribed"
methodstring

How the sender lets you unsubscribe, or null when it gives no way.

Может быть nullОдно из"one-click""email""link"
linkUrlstring

Its unsubscribe page, when it has one.

Может быть null
unreadinteger
recentinteger

Mail in the last 30 days.

totalinteger
sinceUnsubscribedinteger

Mail that still arrived after you unsubscribed.

lastSeenAtstring
Форматdate-time
unsubscribedAtstring
Может быть nullФорматdate-time
unsubscribedWithstring
Может быть nullОдно из"one-click""email""link"
futureobject

The rule that keeps moving its new mail, when there is one.

Может быть null
ruleIdstring
destinationstring
Одно из"archive""bin""label"
labelIdstring
Может быть null

SubscriptionDomainobject

objectstring
Одно из"subscription_domain"
domainstring
namestring
sampleEmailstring

One sender address on the domain.

sendersinteger
unsubscribableinteger

Senders that can be unsubscribed without a person opening a page.

unreadinteger
recentinteger
totalinteger
sinceUnsubscribedinteger
lastSeenAtstring
Форматdate-time

SubscriptionDomainListobject

objectstring
Одно из"list"
totalinteger
countsobject
activeinteger
unsubscribedinteger
hasMoreboolean

SubscriptionListobject

objectstring
Одно из"list"
totalinteger

Rows that match, across every page.

countsobject
activeinteger
unsubscribedinteger
hasMoreboolean

SubscriptionMoveResultobject

objectstring
Одно из"subscription_move"
subscriptionIdstring
movedinteger

Conversations moved.

ruleIdstring

The rule that keeps moving new mail.

Может быть null

UnsubscribeResultobject

objectstring
Одно из"unsubscribe"
subscriptionIdstring
threadIdstring

Present when it was asked for through a thread.

methodstring
Одно из"one-click""email""link"
urlstring

The page to open when method is link, since that one needs a person.

Может быть null
binnedinteger

Conversations moved to the Bin.