Update many threads
PATCH
/threadsMakes the same change to up to 200 conversations in one request, such as marking a screenful read.
Needs the permissionthreads:update
One request per conversation would spend the minute’s allowance on the first page. This takes the fields of Update a thread, and the ids to apply them to.
applied counts the conversations that changed. Ids the key can’t see are left out without an error. For read, which is kept per person, it’s always the number of ids you sent.
Body
idslist of stringsrequired- Up to 200 thread ids.
statusstringoptionalopen,closed,spamortrash.isImportantbooleanoptional- Mark it important, or not.
readbooleanoptional- Read or unread, for the key’s owner.
assignstringoptional- A person’s user id, to put them on the conversation.
unassignstringoptional- A person’s user id, to take them off it.
Returns
appliednumber- How many changed.
requestednumber- How many ids you sent.
Errors
400ids_required- There’s no
idslist, or it’s empty. 400too_many_ids- More than 200 ids.
400invalid_patch- There’s nothing to change, or a field has the wrong value.
401invalid_key- The key is wrong, expired or revoked. With no Authorization header at all, the code is
missing_credentials. 403missing_scope- The key doesn’t have
threads:update. TheX-Required-Scopeheader names what’s missing. 403not_your_mailbox- Spam or trash on a conversation given to the key’s owner without its mailbox. Nothing was changed.
429rate_limited- More than 120 requests a minute from this key. Wait for
Retry-Afterseconds.