Delete a custom profile field

This endpoint is only available to organization administrators.

DELETE https://chat.dispatchbutler.com/api/v1/realm/profile_fields/{field_id}

Delete a custom profile field in the user's organization.

This will also permanently delete any value configured for the custom profile field from every user profile in the database. Therefore, it's recommended that clients warn the active user of the related data removal before submitting the request, e.g., notify them of how many users will have their profile data deleted as a result of deleting the custom profile field.

Usage examples

#!/usr/bin/env python

import zulip

# The user for this zuliprc file must be an organization administrator
client = zulip.Client(config_file="~/zuliprc-admin")

# Delete a custom profile field in the user's organization.
result = client.call_endpoint(url=f"/realm/profile_fields/{field_id}", method="DELETE")
print(result)

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 DELETE https://chat.dispatchbutler.com/api/v1/realm/profile_fields/4 \
    -u EMAIL_ADDRESS:API_KEY

Parameters

field_id integer required in path

Example: 4

The ID of the target 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"
}

A typical failed JSON response for when there is no custom profile field with the requested ID:

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