Update Field
Update an existing contact field by its ID.
Endpoint
PATCH https://api.campaignlark.com/v1/fields/:id
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | required | The field ID. |
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. Must match the field's existing type — the type cannot be changed. |
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. |
Sample Request
PATCH https://api.campaignlark.com/v1/fields/6
Content-Type: application/json
{
"label": "Favorite Color Updated",
"merge_tag": "fav_color",
"type": "DROPDOWN_SINGLE",
"definition": "Red,Blue,Green,Yellow",
"default_value": "",
"required": false
}
Response
Success — 200 OK
{
"data": {
"id": 6,
"label": "Favorite Color Updated",
"merge_tag": "fav_color",
"type": "DROPDOWN_SINGLE",
"definition": "Red,Blue,Green,Yellow",
"default_value": "",
"order": 0,
"immutable": false,
"required": false
}
}
Errors
| Status | Message | Cause |
|---|---|---|
404 | We were unable to find the field. | Field does not exist in this workspace. |
400 | This field is immutable and cannot be updated. | Immutable fields (e.g. email_address) cannot be modified. |
400 | The type of the field cannot be changed. | The type value does not match the field's existing type. |
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 | 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 | An import or export is currently in progress. |