- Print
- DarkLight
- PDF
Update Setting
- Print
- DarkLight
- PDF
Permission required: edit-privileged-setting
The _id
of a setting is the first argument of the RocketChat.settings.add
method used in Rocket.Chat/packages/rocketchat-lib/server/startup/settings.js
(among other files).
For example, the following code in settings.js
file:
this.add('Accounts_AllowAnonymousRead', false, {
type: 'boolean',
public: true });
This means that the setting labeled Allow anonymous read
in the section Accounts
has _id
equal to Accounts_AllowAnonymousRead
. The second argument is the default value (false). The third argument specifies the variable's type and whether it is public, hidden, and so on.
To set a color, you can send:
{ value: '<color-code>',
editor: 'color' }
And also to trigger a action-button, use:
{ execute: true }
Changelog
Version | Description |
---|---|
0.65.0 | Added option to set a color and trigger an action |
0.42.0 | Added |
The user ID.
The authentication token.
The 2FA code from the authentication method. If the method is password, encrypt it as SHA256.
The desired method to get the 2FA code. It can be email
, totp
, or password
.
The unique ID of the setting that you want to update or fetch.
The value to update the setting.
The color code to update the setting.
The editor key, with color value. Required, if color was set.
To trigger a action-button.
OK
{
"success": true
}
Unauthorized
{
"status": "error",
"message": "You must be logged in to do this."
}