Skip to main content
POST
/
v1
/
form-templates
/
{id}
/
questions
Add a question to a form template
curl --request POST \
  --url https://dev.flextell.ai/api/v1/form-templates/{id}/questions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-Tenant: <x-tenant>' \
  --data '
{
  "label": "<string>",
  "required": true,
  "order": 1,
  "helper_text": "<string>",
  "options": [
    {
      "label": "<string>",
      "order": 1
    }
  ],
  "visibility_rules": [
    {
      "depends_on_question_id": 123,
      "value": "<string>"
    }
  ]
}
'
{
  "success": "<string>",
  "data": {
    "id": 123,
    "order": 123,
    "label": "<string>",
    "helper_text": "<string>",
    "question_type": "<string>",
    "required": true,
    "options": [
      {
        "id": 123,
        "label": "<string>",
        "order": 123
      }
    ],
    "visibility_rules": [
      {
        "id": 123,
        "depends_on_question_id": 123,
        "operator": "<string>",
        "value": "<string>",
        "match_type": "<string>"
      }
    ]
  }
}

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Headers

X-Tenant
number
required

Tenant identifier. Send the Tenant ID in the X-Tenant header to scope API requests to a specific tenant.

Path Parameters

id
integer
required

The form template identifier

Body

application/json
label
string
required

The label.

Maximum string length: 255
question_type
enum<string>
required

The question type.

Available options:
text,
textarea,
select,
radio,
checkbox,
number,
date,
boolean
required
boolean
required

Whether the field is required.

order
integer
required

The display order.

Required range: x >= 0
helper_text
string | null

Helper text shown to the user.

options
object[]

The available options.

visibility_rules
object[]

Visibility rule definitions.

Response

success
string
required
data
FormQuestionResource · object
required