Fuselage
Powered By GitBook
Set Preferences
URL
Requires Auth
HTTP Method
/api/v1/users.setPreferences
yes
POST

Payload

Argument
Example
Required
Description
userId
BsNr28znDkG8aeo7W
Required
The id of the user.
data.newRoomNotification
test
Required
New room notification.
data.newMessageNotification
test
Required
New message notification.
data.useEmojis
true
Required
User can use emojis.
data.convertAsciiEmoji
true
Required
Convert ascII emojis.
data.saveMobileBandwidth
true
Required
Save mobile bandwidth.
data.collapseMediaByDefault
true
Required
Collapse media by default.
data.autoImageLoad
true
Required
Image load automatically.
data.emailNotificationMode
test
Required
Email notification mode.
data.roomsListExhibitionMode
test
Required
Rooms list exhibition mode.
data.unreadAlert
true
Required
Unread Alert.
data.notificationsSoundVolume
100
Required
Volume of notification sound.
data.desktopNotifications
test
Required
Desktop notifications.
data.mobileNotifications
test
Required
Mobile notifications.
data.enableAutoAway
true
Required
Enable auto away.
data.highlights
[]
Required
Highlights.
data.desktopNotificationDuration
100
Required
Duration of desktop notification.
data.desktopNotificationRequireInteraction
false
Required
Determines if user has to click on desktop notification to close it (requires Google Chrome version > 50 as client, overwrites setting desktopNotificationDuration).
data.viewMode
0
Required
View mode.
data.hideUsernames
false
Required
Hide usernames.
data.hideRoles
false
Required
Hide user roles.
data.hideAvatars
false
Required
Hide avatars.
data.sendOnEnter
test
Required
Send message on enter.
data.roomCounterSidebar
true
Required
Display room counter on sidebar.
data.language
pt-BR
Required
Language.
data.sidebarShowFavorites
true
Optional
Show favorites on sidebar.
data.sidebarShowUnread
true
Optional
Show unread on sidebar.
data.sidebarSortby
test
Optional
Show sort by.
data.sidebarViewMode
test
Optional
Show view mode.
data.sidebarHideAvatar
true
Optional
Show avatar on hide bar.
data.groupByType
true
Optional
Group channels by type.
data.muteFocusedConversations
true
Optional
Mute focused conversations.

Example Call

1
curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
2
-H "X-User-Id: aobEdbYhXfu5hkeqG" \
3
-H "Content-type:application/json" \
4
http://localhost:3000/api/v1/users.setPreferences \
5
-d '{ "userId": "BsNr28znDkG8aeo7W", "data": { } }'
Copied!

Example Result

1
{
2
"success": true,
3
"user": {
4
"_id": "rocketchat.internal.admin.test",
5
"settings": {
6
"preferences": {
7
"newRoomNotification": "door",
8
"newMessageNotification": "chime",
9
"muteFocusedConversations": true,
10
"useEmojis": true,
11
"convertAsciiEmoji": true,
12
"saveMobileBandwidth": true,
13
"collapseMediaByDefault": false,
14
"autoImageLoad": true,
15
"emailNotificationMode": "all",
16
"roomsListExhibitionMode": "category",
17
"unreadAlert": true,
18
"notificationsSoundVolume": 100,
19
"desktopNotifications": "default",
20
"mobileNotifications": "default",
21
"enableAutoAway": true,
22
"highlights": [],
23
"desktopNotificationDuration": 0,
24
"desktopNotificationRequireInteraction": false,
25
"viewMode": 0,
26
"hideUsernames": false,
27
"hideRoles": false,
28
"hideAvatars": false,
29
"hideFlexTab": false,
30
"sendOnEnter": "normal",
31
"roomCounterSidebar": false
32
}
33
}
34
}
35
}
Copied!

Change Log

Version
Description
2.3.0
Added desktopNotificationRequireInteraction property.
Last modified 6mo ago
Export as PDF
Copy link