Mark as read or unread
/unread instead of /read to mark it unread. Neither takes a body.
The response is the updated email object, with is_unread changed. An email.update event follows, with the updated email.
Move to a folder
The
fld_… id of the folder to move it to, from List folders. On IMAP an email is in one folder, so give one id. For Gmail (IMAP), moving to a label folder adds that label and removes the one it came from; Gmail has no ARCHIVE folder over IMAP.folders. The email keeps its id when it moves. An email.update event follows, with the updated email.
An empty folders_ids, more than one id, or a folder of another account gets 400 errors/invalid_parameters.
Move to trash
Response
folders becomes the Trash folder (the folder whose role is TRASH), and an email.update event follows. The email stays in the API while it’s in Trash. The provider empties the trash on its own schedule (Gmail after 30 days). When it’s gone for good, you receive email.delete.
Changes made elsewhere
When the user reads, moves or deletes an email in their own email app, the engine picks it up on the next sync and sends the same events:email.update for a change or a move, email.delete when it’s deleted for good.