Deactivate a User
Confused about "Deactivate a User"?
Let us know how we can improve our documentation:
To deactivate a user, Stream Chat exposes a
deactivateUser method. This method can only be called server-side due to security concerns, so please keep this in mind when attempting to make the call.
Below is an example of how to execute the call to
1const deactivate = await client.deactivateUser('user_id');
1response = client.deactivate_user("user_id")
1response = @client.deactivate_user('user_id')
1$response = $this->client->deactivateUser($user["id"]);
1result = await this._endpoint.Deactivate([user.ID]);
The response will contain an object with the user ID that was deactivated. Further, the user will no longer be able to connect to Stream Chat as an error will be thrown.
To reinstate the user as active, use the
reactivateUser method by passing the users ID as a parameter:
1const reactivate = await client.reactivateUser('user_id');
1response = client.reactivate_user("user_id")
1response = @client.reactivate_user('user_id')
1$response = $this->client->reactivateUser($user["id"]);
1result = await this._endpoint.Reactivate([user.ID]);