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

# Update Question

> Update an existing question.



## OpenAPI

````yaml openapi.json patch /forms/{id}/fields/{fieldId}
openapi: 3.1.0
info:
  title: GeniusForms API
  description: >-
    AI-powered form builder API. Create forms manually or generate them from
    natural language prompts.
  version: 1.0.0
  contact:
    name: GeniusForms Support
    email: support@geniusforms.ai
    url: https://geniusforms.ai
servers:
  - url: https://geniusforms.ai/api/v1
    description: Production
  - url: http://localhost:8000/api/v1
    description: Local Development
security:
  - ApiKeyAuth: []
paths:
  /forms/{id}/fields/{fieldId}:
    patch:
      tags:
        - Questions
      summary: Update Question
      description: Update an existing question.
      operationId: updateQuestion
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
          description: Form ID
        - name: fieldId
          in: path
          required: true
          schema:
            type: integer
          description: Question ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateQuestionRequest'
      responses:
        '200':
          description: Question updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Question'
components:
  schemas:
    UpdateQuestionRequest:
      type: object
      properties:
        question:
          type: string
        required:
          type: boolean
        options:
          type: array
          items:
            type: string
    Question:
      type: object
      properties:
        id:
          type: integer
          example: 1
        order:
          type: integer
          example: 1
        type:
          type: string
          enum:
            - text
            - textarea
            - email
            - number
            - phone
            - url
            - date
            - time
            - select
            - multi_select
            - rating
            - slider
            - yes_no
            - file_upload
            - currency
          example: text
        question:
          type: string
          example: Your name
        required:
          type: boolean
          example: true
        options:
          type: array
          items:
            type: string
          nullable: true
          example:
            - Option A
            - Option B
        conditionalLogic:
          $ref: '#/components/schemas/ConditionalLogic'
    ConditionalLogic:
      type: object
      description: Conditional logic for showing/hiding questions
      properties:
        showIf:
          type: object
          description: Simple condition - show if another question matches
          properties:
            questionId:
              type: integer
              description: ID of the question to check
            operator:
              type: string
              enum:
                - equals
                - not_equals
            value:
              type: string
              description: Value to compare against
        advanced:
          type: object
          description: Advanced logic with multiple conditions and actions
          properties:
            conditionGroups:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                  operator:
                    type: string
                    enum:
                      - AND
                      - OR
                  conditions:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        questionId:
                          type: integer
                        operator:
                          type: string
                          enum:
                            - equals
                            - not_equals
                            - contains
                            - greater_than
                            - less_than
                            - is_empty
                            - is_not_empty
                        value:
                          type:
                            - string
                            - number
                        valueType:
                          type: string
                          enum:
                            - static
                            - dynamic
                            - score
            actions:
              type: array
              items:
                type: object
                properties:
                  type:
                    type: string
                    enum:
                      - show_question
                      - hide_question
                      - skip_to_section
                      - skip_to_question
                      - end_form
                      - set_score
                  targetId:
                    type:
                      - integer
                      - string
                  value: {}
            scoreRules:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                  questionId:
                    type: integer
                  scoreMap:
                    type: object
                    additionalProperties:
                      type: number
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key obtained from your GeniusForms dashboard

````