Skip to main content

Create Field

Create a new contact field in your workspace.


Endpoint

POST https://api.campaignlark.com/v1/fields

Request Body

FieldTypeRequiredDescription
labelstringrequiredHuman-readable display name. 1–32 characters. Must be unique within the workspace.
merge_tagstringrequiredThe key used to reference this field in contact data payloads. 2–16 characters, lowercase letters and underscores only. Must be unique.
typestringrequiredData type of the field. One of TEXT, NUMBER, BOOLEAN, DATE, DROPDOWN_SINGLE, DROPDOWN_MULTIPLE, COUNTRY.
definitionstringconditionalRequired for DROPDOWN_SINGLE and DROPDOWN_MULTIPLE types. Comma-separated list of at least 2 unique options.
default_valuestringoptionalValue used when no value is provided for this field.
requiredbooleanoptionalWhether this field must have a value on every contact. Defaults to false.

Sample Request

POST https://api.campaignlark.com/v1/fields
Content-Type: application/json

{
"label": "Favorite Color",
"merge_tag": "fav_color",
"type": "DROPDOWN_SINGLE",
"definition": "Red,Blue,Green",
"default_value": "",
"required": false
}

Response

Success — 201 Created

{
"data": {
"id": 6,
"label": "Favorite Color",
"merge_tag": "fav_color",
"type": "DROPDOWN_SINGLE",
"definition": "Red,Blue,Green",
"default_value": "",
"order": 60,
"immutable": false,
"required": false
}
}

Errors

StatusMessageCause
400Validation errorlabel is missing, empty, or exceeds 32 characters.
400Validation errormerge_tag is missing, invalid format, or exceeds 16 characters.
400Validation errortype is missing or not one of the valid field types.
400Validation errordefinition is required for dropdown types and must contain at least 2 unique options.
400Validation errorA field with the same label or merge_tag already exists.
400Validation errorCannot create immutable fields via the API.
400Validation errorAn import or export is currently in progress.