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

# Create Question Logic

Add a logic rule to a question to control the flow of the interview (e.g., skip logic).


## OpenAPI

````yaml POST /api/v1/question-logic
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://api.getversive.com
security: []
paths:
  /api/v1/question-logic:
    post:
      tags:
        - Question Logic
      summary: Create Question Logic
      operationId: create_question_logic_api_v1_question_logic_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateQuestionLogicReqV1'
            example:
              study_id: study_123
              question_id: q_123
              operation: equals
              comparison_value: 'yes'
              comparison_value_type: text
              next_question_id: q_124
              action_type: skip_to
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema: {}
              example:
                id: logic_123
                study_id: study_123
                question_id: q_123
                operation: equals
                comparison_value: 'yes'
                comparison_value_type: text
                next_question_id: q_124
                redirect_url: null
                end_interview: false
                action_type: skip_to
                language: English
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
              example:
                detail:
                  - loc:
                      - body
                      - title
                    msg: field required
                    type: value_error.missing
      security:
        - HTTPBearer: []
components:
  schemas:
    CreateQuestionLogicReqV1:
      properties:
        study_id:
          type: string
          title: Study Id
        question_id:
          type: string
          title: Question Id
        operation:
          type: string
          title: Operation
        comparison_value:
          anyOf:
            - type: string
            - type: 'null'
          title: Comparison Value
        comparison_value_type:
          type: string
          title: Comparison Value Type
        next_question_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Question Id
        redirect_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Redirect Url
        end_interview:
          type: boolean
          title: End Interview
          default: false
        action_type:
          type: string
          title: Action Type
        language:
          type: string
          title: Language
          default: English
      type: object
      required:
        - study_id
        - question_id
        - operation
        - comparison_value_type
        - action_type
      title: CreateQuestionLogicReqV1
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````