Create Field
Create a new contact field in your workspace.
Endpoint
POST https://api.campaignlark.com/v1/fields
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
label | string | required | Human-readable display name. 1–32 characters. Must be unique within the workspace. |
merge_tag | string | required | The key used to reference this field in contact data payloads. 2–16 characters, lowercase letters and underscores only. Must be unique. |
type | string | required | Data type of the field. One of TEXT, NUMBER, BOOLEAN, DATE, DROPDOWN_SINGLE, DROPDOWN_MULTIPLE, COUNTRY. |
definition | string | conditional | Required for DROPDOWN_SINGLE and DROPDOWN_MULTIPLE types. Comma-separated list of at least 2 unique options. |
default_value | string | optional | Value used when no value is provided for this field. |
required | boolean | optional | Whether 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
| Status | Message | Cause |
|---|---|---|
400 | Validation error | label is missing, empty, or exceeds 32 characters. |
400 | Validation error | merge_tag is missing, invalid format, or exceeds 16 characters. |
400 | Validation error | type is missing or not one of the valid field types. |
400 | Validation error | definition is required for dropdown types and must contain at least 2 unique options. |
400 | Validation error | A field with the same label or merge_tag already exists. |
400 | Validation error | Cannot create immutable fields via the API. |
400 | Validation error | An import or export is currently in progress. |