Update Setting
    • Dark
      Light
    • PDF

    Update Setting

    • Dark
      Light
    • PDF

    Article summary

    Post
    /api/v1/settings/{_id}

    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

    VersionDescription
    0.65.0Added option to set a color and trigger an action
    0.42.0Added
    Header parameters
    X-User-Id
    stringRequired

    The user ID.

    ExampleCkCPNctrgCDfmWLqC
    X-Auth-Token
    stringRequired

    The authentication token.

    Example1Dd4iN_ClKn5jl-xPC36snQ4s9Zd5GZnXCQuCNSKcVE
    X-2fa-Code
    stringRequired

    The 2FA code from the authentication method. If the method is password, encrypt it as SHA256.

    X-2fa-method
    stringRequired

    The desired method to get the 2FA code. It can be email, totp, or password.

    Path parameters
    _id
    stringRequired

    The unique ID of the setting that you want to update or fetch.

    Body parameters
    object
    value
    string Required

    The value to update the setting.

    color
    string

    The color code to update the setting.

    editor
    string

    The editor key, with color value. Required, if color was set.

    execute
    boolean

    To trigger a action-button.

    Responses
    200

    OK

    Success
    {
      "success": true
    }
    object
    success
    boolean
    401

    Unauthorized

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

    Was this article helpful?

    What's Next
    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.