Open Webmail
Developer & API·6 min read

Messages, settings & rules API

Reference for sending messages, reading/updating user preferences, managing mail rules, and exporting .mbox archives.

User preferences

GET/api/settings/preferences
Session

Returns the authenticated user's layout, compose, notification, and appearance preferences.

{
  "preferences": {
    "readingPane": "right",
    "density": "comfortable",
    "undoSendSeconds": 5,
    "spamSensitivity": "standard"
  }
}
PUT/api/settings/preferences
Session

Partially updates and persists preferences in SQLite.

Body parameters
readingPane"right" | "bottom" | "off"— Reading pane layout
density"comfortable" | "compact"— Message list density
undoSendSeconds5 | 10 | 20 | 30— Undo send delay
spamSensitivity"standard" | "strict"— Inbound spam threshold
Update preferences
curl -b cookies.txt -X PUT https://mail.example.com/api/settings/preferences \
  -H "Content-Type: application/json" \
  -d '{"readingPane":"bottom","undoSendSeconds":10}'

Mail rules & sender lists

GET/api/settings/rules
Session

Lists the user's mail rules ordered by sort_order.

POST/api/settings/rules
Session

Creates a new server-side mail rule.

POST/api/settings/rules/apply
Session

Applies all enabled rules across existing Inbox, Archive, and Spam messages.

{ "ok": true, "updatedCount": 14 }
POST/api/settings/sender-lists
Session

Adds an email address or domain to the blocked or safe sender list.

Body parameters
listType"blocked" | "safe"required— Target list
entrystringrequired— Email address or domain
GET/api/settings/export
Session

Streams all non-deleted user messages as an RFC 4155 .mbox download.