Update a custom field
curl --request PATCH \
--url https://api.assembly.com/v1/custom-fields/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"entityType": "client",
"name": "Account tier",
"options": [
{
"label": "High priority",
"id": "option-f1a2b3c4-d5e6-47a8-9b0c-1d2e3f4a5b6c"
}
],
"type": "multiSelect"
}
'import requests
url = "https://api.assembly.com/v1/custom-fields/{id}"
payload = {
"entityType": "client",
"name": "Account tier",
"options": [
{
"label": "High priority",
"id": "option-f1a2b3c4-d5e6-47a8-9b0c-1d2e3f4a5b6c"
}
],
"type": "multiSelect"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
entityType: 'client',
name: 'Account tier',
options: [{label: 'High priority', id: 'option-f1a2b3c4-d5e6-47a8-9b0c-1d2e3f4a5b6c'}],
type: 'multiSelect'
})
};
fetch('https://api.assembly.com/v1/custom-fields/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.assembly.com/v1/custom-fields/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'entityType' => 'client',
'name' => 'Account tier',
'options' => [
[
'label' => 'High priority',
'id' => 'option-f1a2b3c4-d5e6-47a8-9b0c-1d2e3f4a5b6c'
]
],
'type' => 'multiSelect'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.assembly.com/v1/custom-fields/{id}"
payload := strings.NewReader("{\n \"entityType\": \"client\",\n \"name\": \"Account tier\",\n \"options\": [\n {\n \"label\": \"High priority\",\n \"id\": \"option-f1a2b3c4-d5e6-47a8-9b0c-1d2e3f4a5b6c\"\n }\n ],\n \"type\": \"multiSelect\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.assembly.com/v1/custom-fields/{id}")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"entityType\": \"client\",\n \"name\": \"Account tier\",\n \"options\": [\n {\n \"label\": \"High priority\",\n \"id\": \"option-f1a2b3c4-d5e6-47a8-9b0c-1d2e3f4a5b6c\"\n }\n ],\n \"type\": \"multiSelect\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.assembly.com/v1/custom-fields/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"entityType\": \"client\",\n \"name\": \"Account tier\",\n \"options\": [\n {\n \"label\": \"High priority\",\n \"id\": \"option-f1a2b3c4-d5e6-47a8-9b0c-1d2e3f4a5b6c\"\n }\n ],\n \"type\": \"multiSelect\"\n}"
response = http.request(request)
puts response.read_body{
"entityType": "client",
"id": "d8e8fca2-dc0f-4f3b-9a2e-1f6f3c2b7a10",
"key": "accountTier",
"name": "Account tier",
"object": "customField",
"options": [
{
"color": "rgba(204, 0, 0, 1)",
"id": "f1a2b3c4-d5e6-47a8-9b0c-1d2e3f4a5b6c",
"key": "highPriority",
"label": "High priority",
"object": "customFieldOption"
}
],
"order": 0,
"type": "multiSelect"
}{
"code": "<string>",
"data": "<unknown>",
"message": "<string>"
}{
"code": "<string>",
"data": "<unknown>",
"message": "<string>"
}{
"code": "<string>",
"data": "<unknown>",
"message": "<string>"
}{
"code": "<string>",
"data": "<unknown>",
"message": "<string>"
}Custom Fields
Update a custom field
Renames a custom field and/or replaces the option set of a multiSelect or select custom field. A custom field’s key, type, and entityType cannot be changed; supplying a type or entityType that differs from the field’s current value is rejected.
PATCH
/
v1
/
custom-fields
/
{id}
Update a custom field
curl --request PATCH \
--url https://api.assembly.com/v1/custom-fields/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"entityType": "client",
"name": "Account tier",
"options": [
{
"label": "High priority",
"id": "option-f1a2b3c4-d5e6-47a8-9b0c-1d2e3f4a5b6c"
}
],
"type": "multiSelect"
}
'import requests
url = "https://api.assembly.com/v1/custom-fields/{id}"
payload = {
"entityType": "client",
"name": "Account tier",
"options": [
{
"label": "High priority",
"id": "option-f1a2b3c4-d5e6-47a8-9b0c-1d2e3f4a5b6c"
}
],
"type": "multiSelect"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
entityType: 'client',
name: 'Account tier',
options: [{label: 'High priority', id: 'option-f1a2b3c4-d5e6-47a8-9b0c-1d2e3f4a5b6c'}],
type: 'multiSelect'
})
};
fetch('https://api.assembly.com/v1/custom-fields/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.assembly.com/v1/custom-fields/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'entityType' => 'client',
'name' => 'Account tier',
'options' => [
[
'label' => 'High priority',
'id' => 'option-f1a2b3c4-d5e6-47a8-9b0c-1d2e3f4a5b6c'
]
],
'type' => 'multiSelect'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.assembly.com/v1/custom-fields/{id}"
payload := strings.NewReader("{\n \"entityType\": \"client\",\n \"name\": \"Account tier\",\n \"options\": [\n {\n \"label\": \"High priority\",\n \"id\": \"option-f1a2b3c4-d5e6-47a8-9b0c-1d2e3f4a5b6c\"\n }\n ],\n \"type\": \"multiSelect\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.assembly.com/v1/custom-fields/{id}")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"entityType\": \"client\",\n \"name\": \"Account tier\",\n \"options\": [\n {\n \"label\": \"High priority\",\n \"id\": \"option-f1a2b3c4-d5e6-47a8-9b0c-1d2e3f4a5b6c\"\n }\n ],\n \"type\": \"multiSelect\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.assembly.com/v1/custom-fields/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"entityType\": \"client\",\n \"name\": \"Account tier\",\n \"options\": [\n {\n \"label\": \"High priority\",\n \"id\": \"option-f1a2b3c4-d5e6-47a8-9b0c-1d2e3f4a5b6c\"\n }\n ],\n \"type\": \"multiSelect\"\n}"
response = http.request(request)
puts response.read_body{
"entityType": "client",
"id": "d8e8fca2-dc0f-4f3b-9a2e-1f6f3c2b7a10",
"key": "accountTier",
"name": "Account tier",
"object": "customField",
"options": [
{
"color": "rgba(204, 0, 0, 1)",
"id": "f1a2b3c4-d5e6-47a8-9b0c-1d2e3f4a5b6c",
"key": "highPriority",
"label": "High priority",
"object": "customFieldOption"
}
],
"order": 0,
"type": "multiSelect"
}{
"code": "<string>",
"data": "<unknown>",
"message": "<string>"
}{
"code": "<string>",
"data": "<unknown>",
"message": "<string>"
}{
"code": "<string>",
"data": "<unknown>",
"message": "<string>"
}{
"code": "<string>",
"data": "<unknown>",
"message": "<string>"
}Body
application/json
Custom field updates
Response
OK