Create custom fields
curl --request POST \
--url https://api.assembly.com/v1/custom-fields \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"customFields": [
{
"entityType": "client",
"name": "Account tier",
"type": "multiSelect",
"options": [
{
"label": "High priority"
}
]
}
]
}
'import requests
url = "https://api.assembly.com/v1/custom-fields"
payload = { "customFields": [
{
"entityType": "client",
"name": "Account tier",
"type": "multiSelect",
"options": [{ "label": "High priority" }]
}
] }
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customFields: [
{
entityType: 'client',
name: 'Account tier',
type: 'multiSelect',
options: [{label: 'High priority'}]
}
]
})
};
fetch('https://api.assembly.com/v1/custom-fields', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'customFields' => [
[
'entityType' => 'client',
'name' => 'Account tier',
'type' => 'multiSelect',
'options' => [
[
'label' => 'High priority'
]
]
]
]
]),
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"
payload := strings.NewReader("{\n \"customFields\": [\n {\n \"entityType\": \"client\",\n \"name\": \"Account tier\",\n \"type\": \"multiSelect\",\n \"options\": [\n {\n \"label\": \"High priority\"\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.assembly.com/v1/custom-fields")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"customFields\": [\n {\n \"entityType\": \"client\",\n \"name\": \"Account tier\",\n \"type\": \"multiSelect\",\n \"options\": [\n {\n \"label\": \"High priority\"\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.assembly.com/v1/custom-fields")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customFields\": [\n {\n \"entityType\": \"client\",\n \"name\": \"Account tier\",\n \"type\": \"multiSelect\",\n \"options\": [\n {\n \"label\": \"High priority\"\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"customFields": [
{
"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>"
}Custom Fields
Create custom fields
Creates one or more custom fields for the portal. Each field requires a name, a type, and the entity it belongs to. Options may only be supplied for multi-select fields.
POST
/
v1
/
custom-fields
Create custom fields
curl --request POST \
--url https://api.assembly.com/v1/custom-fields \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"customFields": [
{
"entityType": "client",
"name": "Account tier",
"type": "multiSelect",
"options": [
{
"label": "High priority"
}
]
}
]
}
'import requests
url = "https://api.assembly.com/v1/custom-fields"
payload = { "customFields": [
{
"entityType": "client",
"name": "Account tier",
"type": "multiSelect",
"options": [{ "label": "High priority" }]
}
] }
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customFields: [
{
entityType: 'client',
name: 'Account tier',
type: 'multiSelect',
options: [{label: 'High priority'}]
}
]
})
};
fetch('https://api.assembly.com/v1/custom-fields', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'customFields' => [
[
'entityType' => 'client',
'name' => 'Account tier',
'type' => 'multiSelect',
'options' => [
[
'label' => 'High priority'
]
]
]
]
]),
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"
payload := strings.NewReader("{\n \"customFields\": [\n {\n \"entityType\": \"client\",\n \"name\": \"Account tier\",\n \"type\": \"multiSelect\",\n \"options\": [\n {\n \"label\": \"High priority\"\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.assembly.com/v1/custom-fields")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"customFields\": [\n {\n \"entityType\": \"client\",\n \"name\": \"Account tier\",\n \"type\": \"multiSelect\",\n \"options\": [\n {\n \"label\": \"High priority\"\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.assembly.com/v1/custom-fields")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customFields\": [\n {\n \"entityType\": \"client\",\n \"name\": \"Account tier\",\n \"type\": \"multiSelect\",\n \"options\": [\n {\n \"label\": \"High priority\"\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"customFields": [
{
"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>"
}Authorizations
Body
application/json
Custom fields to create
CustomFields is the list of custom fields to create; must contain at least one entry.
Show child attributes
Show child attributes
Response
OK
CustomFields are the custom fields that were created.
Show child attributes
Show child attributes
⌘I