Abonnements
Jede Operation in dieser Gruppe: was sie annimmt, was sie zurückgibt und mit welchen Fehlern sie antworten kann.
Operationen
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
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.
Query-Parameter
statusstringactivelists what still arrives,unsubscribedwhat you left.Einer von"active""unsubscribed"Standard"active"qstringSearches the sender name and address.
Bis zu 200 Zeichensortstringrecentputs the newest mail first,mostthe senders with the most mail,unreadthose with the most unread,namesorts by sender.Einer von"recent""most""unread""name"Standard"recent"limitintegerRows per page.
Mindestens 1Höchstens 200Standard50offsetintegerHow many rows to skip, for the next page.
Mindestens 0Standard0addressstringOnly the subscriptions delivered to this address. One the key does not reach lists nothing.
3 bis 320 Zeichen
Rückgabe
A page of subscriptions.
Fehler
Die Fehler, die jede Operation zurückgeben kann400401403404422500Fehlerkatalog
Auch verfügbar über
GET/subscriptions/domains
List subscriptions by domain
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.
Query-Parameter
statusstringactivelists what still arrives,unsubscribedwhat you left.Einer von"active""unsubscribed"Standard"active"qstringSearches the sender name and address.
Bis zu 200 Zeichensortstringrecentputs the newest mail first,mostthe senders with the most mail,unreadthose with the most unread,namesorts by sender.Einer von"recent""most""unread""name"Standard"recent"limitintegerRows per page.
Mindestens 1Höchstens 200Standard50offsetintegerHow many rows to skip, for the next page.
Mindestens 0Standard0addressstringOnly the subscriptions delivered to this address. One the key does not reach lists nothing.
3 bis 320 Zeichen
Rückgabe
A page of sender domains.
Fehler
Die Fehler, die jede Operation zurückgeben kann400401403404422500Fehlerkatalog
Auch verfügbar über
POST/subscriptions/domains/{domain}/unsubscribe
Unsubscribe from a whole domain
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.
Pfadparameter
domainstringErforderlichThe sender domain, as
GET /subscriptions/domainsreturns it.
Request-Body
binbooleanAlso move every conversation from the senders to the Bin.
StandardfalseaddressstringOnly the subscriptions delivered to this address.
3 bis 320 Zeichen
Rückgabe
What happened to each sender, counted.
Fehler
Die Fehler, die jede Operation zurückgeben kann400401403404422500Fehlerkatalog
Auch verfügbar über
POST/subscriptions/{id}/unsubscribe
Unsubscribe from a sender
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.
Pfadparameter
idstringErforderlichThe subscription, as
GET /subscriptionsreturns it.
Request-Body
binbooleanAlso move every conversation from the sender to the Bin.
Standardfalse
Rückgabe
How it was unsubscribed.
Fehler
- 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.
Die Fehler, die jede Operation zurückgeben kann400401403404500Fehlerkatalog
Auch verfügbar über
POST/subscriptions/{id}/move
Move what a sender sent
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.
Pfadparameter
idstringErforderlichThe subscription, as
GET /subscriptionsreturns it.
Request-Body
destinationstringErforderlicharchive,binorlabel.Einer von"archive""bin""label"labelIdstringThe label to file under when
destinationislabel.Kann null sein1 bis 200 ZeichenfuturebooleanAlso keep doing it to new mail from the sender, with a rule. Needs
rules:write.StandardtrueruleNamestringA name for that rule.
Kann null seinBis zu 100 Zeichen
Rückgabe
How many conversations moved, and the rule.
Fehler
Die Fehler, die jede Operation zurückgeben kann400401403404422500Fehlerkatalog
Auch verfügbar über
POST/threads/{id}/unsubscribe
Unsubscribe from the sender of a thread
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.
Pfadparameter
idstringErforderlichThe thread, as
GET /threadsreturns it.
Rückgabe
How it was unsubscribed.
Fehler
- 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.
Die Fehler, die jede Operation zurückgeben kann400401403404500Fehlerkatalog
Auch verfügbar über
Objekte
DomainUnsubscribeResultobject
objectstring- Einer von
"domain_unsubscribe" domainstringunsubscribedintegerskippedintegerSenders that only offer a page.
failedintegerbinnedinteger
Subscriptionobject
objectstring- Einer von
"subscription" idstringsenderEmailstringsenderNamestring- Kann null sein
recipientstringThe address the mail arrives at.
statusstring- Einer von
"active""unsubscribed" methodstringHow the sender lets you unsubscribe, or null when it gives no way.
Kann null seinEiner von"one-click""email""link"linkUrlstringIts unsubscribe page, when it has one.
Kann null seinunreadintegerrecentintegerMail in the last 30 days.
totalintegersinceUnsubscribedintegerMail that still arrived after you unsubscribed.
lastSeenAtstring- Format
date-time unsubscribedAtstring- Kann null seinFormat
date-time unsubscribedWithstring- Kann null seinEiner von
"one-click""email""link" futureobjectThe rule that keeps moving its new mail, when there is one.
Kann null seinruleIdstringdestinationstring- Einer von
"archive""bin""label" labelIdstring- Kann null sein
SubscriptionDomainobject
objectstring- Einer von
"subscription_domain" domainstringnamestringsampleEmailstringOne sender address on the domain.
sendersintegerunsubscribableintegerSenders that can be unsubscribed without a person opening a page.
unreadintegerrecentintegertotalintegersinceUnsubscribedintegerlastSeenAtstring- Format
date-time
SubscriptionDomainListobject
objectstring- Einer von
"list" totalintegercountsobjectactiveintegerunsubscribedinteger
hasMoreboolean
SubscriptionListobject
objectstring- Einer von
"list" dataSubscription[]totalintegerRows that match, across every page.
countsobjectactiveintegerunsubscribedinteger
hasMoreboolean
SubscriptionMoveResultobject
objectstring- Einer von
"subscription_move" subscriptionIdstringmovedintegerConversations moved.
ruleIdstringThe rule that keeps moving new mail.
Kann null sein
UnsubscribeResultobject
objectstring- Einer von
"unsubscribe" subscriptionIdstringthreadIdstringPresent when it was asked for through a thread.
methodstring- Einer von
"one-click""email""link" urlstringThe page to open when
methodislink, since that one needs a person.Kann null seinbinnedintegerConversations moved to the Bin.