HTTP Method | URL | Requires Auth |
---|---|---|
POST | /api/v1/users.setPreferences | yes |
{% hint style="info" %}
If you want to edit another user's preferences, you need the permission edit-other-user-info
.
{% endhint %}
Key | Example Value | Description |
---|---|---|
userId | BsNr28znDkG8ae | 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 * | "data": { ... } | The object with the following preference details. |
language | en | The preferred language for the user. |
newRoomNotification | door | New room notification sound. |
newMessageNotification | chime | New message notification sound. |
muteFocusedConversations | true | A boolean value that indicates whether the user has enabled the option to mute focused conversations. |
clockMode | 1 | The valid display formats for the clock. You can enter the values
|
useEmojis | true | A boolean value that indicates whether the user has enabled the option to use emojis. |
convertAsciiEmoji | true | A boolean value that indicates whether the user has enabled the option to convert ASCII emojis. |
saveMobileBandwidth | true | A boolean value that indicates whether the user has enabled the option to save mobile bandwidth. |
collapseMediaByDefault | true | A boolean value that indicates whether the user has enabled the option to collapse media by default. |
autoImageLoad | true | A boolean value indicates whether the user has enabled the option to load images automatically. |
emailNotificationMode | mentions | The preferred mode for email notifications. |
unreadAlert | true | A boolean value indicates whether the user has enabled the option. |
notificationsSoundVolume | 100 | The sound volume for notifications. |
desktopNotifications | mentions | The type of desktop notifications.
|
pushNotifications | mentions | The mobile push notification.
|
enableAutoAway | false | 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 | ["deploy", "docker"] | 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. |
messageViewMode | 1 | The preferred view mode for the messages. The available options are:
|
hideUsernames | true | A boolean value that indicates whether the user has enabled the option to hide usernames. |
hideRoles | true | A boolean value that indicates whether the user has enabled the option to hide roles. |
displayAvatars | true | A boolean value that indicates whether the user has enabled the option to display user avatars. |
hideFlexTab | true | A boolean value that indicates whether the user has enabled the option. |
sendOnEnter | normal | Set how you want the Enter key to behave when sending messages.
|
idleTimeLimit | 300 | The time limit that is to be considered as idle time. |
sidebarShowFavorites | true | A boolean value that indicates whether the user has enabled the option to show favorites on the sidebar. |
sidebarShowUnread | true | A boolean value that indicates whether the user has enabled the option to show unread messages in the sidebar. |
sidebarSortby | activity | To sort the messages in the sidebar alphabetically or by activity. The values can be:
|
sidebarViewMode | condensed | The view mode of the sidebar. The values can be:
|
sidebarDisplayAvatar | true | A boolean value that indicates whether the user has enabled the option to display avatars in the sidebar. |
sidebarGroupByType | true | A boolean value that indicates whether the user has enabled the option to show the grouped values in the sidebar. |
dontAskAgainList | "dontAskAgainList":[{"action":"hideRoom","label":"Hide"}] | This field stores all the "warnings" a user opted not to be displayed again. An example where this works is when hiding a room. |
curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
-H "X-User-Id: aobEdbYhXfu5hkeqG" \
-H "Content-type:application/json" \
http://localhost:3000/api/v1/users.setPreferences \
-d '{ "userId": "BsNr28znDkG8aeo7W", "data": { } }'
// "settings": {
"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"
}
},
Version | Description |
---|---|
2.3.0 | Added desktopNotificationRequireInteraction property. |