POST/forms/:id/fields

Add 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/fields

Path Parameters

Headers

HeaderValue
AuthorizationBearer fxk_live_<your-api-key>
Content-Typeapplication/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

StatusCondition
400Invalid section ID — sectionId does not exist in the form schema
400Maximum 200 fields reached
400Options required for select, radio, or checkbox types
400Schema size exceeds 1 MB after adding the field
404Form 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.