Activate or deactivate a user in the workspace.
Permission required: edit-other-user-active-status
When a user is deactivated (activeStatus=false), Rocket.Chat revokes all of the user's login tokens and OAuth access tokens, refresh tokens, and authorization codes. The user can no longer call the REST API with previously issued OAuth credentials.
Changelog
| Version | Description |
|---|---|
| 8.5.0 | Deactivation now also revokes the user's OAuth access tokens, refresh tokens, and authorization codes. |
| 3.7.0 | Added confirmRelinquish to the payload. |
| 0.75.0 | Added |
The authenticated user ID.
The authenticated user token.
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.
The value of the active status.
The user ID whose status value is to be changed.
Allows the user to be deactivated even if it is the last owner of a room. 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.
{
"user": {
"_id": "jJNyu4BQFqdgEcqnR",
"active": false
},
"success": true
}Bad Request
{
"success": false,
"error": "must have required property 'activeStatus'\n[invalid-params]",
"errorType": "invalid-params"
}Unauthorized
{
"status": "error",
"message": "You must be logged in to do this."
}