Update User

This endpoint is only available to organization administrators.

Administrative endpoint to update the details of another user in the organization.

PATCH https://quarkusio.zulipchat.com/api/v1/users/{user_id}

Supports everything an administrator can do to edit details of another user's account, including editing full name, role, and custom profile fields.

Usage examples

#!/usr/bin/env python3

import zulip

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

# Change a user's full name.
user_id = 10
full_name = "New Name"
url = 'users/' + str(user_id)
result = client.call_endpoint(
    request={'full_name': json.dumps(full_name)}
# Change value of the custom profile field with ID 9.
user_id = 8
profile_data = [{'id': 9, 'value': 'some data'}]
url = 'users/' + str(user_id)
result = client.call_endpoint(
    request={'profile_data': json.dumps(profile_data)}

curl -sSX PATCH https://quarkusio.zulipchat.com/api/v1/users/11 \
    -d 'full_name="NewName"' \
    -d 'is_admin=false' \
    -d 'is_guest=true' \
    --data-urlencode profile_data='[{"id": 4, "value": "vim"}, {"id": 5, "value": "1909-04-05"}]'


user_id required

Example: 11

The target user's ID.

full_name optional

Example: "NewName"

The user's full name.

is_admin optional

Example: false

Whether the target user is an administrator.

is_guest optional

Example: true

Whether the target user is a guest.

profile_data optional

Example: [{"id": 4, "value": "vim"}, {"id": 5, "value": "1909-04-05"}]

A dictionary containing the to be updated custom profile field data for the user.


Example response

A typical successful JSON response may look like:

    "msg": "",
    "result": "success"

A typical unsuccessful JSON response:

    "code": "BAD_REQUEST",
    "msg": "Guests cannot be organization administrators",
    "result": "error"