Update mail preferences
const url = 'https://mail.work.optidata.cloud/api/mail/user/83/preferences';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"reader_split_mode":"vertical","conversations_per_page":50}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://mail.work.optidata.cloud/api/mail/user/83/preferences \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "reader_split_mode": "vertical", "conversations_per_page": 50 }'Change how the mail client behaves for a user: the reading-pane layout, whether the list groups messages into conversations, the order of messages inside a thread, the page size of every listing, and the default compose font. Only the authenticated user’s own preferences may be changed.
Every field is optional; the ones you omit are left untouched.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”Id of the user. Must be the authenticated user.
Request Bodyrequired
Section titled “Request Bodyrequired”The mail preferences that may be changed. Every field is optional.
object
Page size of every listing.
Default text colour, as a 6-digit hex triplet.
Examples
Vertical reading pane, 50 conversations per page
{ "reader_split_mode": "vertical", "conversations_per_page": 50}Default compose font
{ "compose_font_family": "Georgia", "compose_font_color": "#333333"}Responses
Section titled “ Responses ”Preferences saved. The body is the literal string success.
Missing, malformed or expired authentication key.
Authentication failures use an error key rather than message.
object
Examples
No bearer token sent
{ "error": "JWT passport exception: Missing bearer token in request"}The caller may not act on this mailbox, user or resource.
Generic error envelope used by policy, binding and framework failures.
object
Human-readable description of the failure.
Examples
{ "message": "This action is unauthorized."}The request body or query string failed validation.
object
The first validation message.
Validation messages keyed by field name.
object
Examples
{ "message": "The conversations field is required.", "errors": { "conversation_ids": [ "The conversations field is required." ] }}Rate limit exceeded. Retry after the window resets.
Generic error envelope used by policy, binding and framework failures.
object
Human-readable description of the failure.
Examples
{ "message": "Too Many Attempts."}