Set User's Status Active

HTTP MethodURLRequires Auth

POST

/api/v1/users.setActiveStatus

Permissions required:

  • edit-other-user-active-status

  • manage-moderation-actions

Body Parameters

KeyExample ValueDescription

activeStatus*

true

The value of the active status.

userId*

5HmCfpoB7jp2uibTC

The user ID whose status value is to be changed.

confirmRelinquish

true

Allows the user to be deactivated even if it is the last owner of a room. By default, the value is false.

If activeStatus=false & confirmRelinquish=true and the user is the last remaining owner of a room, the oldest member of that room will be chosen as the new owner.

Example call

curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
     -H "X-User-Id: aobEdbYhXfu5hkeqG" \
     -H "Content-type:application/json" \
     http://localhost:3000/api/v1/users.setActiveStatus \
     -d '{
          "activeStatus": false, 
          "userId": "5HmCfpoB7jp2uibTC"}'

Example Response

{
    "user": {
        "_id": "jJNyu4BQFqdgEcqnR",
        "active": false
    },
    "success": true
}

Change Log

VersionDescription

3.7.0

Added confirmRelinquish to the payload.

0.75.0

Added.

Last updated

Rocket.Chat versions receive support for six months after release.