Update a field of a form
/forms/{form_id}/fields/{id}Changes the keys you send, keeps everything else (page, order, validator, preset, conditions) and returns the field. Null clears a key. conditions replaces the list; empty removes it. A type change must be compatible: see compatible-types. A bad validator or type returns 422; a compliance-protected field returns 409 conflict. required is read-only. Published forms can be changed too. dry_run previews it. Emits form_field.updated when something changes; no email. Sending the old values undoes it.
Path parameters
The form's id, a uuid. An unknown id, or a hidden form, returns 404.
The field's id, a uuid. A field of another form returns 404.
Query parameters
Validate and run the call without committing it, returning what the real call would return with
meta.dry_runset.
Request body
application/json, required · FormFieldUpdate
The new field type. It must be compatible with the current type; see the compatible-types read.
The question shown to the person filling in the form.
The field's short name.
Help text shown under the question.
A key that stays stable across edits, unique within the form.
Validation rules separated by a pipe, such as required|string.
Placeholder text.
The profile value that pre-fills this field.
Whether the answer is written back to the profile.
The field's position within the form.
A page of this form to place the field on. Null removes it from its page.
A live option preset a dropdown field takes its options from. Null unlinks it.
The options of a dropdown or similar field. A list for most types; an object for a DOCUSIGN field.
- One of:
Whether all conditions (AND) or any one (OR) must hold.
AND,OR Display conditions. Send an empty list to remove them; leave the key out to keep them.
{
"label": "Spouse full name",
"conditions": [
{
"against_field_reference": "marital_status",
"operator": "one_of",
"value": [
"married",
"widowed"
]
}
]
}Responses
{
"data": {
"id": "9a9d1c5e-4f2b-4c8e-9a7d-2f1e6b3c4d5a",
"label": "string",
"name": "string",
"description": "string",
"type": "string",
"reference": "string",
"validator": "string",
"placeholder": "string",
"pre_population_key": "string",
"backfill": true,
"order": 1,
"page_id": "9a9d1c5e-4f2b-4c8e-9a7d-2f1e6b3c4d5a",
"option_preset_id": "9a9d1c5e-4f2b-4c8e-9a7d-2f1e6b3c4d5a",
"options": [
null
],
"required": true,
"conditions": [
{
"against_field_id": "9a9d1c5e-4f2b-4c8e-9a7d-2f1e6b3c4d5a",
"against_field_reference": "string",
"operator": "string",
"value": "string"
}
],
"condition_logic": "AND"
}
}Authorization failed. error.code is one of org_disabled,
ip_blocked, missing_scope, scope_disabled, user_disabled.
The request conflicts with existing state (error.code = conflict),
e.g. a compliance flow with the requested name already exists.
The request can't be processed (HTTP 422): validation_failed with one ErrorDetail per
problem, or a code documented on the operation.
Examples
curl -X PATCH https://your-org-domain/kong/core/api/v2/forms/{form_id}/fields/{id}\
-H "Authorization: Bearer $HELM_API_KEY"\
-H "Content-Type: application/json"\
-d '{
"label": "Spouse full name",
"conditions": [
{
"against_field_reference": "marital_status",
"operator": "one_of",
"value": [
"married",
"widowed"
]
}
]
}'