Skip to Content

Create a custom field definition

You're viewing API version 2026-09, which is deprecated and stops working on October 1, 2027. To move your integration, see Upgrading to 2026-10.
POST
/api/v1/custom-fields

Create a new custom field definition.

Required Fields:

  • name - Field name
  • type - DOCUMENT or CONTACT
  • inputType - Input type (TEXT, NUMBER, DATE, CHECKBOX, SELECT, TEXTAREA)

Optional Fields:

  • defaultValue - Default value for the field
  • required - Whether field is required (default: false)
  • options - For SELECT type, the options as a JSON-encoded string array, for example ["Small","Large"]

Authorization

headerAuthorizationBearer <token>

Personal API key, e.g. Authorization: Bearer sajn_sk_.... Not scope-limited — acts as the issuing user.

Header Parameters

authorization*string

Bearer token for API authentication

Idempotency-Key?string

Makes retries safe. A retry with the same key and the same request replays the stored response for 24 hours (header Idempotent-Replayed: true); the same key with a different request returns 400.

Lengthlength <= 255

Request Body

Body

application/json
  1. body

Create custom field request

name*string

Custom field name (required)

Length1 <= length
type*string

Field type: DOCUMENT or CONTACT (required)

Value in"DOCUMENT""CONTACT"
inputType*string

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

Value in"TEXT""NUMBER""DATE""EMAIL""PHONE""URL""BOOLEAN""SELECT""JSON""TEXTAREA"
defaultValue?|

Default value for this field

required*boolean

Whether this field is required (default: false)

Defaultfalse
options?|

Options for SELECT type fields as a JSON-encoded string array, for example ["Small","Large"]

Response Body

200

application/json
  1. response
id*string

Unique custom field identifier

name*string

Custom field name

type*string

Field type: DOCUMENT or CONTACT

Value in"DOCUMENT""CONTACT"
inputType*string

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

Value in"TEXT""NUMBER""DATE""EMAIL""PHONE""URL""BOOLEAN""SELECT""JSON""TEXTAREA"
defaultValue*|

Default value for this field

required*boolean

Whether this field is required

options*|

Options for SELECT type fields as a JSON-encoded string array, for example ["Small","Large"]

createdAt*string

Date and time when custom field was created

Formatdate-time
updatedAt*string

Date and time when custom field was last updated

Formatdate-time
Example Request
curl -X POST 'https://app.sajn.se/api/v1/custom-fields' \  -H 'authorization: string' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "type": "DOCUMENT",  "inputType": "TEXT",  "required": false}'
Example Response
{  "id": "string",  "name": "string",  "type": "DOCUMENT",  "inputType": "TEXT",  "defaultValue": "string",  "required": true,  "options": "string",  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z"}

Was this page helpful?