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

# Create Refinement Question

> Ask a question on a refinement.



## OpenAPI

````yaml /openapi.json post /api/v1/refinements/{refinement_id}/qa
openapi: 3.1.0
info:
  description: >-
    Okto Pulse REST API schema generated from okto-pulse-core 0.2.0 source for
    docs.oktolabs.ai.
  title: Okto Pulse
  version: 0.2.0
servers: []
security: []
paths:
  /api/v1/refinements/{refinement_id}/qa:
    post:
      tags:
        - refinements
      summary: Create Refinement Question
      description: Ask a question on a refinement.
      operationId: create_refinement_question_api_v1_refinements__refinement_id__qa_post
      parameters:
        - in: path
          name: refinement_id
          required: true
          schema:
            title: Refinement Id
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RefinementQACreate'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RefinementQAResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - HTTPBearer: []
components:
  schemas:
    RefinementQACreate:
      description: Schema for creating a Q&A item on a refinement.
      properties:
        allow_free_text:
          default: false
          title: Allow Free Text
          type: boolean
        choices:
          anyOf:
            - items:
                $ref: '#/components/schemas/RefinementQAChoiceOption'
              type: array
            - type: 'null'
          title: Choices
        question:
          minLength: 1
          title: Question
          type: string
        question_type:
          default: text
          title: Question Type
          type: string
      required:
        - question
      title: RefinementQACreate
      type: object
    RefinementQAResponse:
      description: Schema for refinement Q&A response.
      properties:
        allow_free_text:
          default: false
          title: Allow Free Text
          type: boolean
        answer:
          anyOf:
            - type: string
            - type: 'null'
          title: Answer
        answered_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Answered At
        answered_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Answered By
        asked_by:
          title: Asked By
          type: string
        choices:
          anyOf:
            - items:
                $ref: '#/components/schemas/RefinementQAChoiceOption'
              type: array
            - type: 'null'
          title: Choices
        created_at:
          format: date-time
          title: Created At
          type: string
        id:
          title: Id
          type: string
        question:
          title: Question
          type: string
        question_type:
          default: text
          title: Question Type
          type: string
        refinement_id:
          title: Refinement Id
          type: string
        selected:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Selected
      required:
        - id
        - refinement_id
        - question
        - answer
        - asked_by
        - answered_by
        - created_at
        - answered_at
      title: RefinementQAResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    RefinementQAChoiceOption:
      description: A single option in a refinement Q&A choice question.
      properties:
        id:
          title: Id
          type: string
        label:
          title: Label
          type: string
      required:
        - id
        - label
      title: RefinementQAChoiceOption
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    HTTPBearer:
      scheme: bearer
      type: http

````