POST
/forms/:id/fieldsAdd Field
Add a new field to an existing form
Scope: FORMS_WRITE
Overview
Adds a new field to an existing form's schema. The field is appended to the specified section. A form can have a maximum of 200 fields, and the total schema size cannot exceed 1 MB.
Request
POST
/forms/:id/fieldsPath Parameters
Headers
| Header | Value |
|---|---|
Authorization | Bearer fxk_live_<your-api-key> |
Content-Type | application/json |
Request Body
Field Option Object
json
{
"label": "Option Label",
"value": "option_value"
}
Both label and value are required strings (max 500 characters each).
Example Request
curl -X POST "https://api.formfex.com/api/v1/public/forms/FORM_ID/fields" \
-H "Authorization: Bearer $FORMFEX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"sectionId": "section-1",
"type": "select",
"label": "Department",
"required": true,
"options": [
{ "label": "Engineering", "value": "engineering" },
{ "label": "Marketing", "value": "marketing" },
{ "label": "Sales", "value": "sales" }
]
}'Response
Error Cases
| Status | Condition |
|---|---|
400 | Invalid section ID — sectionId does not exist in the form schema |
400 | Maximum 200 fields reached |
400 | Options required for select, radio, or checkbox types |
400 | Schema size exceeds 1 MB after adding the field |
404 | Form not found or soft-deleted |
Conditional Logic
You can add conditional visibility to fields using the conditionalLogic property. Conditions reference other field IDs and support operators like equals, notEquals, contains, greaterThan, isEmpty, and more.