Update a thread
/threads/{id}Changes a conversation’s status, marks it important or read, puts people on it or takes them off, renames, snoozes or moves it. Combine what you like; what you leave out stays as it is.
Needs the permissionthreads:update
Changes are made in a fixed order: status, important, read, then assignment. Assigning someone reopens a closed conversation.
People are assigned by user id, with assign and unassign rather than one assignee, because a conversation can have several people on it. List teams gives the user ids of the people in each team.
Moving to another mailbox needs threads:move as well: a body that only moves needs threads:move alone. DMU Mail’s record moves, the copies at your mail provider stay where they are, and labels that can’t be used in the new mailbox come off.
Renaming and snoozing work on one conversation at a time. Update many threads doesn’t take them.
Every change goes in the conversation’s history under the key’s name, so a colleague reading it sees which integration closed it.
Path parameters
idstringrequired- The thread.
Body
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.
displaySubjectstring or nulloptional- Renames it, up to 300 characters, as DMU Mail’s own rename does.
nullor an empty string gives back the mail’s own subject. snoozeUntilstring or nulloptional- Snoozes it until a time in the future, as ISO 8601, or wakes it with
null. A closed conversation isn’t snoozed. mailboxIdstringoptional- Moves it to another mailbox of your organisation. For a conversation started with no mailbox yet, it chooses one, and only its starter can.
Returns
The thread, as Get a thread returns it:
idstring- The thread.
subjectstring- Its subject.
messageslist- Every message in it, oldest first. Each has
id,subject,from(addressandname),to,bodyHtml,bodyText,sentAt,scheduledAtandstatus, as Get a message describes them.
Errors
400invalid_patch- There’s nothing to change, or a field has the wrong value. The message says which.
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 that was given to the key’s owner without its mailbox. Nothing was changed.
403not_visiblemailboxIdis a mailbox the key’s owner can’t see.403not_starter- The conversation was started with no mailbox yet, and only the person who started it can choose one.
404not_found- There’s no such thread, or no such mailbox to move it to.
409mailbox_unavailable- The mailbox to move it to can’t send right now.
409copy_in_mailbox- That mailbox already has its own copy of the conversation, from mail sent to both. A move doesn’t merge them.
429rate_limited- More than 120 requests a minute from this key. Wait for
Retry-Afterseconds.