Renaming and deleting need the mail-server update, which ships separately
from the API. Until it lands, those two answer
502 mail_unavailable and
nothing changes. Listing and creating work now.Folders are addressed by
path, in the query string or the body — never as a
URL segment.A folder’s identity is its IMAP path, and a path can contain the server’s
hierarchy delimiter (/ here, . on plenty of other servers). Put through a
URL segment it has to survive two rounds of encoding to arrive intact, and the
failure mode is a caller addressing a folder that looks right and is not.List folders
role is read from the server’s own SPECIAL-USE attribute, not guessed from
the name — Junk is “Spam” on some servers and Trash is “Deleted Items” on
others. editable is false for every folder with a role, including INBOX.
Renaming the Sent folder would not break a name, it would break “file a copy in
Sent” for every client the account uses.
Create a folder
201 Created. Use the returned path, do not assume it. The server picks
it — the hierarchy delimiter and any namespace prefix are its to choose, so the
name you sent is not reliably the path that comes back.
Folders are flat. Separators in the name are replaced with spaces rather than
escaped, so Work/2026 becomes one folder called Work 2026 instead of
silently nesting under a parent you did not ask for.
Duplicate names are refused with invalid_request.
Rename a folder
path, which again the server decides. Messages stay where
they are — a rename moves nothing.
Only folders with "editable": true can be renamed.
Delete a folder
role, and refused for a folder with folders
inside it — delete those first. A server that stores children inside their
parent would otherwise take a whole tree with one call.
Errors
See Errors for the full response shape.