Create a custom field definition
curl --request POST \
--url https://api.algosmiths.com/api/v1/custom-fields/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"label": "<string>",
"options": "<unknown>",
"position": 1073741823
}
'import requests
url = "https://api.algosmiths.com/api/v1/custom-fields/"
payload = {
"name": "<string>",
"label": "<string>",
"options": "<unknown>",
"position": 1073741823
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
label: '<string>',
options: '<unknown>',
position: 1073741823
})
};
fetch('https://api.algosmiths.com/api/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.algosmiths.com/api/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([
'name' => '<string>',
'label' => '<string>',
'options' => '<unknown>',
'position' => 1073741823
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.algosmiths.com/api/v1/custom-fields/"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"label\": \"<string>\",\n \"options\": \"<unknown>\",\n \"position\": 1073741823\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.algosmiths.com/api/v1/custom-fields/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"label\": \"<string>\",\n \"options\": \"<unknown>\",\n \"position\": 1073741823\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.algosmiths.com/api/v1/custom-fields/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"label\": \"<string>\",\n \"options\": \"<unknown>\",\n \"position\": 1073741823\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"name": "<string>",
"label": "<string>",
"field_type": "text",
"created_at": "2023-11-07T05:31:56Z",
"applies_to": "contact",
"options": "<unknown>",
"position": 1073741823
}{}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Custom Fields
Create a custom field definition
Custom Contact/Conversation attribute schema — CRM.md § Custom fields. Not ticketing-gated; reuses the contact.view/contact.edit scopes like ContactListView.
POST
/
api
/
v1
/
custom-fields
/
Create a custom field definition
curl --request POST \
--url https://api.algosmiths.com/api/v1/custom-fields/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"label": "<string>",
"options": "<unknown>",
"position": 1073741823
}
'import requests
url = "https://api.algosmiths.com/api/v1/custom-fields/"
payload = {
"name": "<string>",
"label": "<string>",
"options": "<unknown>",
"position": 1073741823
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
label: '<string>',
options: '<unknown>',
position: 1073741823
})
};
fetch('https://api.algosmiths.com/api/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.algosmiths.com/api/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([
'name' => '<string>',
'label' => '<string>',
'options' => '<unknown>',
'position' => 1073741823
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.algosmiths.com/api/v1/custom-fields/"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"label\": \"<string>\",\n \"options\": \"<unknown>\",\n \"position\": 1073741823\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.algosmiths.com/api/v1/custom-fields/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"label\": \"<string>\",\n \"options\": \"<unknown>\",\n \"position\": 1073741823\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.algosmiths.com/api/v1/custom-fields/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"label\": \"<string>\",\n \"options\": \"<unknown>\",\n \"position\": 1073741823\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"name": "<string>",
"label": "<string>",
"field_type": "text",
"created_at": "2023-11-07T05:31:56Z",
"applies_to": "contact",
"options": "<unknown>",
"position": 1073741823
}{}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
ApiKeyAuthtokenAuthCookieAuth
Workspace API key, e.g. Authorization: Bearer cb_live_.... Create one in Settings → API Keys. See public_api.md § 3 for scopes.
Body
application/jsonapplication/x-www-form-urlencodedmultipart/form-data
Used for both create (data=...) and update (instance, data=..., partial=True)
— see _create_custom_field_definition_for_workspace/_update_..._for_workspace,
mirroring TicketPipelineCreateSerializer. partial=True already relaxes
required-ness for updates, so no per-field extra_kwargs needed.
Required string length:
1 - 100Pattern:
^[-a-zA-Z0-9_]+$Required string length:
1 - 255text- Textnumber- Numberboolean- Booleandate- Dateselect- Selectmulti_select- Multi-select
Available options:
text, number, boolean, date, select, multi_select contact- Contactconversation- Conversationboth- Both
Available options:
contact, conversation, both Required range:
0 <= x <= 2147483647Response
Maximum string length:
100Pattern:
^[-a-zA-Z0-9_]+$Maximum string length:
255text- Textnumber- Numberboolean- Booleandate- Dateselect- Selectmulti_select- Multi-select
Available options:
text, number, boolean, date, select, multi_select contact- Contactconversation- Conversationboth- Both
Available options:
contact, conversation, both Required range:
0 <= x <= 2147483647
