Set or clear a custom field value
Request to update the values for call custom fields:
PUT /api/v2/calls/<call-id>.json
The custom field can be identified by either its field_id
or name
.
Update custom field by ID
HTTP body should contain JSON formatted fields that must be updated.
For example:
{
"call" {
"custom_fields": [
{
"field_id": "138fb20c-4c3b-11ee-8cbb-0015172d2a7d",
"value": "Unknown"
},
{
"field_id": "9079d60a-5192-11ee-aa89-0015172d2a7d",
"value": "Sales call"
},
]
}
}
Update custom field by ID
HTTP body should contain JSON formatted fields that must be updated.
For example:
{
"call" {
"custom_fields": [
{
"name": "Payment status",
"value": "Unknown"
},
{
"name": "Call type",
"value": "Sales call"
},
]
}
}
If both field_id
and name
are supplied in the JSON body request, then name
is ignored.
Prerequisites
- REST API user must have permission Edit for the corresponding call record.
- Custom field must be configured as Editable by administrator
How to clear a custom field value?
Note, this request will update only the custom fields that are listed in the JSON body. Any existing custom fields, that the call record has, but which are not listed in the PUT request, will not be affected.
To remove the value for custom fields, set it to null or empty string, like:
{
"call" {
"custom_fields": [
{
"field_id": "138fb20c-4c3b-11ee-8cbb-0015172d2a7d",
"name": "Payment status",
"value": null
}
]
}
}
Responses
Response contains HTTP status code as shown in the following list.
- 200 OK
-
Call record has been successfully updated.
A response contains a JSON formatted call's data after update.
- 403 Forbidden
-
The request cannot be completed because API user has no permission to update call records
- 400 Bad Request
-
The request cannot be completed because supplied JSON object has invalid data.
When response has content type
application/json
, then it contains more detailed description of error in JSON format like:``` { "error": "InvalidRecord", "description": "Record Validation errors", "details": { "custom_fields.0.value": "Value is too long" } }