Skip to main content
PATCH
/
api
/
v1
/
custom-fields
/
{id}
Update a custom field definition
curl --request PATCH \
  --url https://app.sajn.se/api/v1/custom-fields/{id} \
  --header 'Content-Type: application/json' \
  --header 'authorization: <authorization>' \
  --data '{
  "name": "<string>",
  "inputType": "TEXT",
  "defaultValue": "<string>",
  "required": true,
  "options": "<string>"
}'
{
  "id": "<string>",
  "name": "<string>",
  "type": "DOCUMENT",
  "inputType": "TEXT",
  "defaultValue": "<string>",
  "required": true,
  "options": "<string>",
  "createdAt": "<any>",
  "updatedAt": "<any>"
}

Headers

authorization
string
required

Bearer token for API authentication

Path Parameters

id
string
required

Body

application/json

Body

name
string
Minimum length: 1
inputType
enum<string>
Available options:
TEXT,
NUMBER,
DATE,
EMAIL,
PHONE,
URL,
BOOLEAN,
SELECT
defaultValue
string | null
required
boolean
options
string | null

Response

200

id
string
required

Unique custom field identifier

name
string
required

Custom field name

type
enum<string>
required

Field type: DOCUMENT or CONTACT

Available options:
DOCUMENT,
CONTACT
inputType
enum<string>
required

Input type: TEXT, NUMBER, DATE, CHECKBOX, SELECT, TEXTAREA, EMAIL, PHONE, or URL

Available options:
TEXT,
NUMBER,
DATE,
EMAIL,
PHONE,
URL,
BOOLEAN,
SELECT
defaultValue
string | null
required

Default value for this field

required
boolean
required

Whether this field is required

options
string | null
required

Comma-separated options for SELECT type fields

createdAt
any
required

Date and time when custom field was created

updatedAt
any
required

Date and time when custom field was last updated

I