curl --request PATCH \
--url https://{your-subdomain}.neetodesk.com/api/external/v2/fields/{field_id} \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <x-api-key>' \
--data '
{
"field": {
"name": "Browser used",
"state": "inactive",
"data": [
{
"label": "Chromium",
"id": "aaaabbbb-cccc-dddd-eeee-ffff00004444"
}
],
"remove_option_ids": [
"aaaabbbb-cccc-dddd-eeee-ffff00005555"
],
"is_required": false,
"is_required_for_agent_when_submitting_form": false,
"is_required_for_agent_when_closing_ticket": false,
"display_order": 3,
"placeholder_slug": "browser"
}
}
'import requests
url = "https://{your-subdomain}.neetodesk.com/api/external/v2/fields/{field_id}"
payload = { "field": {
"name": "Browser used",
"state": "inactive",
"data": [
{
"label": "Chromium",
"id": "aaaabbbb-cccc-dddd-eeee-ffff00004444"
}
],
"remove_option_ids": ["aaaabbbb-cccc-dddd-eeee-ffff00005555"],
"is_required": False,
"is_required_for_agent_when_submitting_form": False,
"is_required_for_agent_when_closing_ticket": False,
"display_order": 3,
"placeholder_slug": "browser"
} }
headers = {
"X-Api-Key": "<x-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': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
field: {
name: 'Browser used',
state: 'inactive',
data: [{label: 'Chromium', id: 'aaaabbbb-cccc-dddd-eeee-ffff00004444'}],
remove_option_ids: ['aaaabbbb-cccc-dddd-eeee-ffff00005555'],
is_required: false,
is_required_for_agent_when_submitting_form: false,
is_required_for_agent_when_closing_ticket: false,
display_order: 3,
placeholder_slug: 'browser'
}
})
};
fetch('https://{your-subdomain}.neetodesk.com/api/external/v2/fields/{field_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://{your-subdomain}.neetodesk.com/api/external/v2/fields/{field_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([
'field' => [
'name' => 'Browser used',
'state' => 'inactive',
'data' => [
[
'label' => 'Chromium',
'id' => 'aaaabbbb-cccc-dddd-eeee-ffff00004444'
]
],
'remove_option_ids' => [
'aaaabbbb-cccc-dddd-eeee-ffff00005555'
],
'is_required' => false,
'is_required_for_agent_when_submitting_form' => false,
'is_required_for_agent_when_closing_ticket' => false,
'display_order' => 3,
'placeholder_slug' => 'browser'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <x-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://{your-subdomain}.neetodesk.com/api/external/v2/fields/{field_id}"
payload := strings.NewReader("{\n \"field\": {\n \"name\": \"Browser used\",\n \"state\": \"inactive\",\n \"data\": [\n {\n \"label\": \"Chromium\",\n \"id\": \"aaaabbbb-cccc-dddd-eeee-ffff00004444\"\n }\n ],\n \"remove_option_ids\": [\n \"aaaabbbb-cccc-dddd-eeee-ffff00005555\"\n ],\n \"is_required\": false,\n \"is_required_for_agent_when_submitting_form\": false,\n \"is_required_for_agent_when_closing_ticket\": false,\n \"display_order\": 3,\n \"placeholder_slug\": \"browser\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Api-Key", "<x-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://{your-subdomain}.neetodesk.com/api/external/v2/fields/{field_id}")
.header("X-Api-Key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"field\": {\n \"name\": \"Browser used\",\n \"state\": \"inactive\",\n \"data\": [\n {\n \"label\": \"Chromium\",\n \"id\": \"aaaabbbb-cccc-dddd-eeee-ffff00004444\"\n }\n ],\n \"remove_option_ids\": [\n \"aaaabbbb-cccc-dddd-eeee-ffff00005555\"\n ],\n \"is_required\": false,\n \"is_required_for_agent_when_submitting_form\": false,\n \"is_required_for_agent_when_closing_ticket\": false,\n \"display_order\": 3,\n \"placeholder_slug\": \"browser\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{your-subdomain}.neetodesk.com/api/external/v2/fields/{field_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Api-Key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"field\": {\n \"name\": \"Browser used\",\n \"state\": \"inactive\",\n \"data\": [\n {\n \"label\": \"Chromium\",\n \"id\": \"aaaabbbb-cccc-dddd-eeee-ffff00004444\"\n }\n ],\n \"remove_option_ids\": [\n \"aaaabbbb-cccc-dddd-eeee-ffff00005555\"\n ],\n \"is_required\": false,\n \"is_required_for_agent_when_submitting_form\": false,\n \"is_required_for_agent_when_closing_ticket\": false,\n \"display_order\": 3,\n \"placeholder_slug\": \"browser\"\n }\n}"
response = http.request(request)
puts response.read_body{
"field": {
"id": "aaaabbbb-cccc-dddd-eeee-ffff00003333",
"name": "Browser",
"kind": "single_option",
"state": "active",
"resource_type": "ticket",
"is_required": false,
"is_required_for_agent_when_submitting_form": false,
"is_required_for_agent_when_closing_ticket": false,
"display_order": 3,
"placeholder_slug": "browser",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"options": [
{
"id": "aaaabbbb-cccc-dddd-eeee-ffff00004444",
"label": "Chrome",
"display_order": 0
}
]
}
}Update ticket field
Updates a custom ticket field.
curl --request PATCH \
--url https://{your-subdomain}.neetodesk.com/api/external/v2/fields/{field_id} \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <x-api-key>' \
--data '
{
"field": {
"name": "Browser used",
"state": "inactive",
"data": [
{
"label": "Chromium",
"id": "aaaabbbb-cccc-dddd-eeee-ffff00004444"
}
],
"remove_option_ids": [
"aaaabbbb-cccc-dddd-eeee-ffff00005555"
],
"is_required": false,
"is_required_for_agent_when_submitting_form": false,
"is_required_for_agent_when_closing_ticket": false,
"display_order": 3,
"placeholder_slug": "browser"
}
}
'import requests
url = "https://{your-subdomain}.neetodesk.com/api/external/v2/fields/{field_id}"
payload = { "field": {
"name": "Browser used",
"state": "inactive",
"data": [
{
"label": "Chromium",
"id": "aaaabbbb-cccc-dddd-eeee-ffff00004444"
}
],
"remove_option_ids": ["aaaabbbb-cccc-dddd-eeee-ffff00005555"],
"is_required": False,
"is_required_for_agent_when_submitting_form": False,
"is_required_for_agent_when_closing_ticket": False,
"display_order": 3,
"placeholder_slug": "browser"
} }
headers = {
"X-Api-Key": "<x-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': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
field: {
name: 'Browser used',
state: 'inactive',
data: [{label: 'Chromium', id: 'aaaabbbb-cccc-dddd-eeee-ffff00004444'}],
remove_option_ids: ['aaaabbbb-cccc-dddd-eeee-ffff00005555'],
is_required: false,
is_required_for_agent_when_submitting_form: false,
is_required_for_agent_when_closing_ticket: false,
display_order: 3,
placeholder_slug: 'browser'
}
})
};
fetch('https://{your-subdomain}.neetodesk.com/api/external/v2/fields/{field_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://{your-subdomain}.neetodesk.com/api/external/v2/fields/{field_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([
'field' => [
'name' => 'Browser used',
'state' => 'inactive',
'data' => [
[
'label' => 'Chromium',
'id' => 'aaaabbbb-cccc-dddd-eeee-ffff00004444'
]
],
'remove_option_ids' => [
'aaaabbbb-cccc-dddd-eeee-ffff00005555'
],
'is_required' => false,
'is_required_for_agent_when_submitting_form' => false,
'is_required_for_agent_when_closing_ticket' => false,
'display_order' => 3,
'placeholder_slug' => 'browser'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <x-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://{your-subdomain}.neetodesk.com/api/external/v2/fields/{field_id}"
payload := strings.NewReader("{\n \"field\": {\n \"name\": \"Browser used\",\n \"state\": \"inactive\",\n \"data\": [\n {\n \"label\": \"Chromium\",\n \"id\": \"aaaabbbb-cccc-dddd-eeee-ffff00004444\"\n }\n ],\n \"remove_option_ids\": [\n \"aaaabbbb-cccc-dddd-eeee-ffff00005555\"\n ],\n \"is_required\": false,\n \"is_required_for_agent_when_submitting_form\": false,\n \"is_required_for_agent_when_closing_ticket\": false,\n \"display_order\": 3,\n \"placeholder_slug\": \"browser\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Api-Key", "<x-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://{your-subdomain}.neetodesk.com/api/external/v2/fields/{field_id}")
.header("X-Api-Key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"field\": {\n \"name\": \"Browser used\",\n \"state\": \"inactive\",\n \"data\": [\n {\n \"label\": \"Chromium\",\n \"id\": \"aaaabbbb-cccc-dddd-eeee-ffff00004444\"\n }\n ],\n \"remove_option_ids\": [\n \"aaaabbbb-cccc-dddd-eeee-ffff00005555\"\n ],\n \"is_required\": false,\n \"is_required_for_agent_when_submitting_form\": false,\n \"is_required_for_agent_when_closing_ticket\": false,\n \"display_order\": 3,\n \"placeholder_slug\": \"browser\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{your-subdomain}.neetodesk.com/api/external/v2/fields/{field_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Api-Key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"field\": {\n \"name\": \"Browser used\",\n \"state\": \"inactive\",\n \"data\": [\n {\n \"label\": \"Chromium\",\n \"id\": \"aaaabbbb-cccc-dddd-eeee-ffff00004444\"\n }\n ],\n \"remove_option_ids\": [\n \"aaaabbbb-cccc-dddd-eeee-ffff00005555\"\n ],\n \"is_required\": false,\n \"is_required_for_agent_when_submitting_form\": false,\n \"is_required_for_agent_when_closing_ticket\": false,\n \"display_order\": 3,\n \"placeholder_slug\": \"browser\"\n }\n}"
response = http.request(request)
puts response.read_body{
"field": {
"id": "aaaabbbb-cccc-dddd-eeee-ffff00003333",
"name": "Browser",
"kind": "single_option",
"state": "active",
"resource_type": "ticket",
"is_required": false,
"is_required_for_agent_when_submitting_form": false,
"is_required_for_agent_when_closing_ticket": false,
"display_order": 3,
"placeholder_slug": "browser",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"options": [
{
"id": "aaaabbbb-cccc-dddd-eeee-ffff00004444",
"label": "Chrome",
"display_order": 0
}
]
}
}{your-subdomain} with your workspace’s subdomain. Learn how to find your subdomain in Workspace subdomain.
Headers
Use the X-Api-Key header to provide your workspace API key. Refer to Authentication for more information.
Path Parameters
ID of the ticket field. You can get this by listing all ticket fields using the List all ticket fields API.
"aaaabbbb-cccc-dddd-eeee-ffff00003333"
Body
Hide child attributes
Hide child attributes
Name of the field. It must be unique in the workspace.
"Browser used"
State of the field. A field must be made inactive before it can be deleted.
active, inactive "inactive"
Options to add or rename. Applies only to single_option and multi_option fields. Pass an object with a label to add an option, or an object with an id and a label to rename an existing option.
Hide child attributes
Hide child attributes
Label of the option. It cannot be blank.
"Chromium"
ID of an existing option. Omit it to add a new option. You can get option IDs by listing or retrieving a ticket field using the List all ticket fields or Get ticket field API.
"aaaabbbb-cccc-dddd-eeee-ffff00004444"
IDs of the options to remove. Applies only to single_option and multi_option fields. The last option of a field cannot be removed.
["aaaabbbb-cccc-dddd-eeee-ffff00005555"]
Set to true to make the field mandatory for customers while submitting a ticket.
false
Set to true to make the field mandatory for agents while creating a ticket.
false
Set to true to make the field mandatory for agents before they close a ticket.
false
Position of the field in the list of ticket fields.
3
Slug used to refer to the field in placeholders and automations. Renaming a field does not change its slug, so existing placeholders keep working. Send this attribute only to change the slug deliberately, and update every automation and placeholder that refers to the old value.
"browser"
Response
OK - Request succeeded
Hide child attributes
Hide child attributes
"aaaabbbb-cccc-dddd-eeee-ffff00003333"
"Browser"
Type of the field. It cannot be changed after the field is created.
text, textarea, integer, decimal, date, checkbox, single_option, multi_option "single_option"
Fields in the inactive state are hidden from agents and customers.
active, inactive "active"
Resource the field belongs to. Always ticket.
"ticket"
Whether customers must fill this field while submitting a ticket.
false
Whether agents must fill this field while creating a ticket.
false
Whether agents must fill this field before closing a ticket.
false
Position of the field in the list of ticket fields.
3
Slug used to refer to the field in placeholders and automations, as {{ticket.custom_fields.<placeholder_slug>}}. Generated from the name when the field is created, and not regenerated when the field is renamed.
"browser"