Skip to main content
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.",
  "field_rules": [
    {
      "type": "<string>",
      "config": {}
    }
  ],
  "options": [
    {
      "key": "technology",
      "label": "Technology",
      "color": "#FF0000"
    }
  ]
}
'
{
  "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

Authorization
string
header
required

Enter your personal access token (PAT) to authenticate

Path Parameters

workspaceUuid
string<uuid>
required

The UUID of the workspace

Example:

"550e8400-e29b-41d4-a716-446655440000"

Body

application/json

Request body for creating a custom field definition

name
string
required

The human-readable name of the field

Maximum string length: 255
Example:

"Industry"

type
string
required

The data type of the field

Example:

"text"

key
string | null

The machine-readable key. Must start with a lowercase letter and contain only lowercase letters, numbers, and underscores. Generated from the name when omitted.

Maximum string length: 255
Example:

"industry"

description
string | null
Maximum string length: 1000
Example:

"The primary industry of the company."

field_rules
object[] | null
options
object[] | null

Response

201 - application/json

The created custom field definition

A custom field definition for organisations

identifier
string

The unique identifier of the field

Example:

"industry"

key
string

The machine-readable key of the field

Example:

"industry"

name
string

The human-readable name of the field

Example:

"Industry"

entity_type
string

The entity type the field belongs to

Example:

"organisation"

type
string

The data type of the field

Example:

"text"

description
string | null
Example:

"The primary industry of the company."

group
string

The group the field belongs to

Example:

"custom"

is_visible
boolean
Example:

true

source
string

The source of the field

Example:

"manual"

rules
object[]
is_system
boolean
Example:

false

options
object[]