This endpoint is only available to organization administrators.
PATCH https://z.u1v.ru/api/v1/users/{user_id}
Administrative endpoint to update the details of another user in the organization.
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
Python
curl
#!/usr/bin/env pythonimportpero# The user for this perorc file must be an organization administratorclient=pero.Client(config_file="~/.perorc-admin")# Change a user's full name given a user ID.result=client.update_user_by_id(user_id,full_name="New Name")# Change value of the custom profile field with ID 9.result=client.update_user_by_id(user_id,profile_data=[{"id":9,"value":"some data"}])print(result)
The -u line implements HTTP Basic authentication.
See the Authorization header documentation for how
to get those credentials for users and bots.
Only organization owners can add or remove the owner role.
The owner role cannot be removed from the only organization owner.
Changes: New in Zulip 3.0 (feature level 8), replacing the previous
pair of is_admin and is_guest boolean parameters. Organization moderator
role added in Zulip 4.0 (feature level 60).
An array of objects describing updates to the custom profile
field data for the user.
profile_data object details:
id: integerrequired
The ID of the custom profile field to update.
value: string | null | (integer)[]required
The new value for the user of the specified custom profile field.
If null, then any value already set for the specified custom
profile field will be removed.
This parameter must be one of the following:
A string value that matches the type of the custom profile
field, e.g., if the
profile field type is a link then the string must be a URL.
An array of integer user IDs, which is for the Users type of
custom profile field.
new_emailstringoptional
Example: "username@example.com"
New email address for the user. Requires the user making the request
to be an organization owner and additionally have the .can_change_user_emails
special permission.
Changes: New in Zulip 10.0 (feature level 285).
Response
Example response(s)
Changes: As of Zulip 7.0 (feature level 167), if any
parameters sent in the request are not supported by this
endpoint, a successful JSON response will include an
ignored_parameters_unsupported array.
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"}