cURL
curl --request POST \
--url https://platform.thena.ai/v1/custom-field \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>",
"source": "<string>",
"fieldType": "<string>",
"isActive": true,
"description": "<string>",
"options": [
{
"value": "<string>"
}
],
"metadata": {},
"placeholderText": "<string>",
"hintText": "<string>",
"mandatoryOnClose": true,
"mandatoryOnCreation": true,
"visibleToCustomer": true,
"editableByCustomer": true,
"autoAddToAllForms": true,
"defaultValue": "<string>",
"teamId": "<string>",
"lookup": "<string>"
}
'import requests
url = "https://platform.thena.ai/v1/custom-field"
payload = {
"name": "<string>",
"source": "<string>",
"fieldType": "<string>",
"isActive": True,
"description": "<string>",
"options": [{ "value": "<string>" }],
"metadata": {},
"placeholderText": "<string>",
"hintText": "<string>",
"mandatoryOnClose": True,
"mandatoryOnCreation": True,
"visibleToCustomer": True,
"editableByCustomer": True,
"autoAddToAllForms": True,
"defaultValue": "<string>",
"teamId": "<string>",
"lookup": "<string>"
}
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({
name: '<string>',
source: '<string>',
fieldType: '<string>',
isActive: true,
description: '<string>',
options: [{value: '<string>'}],
metadata: {},
placeholderText: '<string>',
hintText: '<string>',
mandatoryOnClose: true,
mandatoryOnCreation: true,
visibleToCustomer: true,
editableByCustomer: true,
autoAddToAllForms: true,
defaultValue: '<string>',
teamId: '<string>',
lookup: '<string>'
})
};
fetch('https://platform.thena.ai/v1/custom-field', 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://platform.thena.ai/v1/custom-field",
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>',
'source' => '<string>',
'fieldType' => '<string>',
'isActive' => true,
'description' => '<string>',
'options' => [
[
'value' => '<string>'
]
],
'metadata' => [
],
'placeholderText' => '<string>',
'hintText' => '<string>',
'mandatoryOnClose' => true,
'mandatoryOnCreation' => true,
'visibleToCustomer' => true,
'editableByCustomer' => true,
'autoAddToAllForms' => true,
'defaultValue' => '<string>',
'teamId' => '<string>',
'lookup' => '<string>'
]),
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://platform.thena.ai/v1/custom-field"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"source\": \"<string>\",\n \"fieldType\": \"<string>\",\n \"isActive\": true,\n \"description\": \"<string>\",\n \"options\": [\n {\n \"value\": \"<string>\"\n }\n ],\n \"metadata\": {},\n \"placeholderText\": \"<string>\",\n \"hintText\": \"<string>\",\n \"mandatoryOnClose\": true,\n \"mandatoryOnCreation\": true,\n \"visibleToCustomer\": true,\n \"editableByCustomer\": true,\n \"autoAddToAllForms\": true,\n \"defaultValue\": \"<string>\",\n \"teamId\": \"<string>\",\n \"lookup\": \"<string>\"\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://platform.thena.ai/v1/custom-field")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"source\": \"<string>\",\n \"fieldType\": \"<string>\",\n \"isActive\": true,\n \"description\": \"<string>\",\n \"options\": [\n {\n \"value\": \"<string>\"\n }\n ],\n \"metadata\": {},\n \"placeholderText\": \"<string>\",\n \"hintText\": \"<string>\",\n \"mandatoryOnClose\": true,\n \"mandatoryOnCreation\": true,\n \"visibleToCustomer\": true,\n \"editableByCustomer\": true,\n \"autoAddToAllForms\": true,\n \"defaultValue\": \"<string>\",\n \"teamId\": \"<string>\",\n \"lookup\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform.thena.ai/v1/custom-field")
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 \"name\": \"<string>\",\n \"source\": \"<string>\",\n \"fieldType\": \"<string>\",\n \"isActive\": true,\n \"description\": \"<string>\",\n \"options\": [\n {\n \"value\": \"<string>\"\n }\n ],\n \"metadata\": {},\n \"placeholderText\": \"<string>\",\n \"hintText\": \"<string>\",\n \"mandatoryOnClose\": true,\n \"mandatoryOnCreation\": true,\n \"visibleToCustomer\": true,\n \"editableByCustomer\": true,\n \"autoAddToAllForms\": true,\n \"defaultValue\": \"<string>\",\n \"teamId\": \"<string>\",\n \"lookup\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"name": "<string>",
"uid": "<string>",
"slug": "<string>",
"organizationId": "<string>",
"options": [
"<string>"
],
"metadata": {},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"isActive": true,
"teamId": "<string>",
"autoAddToAllForms": true,
"hintText": "<string>",
"placeholderText": "<string>",
"mandatoryOnCreation": true,
"mandatoryOnClose": true,
"visibleToCustomer": true,
"editableByCustomer": true,
"defaultValue": "<string>"
},
"status": true,
"message": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}{
"message": "Custom field with name 'Priority Level' already exists in your organization",
"statusCode": 400,
"timestamp": "2024-01-15T10:30:00Z"
}{
"message": [
{
"property": "name",
"constraints": {
"isNotEmpty": "name should not be empty",
"matches": "name can only contain alphanumeric characters, spaces, hyphens, underscores, emojis, and common special characters"
}
},
{
"property": "source",
"constraints": {
"isEnum": "source must be one of the following values: ticket, account, custom_object"
}
},
{
"property": "fieldType",
"constraints": {
"isEnum": "fieldType must be one of the following values: single_line, multi_line, number, single_select, multi_select, date, time, datetime, boolean, email, url, phone, rich_text, lookup"
}
}
],
"error": "Validation Error",
"statusCode": 422
}Custom fields
Create a custom field
POST
/
v1
/
custom-field
cURL
curl --request POST \
--url https://platform.thena.ai/v1/custom-field \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>",
"source": "<string>",
"fieldType": "<string>",
"isActive": true,
"description": "<string>",
"options": [
{
"value": "<string>"
}
],
"metadata": {},
"placeholderText": "<string>",
"hintText": "<string>",
"mandatoryOnClose": true,
"mandatoryOnCreation": true,
"visibleToCustomer": true,
"editableByCustomer": true,
"autoAddToAllForms": true,
"defaultValue": "<string>",
"teamId": "<string>",
"lookup": "<string>"
}
'import requests
url = "https://platform.thena.ai/v1/custom-field"
payload = {
"name": "<string>",
"source": "<string>",
"fieldType": "<string>",
"isActive": True,
"description": "<string>",
"options": [{ "value": "<string>" }],
"metadata": {},
"placeholderText": "<string>",
"hintText": "<string>",
"mandatoryOnClose": True,
"mandatoryOnCreation": True,
"visibleToCustomer": True,
"editableByCustomer": True,
"autoAddToAllForms": True,
"defaultValue": "<string>",
"teamId": "<string>",
"lookup": "<string>"
}
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({
name: '<string>',
source: '<string>',
fieldType: '<string>',
isActive: true,
description: '<string>',
options: [{value: '<string>'}],
metadata: {},
placeholderText: '<string>',
hintText: '<string>',
mandatoryOnClose: true,
mandatoryOnCreation: true,
visibleToCustomer: true,
editableByCustomer: true,
autoAddToAllForms: true,
defaultValue: '<string>',
teamId: '<string>',
lookup: '<string>'
})
};
fetch('https://platform.thena.ai/v1/custom-field', 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://platform.thena.ai/v1/custom-field",
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>',
'source' => '<string>',
'fieldType' => '<string>',
'isActive' => true,
'description' => '<string>',
'options' => [
[
'value' => '<string>'
]
],
'metadata' => [
],
'placeholderText' => '<string>',
'hintText' => '<string>',
'mandatoryOnClose' => true,
'mandatoryOnCreation' => true,
'visibleToCustomer' => true,
'editableByCustomer' => true,
'autoAddToAllForms' => true,
'defaultValue' => '<string>',
'teamId' => '<string>',
'lookup' => '<string>'
]),
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://platform.thena.ai/v1/custom-field"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"source\": \"<string>\",\n \"fieldType\": \"<string>\",\n \"isActive\": true,\n \"description\": \"<string>\",\n \"options\": [\n {\n \"value\": \"<string>\"\n }\n ],\n \"metadata\": {},\n \"placeholderText\": \"<string>\",\n \"hintText\": \"<string>\",\n \"mandatoryOnClose\": true,\n \"mandatoryOnCreation\": true,\n \"visibleToCustomer\": true,\n \"editableByCustomer\": true,\n \"autoAddToAllForms\": true,\n \"defaultValue\": \"<string>\",\n \"teamId\": \"<string>\",\n \"lookup\": \"<string>\"\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://platform.thena.ai/v1/custom-field")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"source\": \"<string>\",\n \"fieldType\": \"<string>\",\n \"isActive\": true,\n \"description\": \"<string>\",\n \"options\": [\n {\n \"value\": \"<string>\"\n }\n ],\n \"metadata\": {},\n \"placeholderText\": \"<string>\",\n \"hintText\": \"<string>\",\n \"mandatoryOnClose\": true,\n \"mandatoryOnCreation\": true,\n \"visibleToCustomer\": true,\n \"editableByCustomer\": true,\n \"autoAddToAllForms\": true,\n \"defaultValue\": \"<string>\",\n \"teamId\": \"<string>\",\n \"lookup\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform.thena.ai/v1/custom-field")
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 \"name\": \"<string>\",\n \"source\": \"<string>\",\n \"fieldType\": \"<string>\",\n \"isActive\": true,\n \"description\": \"<string>\",\n \"options\": [\n {\n \"value\": \"<string>\"\n }\n ],\n \"metadata\": {},\n \"placeholderText\": \"<string>\",\n \"hintText\": \"<string>\",\n \"mandatoryOnClose\": true,\n \"mandatoryOnCreation\": true,\n \"visibleToCustomer\": true,\n \"editableByCustomer\": true,\n \"autoAddToAllForms\": true,\n \"defaultValue\": \"<string>\",\n \"teamId\": \"<string>\",\n \"lookup\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"name": "<string>",
"uid": "<string>",
"slug": "<string>",
"organizationId": "<string>",
"options": [
"<string>"
],
"metadata": {},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"isActive": true,
"teamId": "<string>",
"autoAddToAllForms": true,
"hintText": "<string>",
"placeholderText": "<string>",
"mandatoryOnCreation": true,
"mandatoryOnClose": true,
"visibleToCustomer": true,
"editableByCustomer": true,
"defaultValue": "<string>"
},
"status": true,
"message": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}{
"message": "Custom field with name 'Priority Level' already exists in your organization",
"statusCode": 400,
"timestamp": "2024-01-15T10:30:00Z"
}{
"message": [
{
"property": "name",
"constraints": {
"isNotEmpty": "name should not be empty",
"matches": "name can only contain alphanumeric characters, spaces, hyphens, underscores, emojis, and common special characters"
}
},
{
"property": "source",
"constraints": {
"isEnum": "source must be one of the following values: ticket, account, custom_object"
}
},
{
"property": "fieldType",
"constraints": {
"isEnum": "fieldType must be one of the following values: single_line, multi_line, number, single_select, multi_select, date, time, datetime, boolean, email, url, phone, rich_text, lookup"
}
}
],
"error": "Validation Error",
"statusCode": 422
}Authorizations
Enter your API key
Body
application/json
The name of the custom field
The source of the custom field
The type of the custom field
Whether the custom field is active
The description of the custom field
The options of the custom field. Each option should be an object with 'value' property
Show child attributes
Show child attributes
The metadata of the custom field
The placeholder text of the custom field
The hint text of the custom field
Whether the custom field is mandatory on close
Whether the custom field is mandatory on creation
Whether the custom field is visible to customer
Whether the custom field is editable by customer
Whether the custom field is auto added to all forms
The default value of the custom field
The team id of the custom field
The lookup object id or thena entity name
⌘I