Skip to main content
Response
Inbox comes first, then folders with a role, then the others by name. The list isn’t paged: has_more is always false. An email’s folders lists fld_… ids. To know if an email is in the inbox, compare them with the id of the folder whose role is INBOX.

One folder

The response is one folder object, as above.

Create a folder

string
required
The folder’s name.
string
The fld_… id of the folder to create it in.
The folder is created in the user’s mailbox. The response (201) is the new folder object, and an email.folder.create event follows.

Rename a folder

The response is the renamed folder. It keeps its id, and an email.folder.update event follows.

Delete a folder

Response
Deleting a folder also deletes the emails in it: IMAP has no labels to keep them under. Move the emails you want to keep first. An email.folder.delete event follows.
Only folders with the role UNKNOWN (the user’s own folders) can be renamed or deleted. Inbox, Sent, Trash and other special folders get 400 errors/invalid_parameters.

Changes

Folders are kept in sync: folders the user creates, renames or deletes in their own email app show up on the next sync. Each change, made through the API or elsewhere, sends an event with the folder in data.folder: The folders a new account already has don’t send events when it first syncs.