> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flextell.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Update a question on a form template



## OpenAPI

````yaml https://dev.flextell.ai/docs/api.json put /v1/form-templates/{id}/questions/{questionId}
openapi: 3.1.0
info:
  title: Flextell API
  version: 0.0.1
  description: '## Flextell API'
servers:
  - url: https://dev.flextell.ai/api
security:
  - oauth2: []
  - bearer: []
paths:
  /v1/form-templates/{id}/questions/{questionId}:
    put:
      tags:
        - FormTemplateQuestion
      summary: Update a question on a form template
      operationId: formTemplateQuestion.update
      parameters:
        - name: id
          in: path
          required: true
          description: The form template identifier
          schema:
            type: integer
        - name: questionId
          in: path
          required: true
          description: The question identifier
          schema:
            type: integer
        - name: X-Tenant
          in: header
          required: true
          description: >-
            Tenant identifier. Send the Tenant ID in the `X-Tenant` header to
            scope API requests to a specific tenant.
          schema:
            type: number
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FormTemplateQuestionUpdateRequest'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: string
                  data:
                    $ref: '#/components/schemas/FormQuestionResource'
                required:
                  - success
                  - data
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '404':
          description: ''
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    properties:
                      success:
                        type: string
                      data:
                        type: object
                        properties:
                          message:
                            type: string
                            const: Question not found
                        required:
                          - message
                    required:
                      - success
                      - data
                  - type: object
                    properties:
                      success:
                        type: string
                      data:
                        type: object
                        properties:
                          message:
                            type: string
                            const: Form template not found
                        required:
                          - message
                    required:
                      - success
                      - data
        '422':
          $ref: '#/components/responses/ValidationException'
components:
  schemas:
    FormTemplateQuestionUpdateRequest:
      type: object
      properties:
        label:
          type: string
          description: The label.
          maxLength: 255
        question_type:
          type: string
          description: The question type.
          enum:
            - text
            - textarea
            - select
            - radio
            - checkbox
            - number
            - date
            - boolean
        required:
          type: boolean
          description: Whether the field is required.
        order:
          type: integer
          description: The display order.
          minimum: 0
        helper_text:
          type:
            - string
            - 'null'
          description: Helper text shown to the user.
        options:
          type: array
          description: The available options.
          items:
            type: object
            properties:
              id:
                type:
                  - integer
                  - 'null'
                description: The options.*.id.
              label:
                type: string
                description: The options.*.label.
                maxLength: 255
              order:
                type: integer
                description: The options.*.order.
                minimum: 0
            required:
              - label
              - order
        visibility_rules:
          type: array
          description: Visibility rule definitions.
          items:
            type: object
            properties:
              depends_on_question_id:
                type: integer
                description: The visibility rules.*.depends on question ID.
              operator:
                type: string
                description: The visibility rules.*.operator.
                enum:
                  - equals
                  - not_equals
                  - in
                  - not_in
                  - greater_than
                  - less_than
                  - contains
              value:
                type: string
                description: The visibility rules.*.value.
              match_type:
                type: string
                description: The visibility rules.*.match type.
                enum:
                  - all
                  - any
            required:
              - depends_on_question_id
              - operator
              - value
      title: FormTemplateQuestionUpdateRequest
    FormQuestionResource:
      type: object
      properties:
        id:
          type: integer
        order:
          type: integer
        label:
          type: string
        helper_text:
          type:
            - string
            - 'null'
        question_type:
          type: string
        required:
          type: boolean
        options:
          type: array
          items:
            $ref: '#/components/schemas/FormOptionResource'
        visibility_rules:
          type: array
          items:
            $ref: '#/components/schemas/FormVisibilityRuleResource'
      required:
        - id
        - order
        - label
        - helper_text
        - question_type
        - required
      title: FormQuestionResource
    FormOptionResource:
      type: object
      properties:
        id:
          type: integer
        label:
          type: string
        order:
          type: integer
      required:
        - id
        - label
        - order
      title: FormOptionResource
    FormVisibilityRuleResource:
      type: object
      properties:
        id:
          type: integer
        depends_on_question_id:
          type: integer
        operator:
          type: string
        value:
          type: string
        match_type:
          type: string
      required:
        - id
        - depends_on_question_id
        - operator
        - value
        - match_type
      title: FormVisibilityRuleResource
  responses:
    AuthenticationException:
      description: Unauthenticated
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    AuthorizationException:
      description: Authorization error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
              - message
              - errors
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://dev.flextell.ai/oauth/authorize
          tokenUrl: https://dev.flextell.ai/oauth/token
          scopes:
            '*': all
    bearer:
      type: http
      scheme: bearer

````