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

# Create a new question

> This endpoint allows you to create a new question.



## OpenAPI

````yaml /api-reference/openapi.documented.json post /api/loyalty/questions
openapi: 3.0.2
info:
  title: Snag Solutions - API Docs
  description: >-
    Documentation for Loyalty & Socials APIs. Some endpoints require an API key
    to authenticate. To obtain a key, reach out to the Snag Solutions team at
    support@snagsolutions.io.
  version: '0.1'
servers:
  - url: https://admin.snagsolutions.io/
    description: Production
security: []
paths:
  /api/loyalty/questions:
    post:
      tags:
        - Question
      summary: Create a new question
      description: This endpoint allows you to create a new question.
      parameters: []
      requestBody:
        description: Body
        content:
          application/json:
            schema:
              type: object
              properties:
                loyaltyRuleId:
                  type: string
                  format: uuid
                  title: Loyalty Rule ID
                  description: UUID of the loyalty rule
                  example: 123e4567-e89b-12d3-a456-426614174000
                questionText:
                  type: string
                  title: Question Text
                  description: The text of the question
                  example: What is your favorite color?
                allowMultipleAttempts:
                  default: false
                  type: boolean
                  title: Allow Multiple Attempts
                  description: Whether the question allows multiple attempts
                  example: false
                loyaltyQuestionAnswers:
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                        title: Choice ID
                        description: UUID of the choice (optional for new choices)
                        example: 123e4567-e89b-12d3-a456-426614174333
                      text:
                        type: string
                        title: Choice Text
                        description: The text of the choice
                        example: Red
                      isCorrect:
                        type: boolean
                        title: Is Correct
                        description: Whether this choice is correct
                        example: true
                      sortIdentifier:
                        type: number
                        title: Sort Order
                        description: The order in which to display the choice
                        example: 1
                    required:
                      - text
                      - isCorrect
                      - sortIdentifier
                  title: Question Choices
                  description: Array of choices for the question
              required:
                - loyaltyRuleId
                - questionText
                - loyaltyQuestionAnswers
      responses:
        '201':
          description: '201'
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                  text:
                    type: string
                  loyaltyQuestionChoices:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                        text:
                          type: string
                        sortIdentifier:
                          type: number
                      required:
                        - id
                        - text
                        - sortIdentifier
                required:
                  - id
                  - text
                  - loyaltyQuestionChoices
                title: Question Response
                description: Response returned for a question
        '403':
          description: '403'
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    title: Message
                    description: Error message
                    example: Forbidden, Could not validate api key
                required:
                  - message
                title: Forbidden Response
                description: Schema for forbidden response
                example: Forbidden, Could not validate api key
        '500':
          description: '500'
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    title: Success
                    description: Indicates operation success
                    example: false
                  message:
                    type: string
                    title: Message
                    description: Error message
                    example: Internal server error
                  debugInfo:
                    type: string
                    title: Debug Info
                    description: Optional debug information
                    example: Stack trace or additional error details
                required:
                  - success
                  - message
                title: Internal Server Error Response
                description: Schema for internal server error response
      security:
        - apiKeyAuth: []
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````