Update your profile data

PATCH https://chat.zulip.org/api/v1/users/me/profile_data

Update the current user's profile data for one or more of the custom profile fields configured in the organization.

Usage examples

The -u line implements HTTP Basic authentication. See the Authorization header documentation for how to get those credentials for Zulip users and bots.

curl -sSX PATCH https://chat.zulip.org/api/v1/users/me/profile_data \
    -u EMAIL_ADDRESS:API_KEY \
    --data-urlencode 'data=[{"id": 4, "value": "0"}, {"id": 5, "value": "1909-04-05"}]'

Parameters

data (object)[] required

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

An array of objects describing updates to the custom profile field data for the user.

data object details:

  • id: integer required

    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:

    1. 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.

    2. An array of integer user IDs, which is for the Users type of custom profile field.


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"
}

An example JSON error response when editing custom profile fields is restricted in the organization:

{
    "code": "BAD_REQUEST",
    "msg": "You are not allowed to change this field. Contact an administrator to update it.",
    "result": "error"
}

An example JSON error response when a custom profile field ID does not exist:

{
    "code": "BAD_REQUEST",
    "msg": "Field id 99 not found.",
    "result": "error"
}