PATCH /api/v2/custom_objects/{custom_object_key}/fields/{custom_object_field_key_or_id}
Updates individual custom object fields. The updating rules are as follows:
- Takes a
custom_object_fieldobject that specifies the properties to update. - The
keyproperty cannot be updated. - If updating a standard field, only the
title,description, andpropertiesattributes can be updated. - Standard name field is always required. Therefore, the
requiredproperty for standard name field isn't editable. - The
propertiesparameter is comprised of four parts and can't be changed if any records exist for the object.autoincrement_enabled: A Boolean that enables and disables autonumbering. Must be false if is_unique is true.autoincrement_prefix: A string value that is used as a prefix to the autogenerated numbers. It can't exceed 30 characters.autoincrement_padding: An integer specifying the starting number of digits in the autogenerated numbers. This value may be between 0-9. However, if you create records in excess of of these digits, additional digits are added as necessary.autoincrement_next_sequence: An integer that will be used as the next number in the autonumbering sequence. It can't be negative or less than the current autonumbering value.is_unique: A Boolean that enforces uniqueness for manually entered record names. When true, custom object record names must be unique. Must be false if autoincrement_enabled is true.
Updating drop-down field options
You can also use the update endpoint to add, update, or remove options in a drop-down custom field. Updating field options for multi-select fields works exactly the same as drop-down field options.
Important: Unless you want to remove some options, you must specify all existing options in any update request. Omitting an option removes it from the drop-down field, which removes its values from any tickets or macros.
Use the custom_field_options attribute to update the options. The attribute consists of an array of option objects, with each object consisting of an id, name, and value property. The name and value properties correspond to the "Title" and "Tag" text boxes in the admin interface respectively. For new drop-down options, specify "id":"null". Example request body:
{"custom_object_field": {
"custom_field_options": [
{"id": "null", "name": "Apple Pie", "value": "apple"},
{"id": "null", "name": "Pecan Pie", "value": "pecan"}
]
}
}
Example Request
curl https://{subdomain}.zendesk.com/api/v2/custom_objects/{custom_object_key}/fields/{custom_object_field_key_or_id}
-d '{"ticket_field": {"custom_field_options": [{"name": "Apple Pie", "value": "apple"}, {"name": "Pecan Pie", "value": "pecan"}]}}' \
-H "Content-Type: application/json" -X PUT \
-v -u {email_address}/token:{api_token}
Allowed For
- Admins
Servers
- https://{subdomain}.{domain}.com
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
custom_object_field_key_or_id |
String | Yes |
The key or id of a custom object field |
custom_object_key |
String | Yes |
The key of a custom object |
How to start integrating
- Add HTTP Task to your workflow definition.
- Search for the API you want to integrate with and click on the name.
- This loads the API reference documentation and prepares the Http request settings.
- Click Test request to test run your request to the API and see the API's response.