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

# Answer with Quote



## OpenAPI

````yaml POST /query/answer-with-quote
openapi: 3.1.0
info:
  title: UtopikAI Backend
  version: 0.3-dev
servers: []
security: []
paths:
  /query/answer-with-quote:
    post:
      summary: Get Answer With Quote
      operationId: get_answer_with_quote_query_answer_with_quote_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DirectQARequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OneShotQAResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyCookie: []
components:
  schemas:
    DirectQARequest:
      properties:
        messages:
          items:
            $ref: '#/components/schemas/ThreadMessage'
          type: array
          title: Messages
        prompt_id:
          type: integer
          title: Prompt Id
        persona_id:
          type: integer
          title: Persona Id
        retrieval_options:
          $ref: '#/components/schemas/RetrievalDetails'
        chain_of_thought:
          type: boolean
          title: Chain Of Thought
          default: false
        return_contexts:
          type: boolean
          title: Return Contexts
          default: false
      type: object
      required:
        - messages
        - persona_id
      title: DirectQARequest
    OneShotQAResponse:
      properties:
        answer:
          type: string
          title: Answer
        rephrase:
          type: string
          title: Rephrase
        quotes:
          $ref: '#/components/schemas/UtopikAIQuotes'
        citations:
          items:
            $ref: '#/components/schemas/CitationInfo'
          type: array
          title: Citations
        docs:
          $ref: '#/components/schemas/QADocsResponse'
        llm_chunks_indices:
          items:
            type: integer
          type: array
          title: Llm Chunks Indices
        error_msg:
          type: string
          title: Error Msg
        answer_valid:
          type: boolean
          title: Answer Valid
          default: true
        chat_message_id:
          type: integer
          title: Chat Message Id
        contexts:
          $ref: '#/components/schemas/UtopikAIContexts'
      type: object
      title: OneShotQAResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ThreadMessage:
      properties:
        message:
          type: string
          title: Message
        sender:
          type: string
          title: Sender
        role:
          allOf:
            - $ref: '#/components/schemas/MessageType'
          default: user
      type: object
      required:
        - message
      title: ThreadMessage
    RetrievalDetails:
      properties:
        run_search:
          allOf:
            - $ref: '#/components/schemas/OptionalSearchSetting'
          default: always
        real_time:
          type: boolean
          title: Real Time
          default: true
        filters:
          $ref: '#/components/schemas/BaseFilters'
        enable_auto_detect_filters:
          type: boolean
          title: Enable Auto Detect Filters
        offset:
          type: integer
          title: Offset
        limit:
          type: integer
          title: Limit
      type: object
      title: RetrievalDetails
    UtopikAIQuotes:
      properties:
        quotes:
          items:
            $ref: '#/components/schemas/UtopikAIQuote'
          type: array
          title: Quotes
      type: object
      required:
        - quotes
      title: UtopikAIQuotes
    CitationInfo:
      properties:
        citation_num:
          type: integer
          title: Citation Num
        document_id:
          type: string
          title: Document Id
      type: object
      required:
        - citation_num
        - document_id
      title: CitationInfo
    QADocsResponse:
      properties:
        top_documents:
          items:
            $ref: '#/components/schemas/SavedSearchDoc'
          type: array
          title: Top Documents
        rephrased_query:
          type: string
          title: Rephrased Query
        predicted_flow:
          $ref: '#/components/schemas/QueryFlow'
        predicted_search:
          $ref: '#/components/schemas/SearchType'
        applied_source_filters:
          items:
            $ref: '#/components/schemas/DocumentSource'
          type: array
        applied_time_cutoff:
          type: string
          format: date-time
          title: Applied Time Cutoff
        recency_bias_multiplier:
          type: number
          title: Recency Bias Multiplier
      type: object
      required:
        - top_documents
        - recency_bias_multiplier
      title: QADocsResponse
    UtopikAIContexts:
      properties:
        contexts:
          items:
            $ref: '#/components/schemas/UtopikAIContext'
          type: array
          title: Contexts
      type: object
      required:
        - contexts
      title: UtopikAIContexts
    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
    MessageType:
      type: string
      enum:
        - system
        - user
        - assistant
      title: MessageType
      description: An enumeration.
    OptionalSearchSetting:
      type: string
      enum:
        - always
        - never
        - auto
      title: OptionalSearchSetting
      description: An enumeration.
    BaseFilters:
      properties:
        source_type:
          items:
            $ref: '#/components/schemas/DocumentSource'
          type: array
        document_set:
          items:
            type: string
          type: array
          title: Document Set
        time_cutoff:
          type: string
          format: date-time
          title: Time Cutoff
        tags:
          items:
            $ref: '#/components/schemas/Tag'
          type: array
          title: Tags
      type: object
      title: BaseFilters
    UtopikAIQuote:
      properties:
        quote:
          type: string
          title: Quote
        document_id:
          type: string
          title: Document Id
        link:
          type: string
          title: Link
        source_type:
          type: string
          title: Source Type
        semantic_identifier:
          type: string
          title: Semantic Identifier
        blurb:
          type: string
          title: Blurb
      type: object
      required:
        - quote
        - document_id
        - source_type
        - semantic_identifier
        - blurb
      title: UtopikAIQuote
    SavedSearchDoc:
      properties:
        document_id:
          type: string
          title: Document Id
        chunk_ind:
          type: integer
          title: Chunk Ind
        semantic_identifier:
          type: string
          title: Semantic Identifier
        link:
          type: string
          title: Link
        blurb:
          type: string
          title: Blurb
        source_type:
          $ref: '#/components/schemas/DocumentSource'
        boost:
          type: integer
          title: Boost
        hidden:
          type: boolean
          title: Hidden
        metadata:
          additionalProperties:
            anyOf:
              - type: string
              - items:
                  type: string
                type: array
          type: object
          title: Metadata
        score:
          type: number
          title: Score
          default: 0
        match_highlights:
          items:
            type: string
          type: array
          title: Match Highlights
        updated_at:
          type: string
          format: date-time
          title: Updated At
        primary_owners:
          items:
            type: string
          type: array
          title: Primary Owners
        secondary_owners:
          items:
            type: string
          type: array
          title: Secondary Owners
        db_doc_id:
          type: integer
          title: Db Doc Id
      type: object
      required:
        - document_id
        - chunk_ind
        - semantic_identifier
        - blurb
        - source_type
        - boost
        - hidden
        - metadata
        - match_highlights
        - db_doc_id
      title: SavedSearchDoc
    QueryFlow:
      type: string
      enum:
        - search
        - question-answer
      title: QueryFlow
      description: An enumeration.
    SearchType:
      type: string
      enum:
        - keyword
        - semantic
        - hybrid
      title: SearchType
      description: An enumeration.
    DocumentSource:
      type: string
      enum:
        - ingestion_api
        - slack
        - web
        - google_drive
        - gmail
        - requesttracker
        - github
        - gitlab
        - guru
        - bookstack
        - confluence
        - discourse
        - slab
        - salesforce
        - jira
        - productboard
        - file
        - notion
        - zulip
        - linear
        - hubspot
        - document360
        - gong
        - google_sites
        - zendesk
        - loopio
        - sharepoint
        - teams
        - freshdesk
        - fireflies
      title: DocumentSource
      description: An enumeration.
    UtopikAIContext:
      properties:
        content:
          type: string
          title: Content
        document_id:
          type: string
          title: Document Id
        semantic_identifier:
          type: string
          title: Semantic Identifier
        blurb:
          type: string
          title: Blurb
      type: object
      required:
        - content
        - document_id
        - semantic_identifier
        - blurb
      title: UtopikAIContext
    Tag:
      properties:
        tag_key:
          type: string
          title: Tag Key
        tag_value:
          type: string
          title: Tag Value
      type: object
      required:
        - tag_key
        - tag_value
      title: Tag
  securitySchemes:
    APIKeyCookie:
      type: apiKey
      in: cookie
      name: fastapiusersauth

````