> ## Documentation Index
> Fetch the complete documentation index at: https://developer.rocket.chat/llms.txt
> Use this file to discover all available pages before exploring further.

# Set User Preferences

> 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.       |

## OpenAPI

````json POST /api/v1/users.setPreferences
{
  "openapi": "3.0.0",
  "info": {
    "version": "1.0.0",
    "title": "User Management"
  },
  "servers": [
    {
      "url": "https://apiexplorer.support.rocket.chat"
    }
  ],
  "tags": [
    {
      "name": "LDAP"
    },
    {
      "name": "Permissions"
    },
    {
      "name": "Roles"
    },
    {
      "name": "Users"
    }
  ],
  "paths": {
    "/api/v1/users.setPreferences": {
      "post": {
        "summary": "Set User Preferences",
        "operationId": "post-api-v1-users.setPreferences",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "user": {
                      "type": "object",
                      "properties": {
                        "_id": {
                          "type": "string"
                        },
                        "settings": {
                          "type": "object",
                          "properties": {
                            "preferences": {
                              "type": "object",
                              "properties": {
                                "enableAutoAway": {
                                  "type": "boolean"
                                },
                                "idleTimeLimit": {
                                  "type": "integer"
                                },
                                "desktopNotificationRequireInteraction": {
                                  "type": "boolean"
                                },
                                "desktopNotifications": {
                                  "type": "string"
                                },
                                "pushNotifications": {
                                  "type": "string"
                                },
                                "unreadAlert": {
                                  "type": "boolean"
                                },
                                "useEmojis": {
                                  "type": "boolean"
                                },
                                "convertAsciiEmoji": {
                                  "type": "boolean"
                                },
                                "autoImageLoad": {
                                  "type": "boolean"
                                },
                                "saveMobileBandwidth": {
                                  "type": "boolean"
                                },
                                "collapseMediaByDefault": {
                                  "type": "boolean"
                                },
                                "hideUsernames": {
                                  "type": "boolean"
                                },
                                "hideRoles": {
                                  "type": "boolean"
                                },
                                "hideFlexTab": {
                                  "type": "boolean"
                                },
                                "displayAvatars": {
                                  "type": "boolean"
                                },
                                "sidebarGroupByType": {
                                  "type": "boolean"
                                },
                                "sidebarViewMode": {
                                  "type": "string"
                                },
                                "sidebarDisplayAvatar": {
                                  "type": "boolean"
                                },
                                "sidebarShowUnread": {
                                  "type": "boolean"
                                },
                                "sidebarSortby": {
                                  "type": "string"
                                },
                                "showMessageInMainThread": {
                                  "type": "boolean"
                                },
                                "sidebarShowFavorites": {
                                  "type": "boolean"
                                },
                                "sendOnEnter": {
                                  "type": "string"
                                },
                                "messageViewMode": {
                                  "type": "integer"
                                },
                                "emailNotificationMode": {
                                  "type": "string"
                                },
                                "newRoomNotification": {
                                  "type": "string"
                                },
                                "newMessageNotification": {
                                  "type": "string"
                                },
                                "muteFocusedConversations": {
                                  "type": "boolean"
                                },
                                "notificationsSoundVolume": {
                                  "type": "integer"
                                },
                                "enableMessageParserEarlyAdoption": {
                                  "type": "boolean"
                                },
                                "mobileNotifications": {
                                  "type": "string"
                                },
                                "desktopNotificationDuration": {
                                  "type": "integer"
                                },
                                "dontAskAgainList": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {}
                                  }
                                },
                                "highlights": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {}
                                  }
                                },
                                "language": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "success": {
                      "type": "boolean"
                    }
                  }
                },
                "examples": {
                  "Success Example": {
                    "value": {
                      "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"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "string"
                    },
                    "errorType": {
                      "type": "string"
                    }
                  }
                },
                "examples": {
                  "Example 1": {
                    "value": {
                      "success": "false",
                      "error": "must have required property 'data' [invalid-params]",
                      "errorType": "invalid-params"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/authorizationError"
          }
        },
        "description": "Set preferences for your account. If you want to edit another user's preferences, you need the permission `edit-other-user-info`.\n### Changelog\n| Version      | Description |\n| ---------------- | ------------|\n|2.3.0            | Added `desktopNotificationRequireInteraction` property.       |",
        "parameters": [
          {
            "$ref": "#/components/parameters/UserId"
          },
          {
            "$ref": "#/components/parameters/Auth-Token"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "data"
                ],
                "properties": {
                  "userId": {
                    "type": "string",
                    "description": "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": {
                    "type": "object",
                    "description": "The object with the following preference details.",
                    "properties": {
                      "language": {
                        "type": "string",
                        "description": "The preferred language for the user.",
                        "example": "en"
                      },
                      "newRoomNotification": {
                        "type": "string",
                        "example": "chime",
                        "description": "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"
                      },
                      "newMessageNotification": {
                        "type": "string",
                        "example": "chime",
                        "description": "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"
                      },
                      "muteFocusedConversations": {
                        "type": "boolean",
                        "description": "When set to true, open and active rooms will not create notification sounds."
                      },
                      "clockMode": {
                        "type": "integer",
                        "description": "The valid display formats for the clock. You can enter the values 0, 1, or 2.\n* `0`: System default\n* `1`: 12-hour clock\n* `2`: 24-hour clock"
                      },
                      "useEmojis": {
                        "type": "boolean",
                        "description": "A boolean value that indicates whether the user has enabled the option to use emojis."
                      },
                      "convertAsciiEmoji": {
                        "type": "boolean",
                        "description": "A boolean value that indicates whether the user has enabled the option to convert ASCII emojis."
                      },
                      "saveMobileBandwidth": {
                        "type": "boolean",
                        "description": "A boolean value that indicates whether the user has enabled the option to save mobile bandwidth."
                      },
                      "collapseMediaByDefault": {
                        "type": "boolean",
                        "description": "A boolean value that indicates whether the user has enabled the option to collapse media by default."
                      },
                      "autoImageLoad": {
                        "type": "boolean",
                        "description": "A boolean value indicates whether the user has enabled the option to load images automatically."
                      },
                      "emailNotificationMode": {
                        "type": "string",
                        "example": "mentions",
                        "description": "The preferred mode for email notifications. The options are:\n  * `all`: Get desktop notifications for all messages.\n  * `mentions`: Get the notifications only for mentions.\n  * `nothing`: Get no desktop notifications."
                      },
                      "unreadAlert": {
                        "type": "boolean",
                        "description": "A boolean value indicates whether the user has enabled the option."
                      },
                      "notificationsSoundVolume": {
                        "type": "integer",
                        "description": "The sound volume for notifications."
                      },
                      "desktopNotifications": {
                        "type": "string",
                        "description": "The type of desktop notifications.\n* `all`: Get desktop notifications for all messages.\n* `mentions`: Get the notifications only for mentions.\n* `nothing`: Get no desktop notifications.",
                        "example": "mentions"
                      },
                      "pushNotifications": {
                        "type": "string",
                        "example": "mentions",
                        "description": "The type of push notifications.\n* `all`: Get push notifications for all messages.\n* `mentions`: Get the notifications only for mentions.\n* `nothing`: Get no push notifications."
                      },
                      "enableAutoAway": {
                        "type": "boolean",
                        "description": "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": {
                        "type": "array",
                        "description": "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.",
                        "items": {
                          "type": "string",
                          "example": "[\"deploy\", \"docker\"]"
                        }
                      },
                      "messageViewMode": {
                        "type": "integer",
                        "description": "The preferred view mode for the messages i. The available options are:\n  * `0` - Normal\n  * `1` - Cozy\n  * `2` - Compact"
                      },
                      "hideUsernames": {
                        "type": "boolean",
                        "description": "A boolean value that indicates whether the user has enabled the option to hide usernames."
                      },
                      "hideRoles": {
                        "type": "boolean",
                        "description": "A boolean value that indicates whether the user has enabled the option to hide roles."
                      },
                      "displayAvatars": {
                        "type": "boolean",
                        "description": "A boolean value that indicates whether the user has enabled the option to display user avatars."
                      },
                      "hideFlexTab": {
                        "type": "boolean",
                        "description": "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": {
                        "type": "string",
                        "description": "Set how you want the **Enter** key to behave when sending messages.\n\n* `normal` - Send messages with the **Enter** key.\n* `alternative` - Send messages with **Enter** + **Ctrl/Alt/Shift/Cmd**.\n* `desktop` - Send messages with **Enter** only on the desktop."
                      },
                      "idleTimeLimit": {
                        "type": "integer",
                        "description": "The time limit that is to be considered as idle time. After this time, the user status changes to `away`.",
                        "example": "300"
                      },
                      "sidebarShowFavorites": {
                        "type": "boolean",
                        "description": "A boolean value that indicates whether the user has enabled the option to show favorites on the sidebar."
                      },
                      "sidebarShowUnread": {
                        "type": "boolean",
                        "description": "A boolean value that indicates whether the user has enabled the option to show unread messages in the sidebar."
                      },
                      "sidebarSortby": {
                        "type": "string",
                        "description": "To sort the messages in the sidebar alphabetically or by activity. The values can be:\n  * `activity`\n  * `alphabetical`"
                      },
                      "sidebarViewMode": {
                        "type": "string",
                        "description": "The view mode of the sidebar. The values can be:\n  * `extended`\n  * `medium`\n  * `condensed`"
                      },
                      "sidebarDisplayAvatar": {
                        "type": "boolean",
                        "description": "A boolean value that indicates whether the user has enabled the option to display avatars in the sidebar."
                      },
                      "sidebarGroupByType": {
                        "type": "boolean",
                        "description": "A boolean value that indicates whether the user has enabled the option to show the grouped values in the sidebar."
                      },
                      "dontAskAgainList": {
                        "type": "array",
                        "description": "This field stores all the \"warnings\" a user opted not to be displayed again. An example where this works is when hiding a room.\n\"dontAskAgainList\\\":[{\\\"action\\\":\\\"hideRoom\\\",\\\"label\\\":\\\"Hide\\\"}]\"",
                        "items": {
                          "type": "object",
                          "properties": {
                            "action": {
                              "type": "string"
                            },
                            "label": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      "notifyCalendarEvents": {
                        "type": "boolean",
                        "description": "If you are using Outlook Calendar in your workspace, you can enable or disable calendar event notifications using this parameter.",
                        "default": "false"
                      },
                      "themeAppearence": {
                        "type": "string",
                        "example": "light",
                        "default": "auto",
                        "description": "Set your preferrred workspace theme. The options are:\r\n* `light`\r\n* `dark`\r\n* `auto`\r\n* `high-contrast`"
                      },
                      "masterVolume": {
                        "type": "number",
                        "description": "Control the volume for all sounds coming from your workspace."
                      },
                      "alsoSendThreadToChannel": {
                        "type": "string",
                        "description": "When replying to a thread, select how your replies should be sent to the room:\r\n* `never`: Thread replies are not sent to the channel.\r\n* `always`: Thread replies are sent to the channel.\r\n* `default`: Defaults to the workspace settings set by the admin."
                      },
                      "desktopNotificationRequireInteraction": {
                        "type": "boolean",
                        "description": "When set to true, notifications will remain in the notification panel until they are visited or closed."
                      },
                      "showThreadsInMainChannel": {
                        "type": "boolean",
                        "description": "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": {
                        "type": "string",
                        "description": "Set the font size. The options are:\r\n* `small`\r\n* `medium`\r\n* `large`"
                      },
                      "receiveLoginDetectionEmail": {
                        "type": "boolean",
                        "description": "Set this option to true to get an email notification whenever a login is made to your account."
                      },
                      "omnichannelTranscriptPDF": {
                        "type": "boolean",
                        "description": "Set to true to always export the transcript as PDF at the end of Omnichannel conversations."
                      },
                      "omnichannelTranscriptEmail": {
                        "type": "boolean",
                        "description": "Set to true to always send the transcript to contacts at the end of conversations."
                      },
                      "omnichannelHideConversationAfterClosing": {
                        "type": "boolean",
                        "description": "Set to true to redirect agents to the home page after closing a conversation."
                      },
                      "enableMobileRinging": {
                        "type": "boolean",
                        "description": "If you are using the Rocket.Chat Voice feature, you can set this parameter to true for mobile call notifications."
                      }
                    }
                  }
                }
              },
              "examples": {
                "Example 1": {
                  "value": {
                    "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"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Users"
        ]
      }
    }
  },
  "components": {
    "responses": {
      "authorizationError": {
        "description": "Unauthorized",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "examples": {
              "Authorization Error": {
                "value": {
                  "status": "error",
                  "message": "You must be logged in to do this."
                }
              }
            }
          }
        }
      }
    },
    "parameters": {
      "UserId": {
        "name": "X-User-Id",
        "in": "header",
        "description": "The authenticated user ID.",
        "required": "true",
        "schema": {
          "type": "string"
        },
        "example": "rbAXPnMktTFbNpwtJ"
      },
      "Auth-Token": {
        "name": "X-Auth-Token",
        "in": "header",
        "description": "The authenticated user token.",
        "required": "true",
        "schema": {
          "type": "string"
        },
        "example": "RScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f"
      }
    }
  }
}
````

