Set User Preferences

Prev Next
Post
/api/v1/users.setPreferences

Set preferences for your account. If you want to edit another user's preferences, you need the permission edit-other-user-info.

Changelog

Version Description
2.3.0 Added desktopNotificationRequireInteraction property.
Header parameters
X-User-Id
stringRequired

The authenticated user ID.

ExamplerbAXPnMktTFbNpwtJ
X-Auth-Token
stringRequired

The authenticated user token.

ExampleRScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f
Body parameters
Example 1
{
  "userId": "rbAXPnMktTFbNpwtJ",
  "data": {
    "language": "en",
    "newRoomNotification": "door",
    "newMessageNotification": "chime",
    "muteFocusedConversations": true,
    "clockMode": 0,
    "useEmojis": true,
    "convertAsciiEmoji": true,
    "saveMobileBandwidth": true,
    "collapseMediaByDefault": true,
    "autoImageLoad": true,
    "emailNotificationMode": "mentions",
    "unreadAlert": true,
    "notificationsSoundVolume": 0,
    "desktopNotifications": "mentions",
    "pushNotifications": "mentions",
    "enableAutoAway": true,
    "highlights": [
      "[\"deploy\", \"docker\"]"
    ],
    "messageViewMode": 0,
    "hideUsernames": true,
    "hideRoles": true,
    "displayAvatars": true,
    "hideFlexTab": true,
    "sendOnEnter": "string",
    "idleTimeLimit": 300,
    "sidebarShowFavorites": true,
    "sidebarShowUnread": true,
    "sidebarSortby": "string",
    "sidebarViewMode": "string",
    "sidebarDisplayAvatar": true,
    "sidebarGroupByType": true,
    "dontAskAgainList": [
      {}
    ],
    "notifyCalendarEvents": false,
    "themeAppearence": "auto"
  }
}
Expand All
object
userId
string

The user ID whose preferences you want to change. If an ID is not provided, the preferences will be set for the user who is sending the request.

data
object Required

The object with the following preference details.

language
string

The preferred language for the user.

Exampleen
newRoomNotification
string

Set the sound for new room notifications. The notification sounds are customizable, you can check the preferences in your workspace account for the list of options available.

Default"door"
Examplechime
newMessageNotification
string

New message notification sound. The notification sounds are customizable, you can check the preferences in your workspace account for the list of options available.

Default"chime"
Examplechime
muteFocusedConversations
boolean

When set to true, open and active rooms will not create notification sounds.

clockMode
integer

The valid display formats for the clock. You can enter the values 0, 1, or 2.

  • 0: System default
  • 1: 12-hour clock
  • 2: 24-hour clock
useEmojis
boolean

A boolean value that indicates whether the user has enabled the option to use emojis.

convertAsciiEmoji
boolean

A boolean value that indicates whether the user has enabled the option to convert ASCII emojis.

saveMobileBandwidth
boolean

A boolean value that indicates whether the user has enabled the option to save mobile bandwidth.

collapseMediaByDefault
boolean

A boolean value that indicates whether the user has enabled the option to collapse media by default.

autoImageLoad
boolean

A boolean value indicates whether the user has enabled the option to load images automatically.

emailNotificationMode
string

The preferred mode for email notifications. The options are:

  • all: Get desktop notifications for all messages.
  • mentions: Get the notifications only for mentions.
  • nothing: Get no desktop notifications.
Examplementions
unreadAlert
boolean

A boolean value indicates whether the user has enabled the option.

notificationsSoundVolume
integer

The sound volume for notifications.

desktopNotifications
string

The type of desktop notifications.

  • all: Get desktop notifications for all messages.
  • mentions: Get the notifications only for mentions.
  • nothing: Get no desktop notifications.
Examplementions
pushNotifications
string

The type of push notifications.

  • all: Get push notifications for all messages.
  • mentions: Get the notifications only for mentions.
  • nothing: Get no push notifications.
Examplementions
enableAutoAway
boolean

A boolean value that indicates whether the user has enabled the option to update the status as away after a certain amount of idle time.

highlights
Array of string

The message highlights section. You will be notified when someone mentions a word or phrase that you add here. Highlight words are not case-sensitive.

string
Example["deploy", "docker"]
messageViewMode
integer

The preferred view mode for the messages i. The available options are:

  • 0 - Normal
  • 1 - Cozy
  • 2 - Compact
hideUsernames
boolean

A boolean value that indicates whether the user has enabled the option to hide usernames.

hideRoles
boolean

A boolean value that indicates whether the user has enabled the option to hide roles.

displayAvatars
boolean

A boolean value that indicates whether the user has enabled the option to display user avatars.

hideFlexTab
boolean

A boolean value that indicates whether the user has enabled the option to automatically close the right sidebar in rooms when you click outside them.

sendOnEnter
string

Set how you want the Enter key to behave when sending messages.

  • normal - Send messages with the Enter key.
  • alternative - Send messages with Enter + Ctrl/Alt/Shift/Cmd.
  • desktop - Send messages with Enter only on the desktop.
idleTimeLimit
integer

The time limit that is to be considered as idle time. After this time, the user status changes to away.

Example300
sidebarShowFavorites
boolean

A boolean value that indicates whether the user has enabled the option to show favorites on the sidebar.

