Deactivate a user

This endpoint is only available to organization administrators.

Deactivates a user given their user ID.

DELETE https://rust-lang.zulipchat.com/api/v1/users/{user_id}

Usage examples

#!/usr/bin/env python3

import zulip

# Pass the path to your zuliprc file here.
client = zulip.Client(config_file="~/zuliprc")

# Deactivate a user
user_id = 8
url = 'users/' + str(user_id)
result = client.call_endpoint(
    url=url,
    method='DELETE',
)
print(result)

curl -sSX DELETE https://rust-lang.zulipchat.com/api/v1/users/11 \
    -u BOT_EMAIL_ADDRESS:BOT_API_KEY

Arguments

user_id required

Example: 11

The user id of the user.


Response

Example response

A typical successful JSON response may look like:

{
    "msg": "",
    "result": "success"
}

An example JSON error response when attempting to deactivate the only organization administrator:

{
    "msg": "Cannot deactivate the only organization administrator",
    "result": "error"
}