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.",
"visible_in_spotter": false,
"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.",
"visible_in_spotter": False,
"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.',
visible_in_spotter: false,
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.',
'visible_in_spotter' => false,
'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 \"visible_in_spotter\": false,\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 \"visible_in_spotter\": false,\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 \"visible_in_spotter\": false,\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": [
{}
],
"visible_in_spotter": false
}Custom Fields
Create a custom field definition
POST
/
v1
/
workspaces
/
{workspaceUuid}
/
custom-fields
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.",
"visible_in_spotter": false,
"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.",
"visible_in_spotter": False,
"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.',
visible_in_spotter: false,
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.',
'visible_in_spotter' => false,
'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 \"visible_in_spotter\": false,\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 \"visible_in_spotter\": false,\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 \"visible_in_spotter\": false,\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": [
{}
],
"visible_in_spotter": false
}Authorizations
Path Parameters
Body
application/json
Request body for creating a custom field definition
Response
201 - application/json
The created custom field definition
A custom field definition for organisations