sidebarShowUnread
boolean

A boolean value that indicates whether the user has enabled the option to show unread messages in the sidebar.

sidebarSortby
string

To sort the messages in the sidebar alphabetically or by activity. The values can be:

  • activity
  • alphabetical
sidebarViewMode
string

The view mode of the sidebar. The values can be:

  • extended
  • medium
  • condensed
sidebarDisplayAvatar
boolean

A boolean value that indicates whether the user has enabled the option to display avatars in the sidebar.

sidebarGroupByType
boolean

A boolean value that indicates whether the user has enabled the option to show the grouped values in the sidebar.

dontAskAgainList
Array of object

This field stores all the "warnings" a user opted not to be displayed again. An example where this works is when hiding a room. "dontAskAgainList":[{"action":"hideRoom","label":"Hide"}]"

object
action
string
label
string
notifyCalendarEvents
boolean

If you are using Outlook Calendar in your workspace, you can enable or disable calendar event notifications using this parameter.

Defaultfalse
themeAppearence
string

Set your preferrred workspace theme. The options are:

  • light
  • dark
  • auto
  • high-contrast
Default"auto"
Examplelight
masterVolume
number

Control the volume for all sounds coming from your workspace.

alsoSendThreadToChannel
string

When replying to a thread, select how your replies should be sent to the room:

  • never: Thread replies are not sent to the channel.
  • always: Thread replies are sent to the channel.
  • default: Defaults to the workspace settings set by the admin.
desktopNotificationRequireInteraction
boolean

When set to true, notifications will remain in the notification panel until they are visited or closed.

showThreadsInMainChannel
boolean

When set to true, all replies under a thread will also be displayed directly in the main room. When disabled, they're displayed based on the sender's choice.

fontSize
string

Set the font size. The options are:

  • small
  • medium
  • large
receiveLoginDetectionEmail
boolean

Set this option to true to get an email notification whenever a login is made to your account.

omnichannelTranscriptPDF
boolean

Set to true to always export the transcript as PDF at the end of Omnichannel conversations.

omnichannelTranscriptEmail
boolean

Set to true to always send the transcript to contacts at the end of conversations.

omnichannelHideConversationAfterClosing
boolean

Set to true to redirect agents to the home page after closing a conversation.

enableMobileRinging
boolean

If you are using the Rocket.Chat Voice feature, you can set this parameter to true for mobile call notifications.

Responses
200

OK

Success Example
{
  "preferences": {
    "enableAutoAway": true,
    "idleTimeLimit": 300,
    "desktopNotificationRequireInteraction": false,
    "desktopNotifications": "default",
    "pushNotifications": "all",
    "unreadAlert": false,
    "useEmojis": true,
    "convertAsciiEmoji": true,
    "autoImageLoad": true,
    "saveMobileBandwidth": true,
    "collapseMediaByDefault": false,
    "hideUsernames": false,
    "hideRoles": false,
    "hideFlexTab": false,
    "displayAvatars": true,
    "sidebarGroupByType": true,
    "sidebarViewMode": "condensed",
    "sidebarDisplayAvatar": true,
    "sidebarShowUnread": true,
    "sidebarSortby": "activity",
    "showMessageInMainThread": false,
    "sidebarShowFavorites": true,
    "sendOnEnter": "normal",
    "messageViewMode": 0,
    "emailNotificationMode": "mentions",
    "newRoomNotification": "door",
    "newMessageNotification": "chime",
    "muteFocusedConversations": true,
    "notificationsSoundVolume": 100,
    "enableMessageParserEarlyAdoption": false,
    "mobileNotifications": "default",
    "desktopNotificationDuration": 0,
    "dontAskAgainList": [],
    "highlights": [],
    "language": "en"
  }
}
Expand All
object
user
object
_id
string
settings
object
preferences
object
enableAutoAway
boolean
idleTimeLimit
integer
desktopNotificationRequireInteraction
boolean
desktopNotifications
string
pushNotifications
string
unreadAlert
boolean
useEmojis
boolean
convertAsciiEmoji
boolean
autoImageLoad
boolean
saveMobileBandwidth
boolean
collapseMediaByDefault
boolean
hideUsernames
boolean
hideRoles
boolean
hideFlexTab
boolean
displayAvatars
boolean
sidebarGroupByType
boolean
sidebarViewMode
string
sidebarDisplayAvatar
boolean
sidebarShowUnread
boolean
sidebarSortby
string
showMessageInMainThread
boolean
sidebarShowFavorites
boolean
sendOnEnter
string
messageViewMode
integer
emailNotificationMode
string
newRoomNotification
string
newMessageNotification
string
muteFocusedConversations
boolean
notificationsSoundVolume
integer
enableMessageParserEarlyAdoption
boolean
mobileNotifications
string
desktopNotificationDuration
integer
dontAskAgainList
Array of object
object
highlights
Array of object
object
language
string
success
boolean
400

Bad Request

Example 1
{
  "success": false,
  "error": "must have required property 'data' [invalid-params]",
  "errorType": "invalid-params"
}
object
success
boolean
error
string
errorType
string
401

Unauthorized

Authorization Error
{
  "status": "error",
  "message": "You must be logged in to do this."
}
object
status
string
message
string