Update Permissions

Prev Next
Post
/api/v1/permissions.update

Update the permissions on the workspace. Permission required: access-permissions

Changelog

Version Description
0.66.0 Added
Header parameters
X-User-Id
stringRequired

The authenticated user ID.

ExamplerbAXPnMktTFbNpwtJ
X-Auth-Token
stringRequired

The authenticated user token.

ExampleRScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f
Body parameters
Example 1
{
  "permissions": [
    {
      "_id": "access-permissions",
      "roles": [
        "admin"
      ]
    }
  ]
}
Expand All
object
permissions
Array of object Required

The array of roles to overwrite.

object
_id
string

Enter the permission ID.

Exampleaccess-permissions
roles
Array of string
string

For default Rocket.Chat roles, you can enter the role names such as admin, user, owner, etc. If you are updating the permissions for a custom role, enter the custom role ID instead of the role name. Use the Get Roles endpoint to get the list of roles with IDs in your workspace.

Exampleadmin
Responses
200

OK

Success Example
{
  "permissions": [
    {
      "_id": "access-permissions",
      "roles": [
        "admin"
      ]
    }
  ],
  "success": true
}
Expand All
object
permissions
Array of object
object
_id
string
roles
Array of string
string
success
boolean
400

Bad Request

Example 1
{
  "success": false,
  "error": "Invalid body params",
  "errorType": "error-invalid-body-params"
}
Example 2
{
  "success": false,
  "error": "Editing permissions is not allowed",
  "errorType": "error-edit-permissions-not-allowed"
}
object
success
boolean
error
string
errorType
string
401

Unauthorized

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