Use this endpoint to update an existing custom field. You can update a field's name and/or description. The field_type cannot be changed after creation.
Endpoint
PATCH https://e1.envoke.com/v2/customfields/{ID}Replace {ID} with the Envoke custom field ID you want to update. Authentication is via HTTP Basic Auth using your API ID and API Key. The request body must be JSON.
Request Body
Field | Type | Description |
| string | New name for the field. Alphanumeric characters and underscores only. Must be unique per account. |
| string | New description for the field. Pass an empty string ( |
At least one of name or description must be provided.
Note: field_type is read-only and cannot be included in an update request. Attempting to change it will return a validation error. If id is included in the request body, it must match the {ID} in the URL β if they differ, a validation error is returned: "Provided 'id': {url_id} does not match 'id' in request body ({body_id})".
Response
On success, the API returns the updated custom field object:
{ "success": true, "result_text": "Updated", "result_data": { "id": "42", "name": "mobile_number", "description": "Customer's mobile phone number", "field_type": "text" } }Validation Errors
If the request is invalid, the API returns a 400 response with an errors array:
{ "success": false, "result_text": "Validation failed, see 'result_data' -> 'errors'", "result_data": { "errors": [ "The field 'field_type' cannot be changed after creation" ] } }Common errors:
Error | Cause |
| No JSON body was provided. |
|
|
| New |
| The new |
| The |
|
|
Examples
Update a field's description
curl -X PATCH -gs \ -u "$API_ID:$API_KEY" \ -H "Content-Type: application/json" \ -d '{"description": "Customer primary mobile number"}' \ "https://e1.envoke.com/v2/customfields/42"Rename a field
curl -X PATCH -gs \ -u "$API_ID:$API_KEY" \ -H "Content-Type: application/json" \ -d '{"name": "mobile_number"}' \ "https://e1.envoke.com/v2/customfields/42"Update both name and description
curl -X PATCH -gs \ -u "$API_ID:$API_KEY" \ -H "Content-Type: application/json" \ -d '{"name": "mobile_number", "description": "Customer primary mobile number"}' \ "https://e1.envoke.com/v2/customfields/42"Clear a field's description
curl -X PATCH -gs \ -u "$API_ID:$API_KEY" \ -H "Content-Type: application/json" \ -d '{"description": ""}' \ "https://e1.envoke.com/v2/customfields/42"Note: The curl examples above are formatted for readability. All requests must use properly encoded URLs.
For code examples and interactive testing, visit api.envoke.com.
