Skip to main content
POST
/
forms
/
{id}
/
fields
Add Field
curl --request POST \
  --url https://geniusforms.ai/api/v1/forms/{id}/fields \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "type": "text",
  "question": "<string>"
}
'
{
  "id": 1,
  "order": 1,
  "type": "text",
  "question": "Your name",
  "required": true,
  "options": [
    "Option A",
    "Option B"
  ],
  "conditionalLogic": {
    "showIf": {
      "questionId": 123,
      "operator": "equals",
      "value": "<string>"
    },
    "advanced": {
      "conditionGroups": [
        {
          "id": "<string>",
          "operator": "AND",
          "conditions": [
            {
              "id": "<string>",
              "questionId": 123,
              "operator": "equals",
              "value": "<string>",
              "valueType": "static"
            }
          ]
        }
      ],
      "actions": [
        {
          "type": "show_question",
          "targetId": 123,
          "value": "<unknown>"
        }
      ],
      "scoreRules": [
        {
          "id": "<string>",
          "questionId": 123,
          "scoreMap": {}
        }
      ]
    }
  }
}

Authorizations

X-API-Key
string
header
required

API key obtained from your GeniusForms dashboard

Path Parameters

id
integer
required

Form ID

Body

application/json
type
enum<string>
required
Available options:
text,
textarea,
email,
number,
phone,
url,
date,
time,
select,
multi_select,
rating,
slider,
yes_no,
file_upload,
currency
question
string
required
Required string length: 1 - 1000
required
boolean
default:false
options
string[]

Required for select/multi_select types

conditionalLogic
object

Conditional logic for showing/hiding questions

sliderConfig
object

Required for slider type

Response

201 - application/json

Field created

id
integer
Example:

1

order
integer
Example:

1

type
enum<string>
Available options:
text,
textarea,
email,
number,
phone,
url,
date,
time,
select,
multi_select,
rating,
slider,
yes_no,
file_upload,
currency
Example:

"text"

question
string
Example:

"Your name"

required
boolean
Example:

true

options
string[] | null
Example:
["Option A", "Option B"]
conditionalLogic
object

Conditional logic for showing/hiding questions