curl --request POST \
--url https://api.snitcher.com/v1/workspaces/{workspaceUuid}/custom-fields \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Industry",
"type": "text",
"key": "industry",
"description": "The primary industry of the company.",
"field_rules": [
{
"type": "<string>",
"config": {}
}
],
"options": [
{
"key": "technology",
"label": "Technology",
"color": "#FF0000"
}
]
}
'import requests
url = "https://api.snitcher.com/v1/workspaces/{workspaceUuid}/custom-fields"
payload = {
"name": "Industry",
"type": "text",
"key": "industry",
"description": "The primary industry of the company.",
"field_rules": [
{
"type": "<string>",
"config": {}
}
],
"options": [
{
"key": "technology",
"label": "Technology",
"color": "#FF0000"
}
]
}
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: 'Industry',
type: 'text',
key: 'industry',
description: 'The primary industry of the company.',
field_rules: [{type: '<string>', config: {}}],
options: [{key: 'technology', label: 'Technology', color: '#FF0000'}]
})
};
fetch('https://api.snitcher.com/v1/workspaces/{workspaceUuid}/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.snitcher.com/v1/workspaces/{workspaceUuid}/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' => 'Industry',
'type' => 'text',
'key' => 'industry',
'description' => 'The primary industry of the company.',
'field_rules' => [
[
'type' => '<string>',
'config' => [
]
]
],
'options' => [
[
'key' => 'technology',
'label' => 'Technology',
'color' => '#FF0000'
]
]
]),
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.snitcher.com/v1/workspaces/{workspaceUuid}/custom-fields"
payload := strings.NewReader("{\n \"name\": \"Industry\",\n \"type\": \"text\",\n \"key\": \"industry\",\n \"description\": \"The primary industry of the company.\",\n \"field_rules\": [\n {\n \"type\": \"<string>\",\n \"config\": {}\n }\n ],\n \"options\": [\n {\n \"key\": \"technology\",\n \"label\": \"Technology\",\n \"color\": \"#FF0000\"\n }\n ]\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.snitcher.com/v1/workspaces/{workspaceUuid}/custom-fields")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Industry\",\n \"type\": \"text\",\n \"key\": \"industry\",\n \"description\": \"The primary industry of the company.\",\n \"field_rules\": [\n {\n \"type\": \"<string>\",\n \"config\": {}\n }\n ],\n \"options\": [\n {\n \"key\": \"technology\",\n \"label\": \"Technology\",\n \"color\": \"#FF0000\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.snitcher.com/v1/workspaces/{workspaceUuid}/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\": \"Industry\",\n \"type\": \"text\",\n \"key\": \"industry\",\n \"description\": \"The primary industry of the company.\",\n \"field_rules\": [\n {\n \"type\": \"<string>\",\n \"config\": {}\n }\n ],\n \"options\": [\n {\n \"key\": \"technology\",\n \"label\": \"Technology\",\n \"color\": \"#FF0000\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"identifier": "industry",
"key": "industry",
"name": "Industry",
"entity_type": "organisation",
"type": "text",
"description": "The primary industry of the company.",
"group": "custom",
"is_visible": true,
"source": "manual",
"rules": [
{}
],
"is_system": false,
"options": [
{}
]
}Create a custom field definition
curl --request POST \
--url https://api.snitcher.com/v1/workspaces/{workspaceUuid}/custom-fields \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Industry",
"type": "text",
"key": "industry",
"description": "The primary industry of the company.",
"field_rules": [
{
"type": "<string>",
"config": {}
}
],
"options": [
{
"key": "technology",
"label": "Technology",
"color": "#FF0000"
}
]
}
'import requests
url = "https://api.snitcher.com/v1/workspaces/{workspaceUuid}/custom-fields"
payload = {
"name": "Industry",
"type": "text",
"key": "industry",
"description": "The primary industry of the company.",
"field_rules": [
{
"type": "<string>",
"config": {}
}
],
"options": [
{
"key": "technology",
"label": "Technology",
"color": "#FF0000"
}
]
}
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: 'Industry',
type: 'text',
key: 'industry',
description: 'The primary industry of the company.',
field_rules: [{type: '<string>', config: {}}],
options: [{key: 'technology', label: 'Technology', color: '#FF0000'}]
})
};
fetch('https://api.snitcher.com/v1/workspaces/{workspaceUuid}/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.snitcher.com/v1/workspaces/{workspaceUuid}/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' => 'Industry',
'type' => 'text',
'key' => 'industry',
'description' => 'The primary industry of the company.',
'field_rules' => [
[
'type' => '<string>',
'config' => [
]
]
],
'options' => [
[
'key' => 'technology',
'label' => 'Technology',
'color' => '#FF0000'
]
]
]),
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.snitcher.com/v1/workspaces/{workspaceUuid}/custom-fields"
payload := strings.NewReader("{\n \"name\": \"Industry\",\n \"type\": \"text\",\n \"key\": \"industry\",\n \"description\": \"The primary industry of the company.\",\n \"field_rules\": [\n {\n \"type\": \"<string>\",\n \"config\": {}\n }\n ],\n \"options\": [\n {\n \"key\": \"technology\",\n \"label\": \"Technology\",\n \"color\": \"#FF0000\"\n }\n ]\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.snitcher.com/v1/workspaces/{workspaceUuid}/custom-fields")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Industry\",\n \"type\": \"text\",\n \"key\": \"industry\",\n \"description\": \"The primary industry of the company.\",\n \"field_rules\": [\n {\n \"type\": \"<string>\",\n \"config\": {}\n }\n ],\n \"options\": [\n {\n \"key\": \"technology\",\n \"label\": \"Technology\",\n \"color\": \"#FF0000\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.snitcher.com/v1/workspaces/{workspaceUuid}/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\": \"Industry\",\n \"type\": \"text\",\n \"key\": \"industry\",\n \"description\": \"The primary industry of the company.\",\n \"field_rules\": [\n {\n \"type\": \"<string>\",\n \"config\": {}\n }\n ],\n \"options\": [\n {\n \"key\": \"technology\",\n \"label\": \"Technology\",\n \"color\": \"#FF0000\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"identifier": "industry",
"key": "industry",
"name": "Industry",
"entity_type": "organisation",
"type": "text",
"description": "The primary industry of the company.",
"group": "custom",
"is_visible": true,
"source": "manual",
"rules": [
{}
],
"is_system": false,
"options": [
{}
]
}Authorizations
Enter your personal access token (PAT) to authenticate
Path Parameters
The UUID of the workspace
"550e8400-e29b-41d4-a716-446655440000"
Body
Request body for creating a custom field definition
The human-readable name of the field
255"Industry"
The data type of the field
"text"
The machine-readable key. Must start with a lowercase letter and contain only lowercase letters, numbers, and underscores. Generated from the name when omitted.
255"industry"
1000"The primary industry of the company."
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Response
The created custom field definition
A custom field definition for organisations
The unique identifier of the field
"industry"
The machine-readable key of the field
"industry"
The human-readable name of the field
"Industry"
The entity type the field belongs to
"organisation"
The data type of the field
"text"
"The primary industry of the company."
The group the field belongs to
"custom"
true
The source of the field
"manual"
false