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

# Submit Feedback Handler

> Create or update feedback on a knowledge entity (upsert).

Returns 201 when feedback is newly created, 200 when updated.
Validates that the target entity exists and the user can read it.



## OpenAPI

````yaml /openapi.yaml post /v1/feedback
openapi: 3.1.0
info:
  title: Knowledge Stack API
  description: Knowledge Stack backend API for authentication and knowledge management
  version: 0.1.0
servers:
  - url: http://localhost:8000
    description: Knowledge Stack API local dev server
security: []
tags:
  - name: auth
    description: Authentication and identity management
  - name: users
    description: User accounts
  - name: tenants
    description: Tenant management
  - name: invites
    description: Tenant invitations
  - name: folders
    description: Folder management
  - name: documents
    description: Document management
  - name: document-versions
    description: Document version management
  - name: sections
    description: Document sections
  - name: chunks
    description: Chunk CRUD and semantic search
  - name: chunk-lineages
    description: Chunk lineage tracking
  - name: tags
    description: Tag management
  - name: path-parts
    description: Path part traversal and tagging
  - name: Threads
    description: Thread conversations
  - name: Thread Messages
    description: Thread message management
  - name: user-permissions
    description: User path permissions
  - name: workflows
    description: Ingestion workflows
paths:
  /v1/feedback:
    post:
      tags:
        - Feedback
      summary: Submit Feedback Handler
      description: |-
        Create or update feedback on a knowledge entity (upsert).

        Returns 201 when feedback is newly created, 200 when updated.
        Validates that the target entity exists and the user can read it.
      operationId: submit_feedback
      parameters:
        - name: authorization
          in: header
          required: false
          schema:
            type: string
            nullable: true
            title: Authorization
        - name: ks_uat
          in: cookie
          required: false
          schema:
            type: string
            nullable: true
            title: Ks Uat
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitFeedbackRequest'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeedbackEventResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    SubmitFeedbackRequest:
      properties:
        target_type:
          $ref: '#/components/schemas/FeedbackTargetType'
        target_id:
          type: string
          format: uuid
          title: Target Id
        rating:
          $ref: '#/components/schemas/FeedbackRating'
        reason:
          $ref: '#/components/schemas/FeedbackReason'
          nullable: true
        comment:
          type: string
          maxLength: 4000
          nullable: true
          title: Comment
        extra_metadata:
          additionalProperties: true
          type: object
          nullable: true
          title: Extra Metadata
      additionalProperties: false
      type: object
      required:
        - target_type
        - target_id
        - rating
      title: SubmitFeedbackRequest
      description: Request to create or update feedback on a knowledge entity.
    FeedbackEventResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        target_type:
          $ref: '#/components/schemas/FeedbackTargetType'
        target_id:
          type: string
          format: uuid
          title: Target Id
        user_id:
          type: string
          format: uuid
          title: User Id
        rating:
          $ref: '#/components/schemas/FeedbackRating'
        reason:
          $ref: '#/components/schemas/FeedbackReason'
          nullable: true
        comment:
          type: string
          nullable: true
          title: Comment
        extra_metadata:
          additionalProperties: true
          type: object
          title: Extra Metadata
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      additionalProperties: false
      type: object
      required:
        - id
        - target_type
        - target_id
        - user_id
        - rating
        - reason
        - comment
        - extra_metadata
        - created_at
        - updated_at
      title: FeedbackEventResponse
      description: Response schema for a single FeedbackEvent.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    FeedbackTargetType:
      type: string
      enum:
        - THREAD
        - MESSAGE
        - DOCUMENT
        - DOCUMENT_VERSION
        - CHUNK
      title: FeedbackTargetType
    FeedbackRating:
      type: string
      enum:
        - UP
        - DOWN
      title: FeedbackRating
    FeedbackReason:
      type: string
      enum:
        - INCORRECT
        - MISSING_INFO
        - NOT_RELEVANT
        - BAD_CITATIONS
        - HALLUCINATION
        - OCR_ERROR
        - PARSING_ERROR
        - STRUCTURE_ISSUE
        - TABLE_ERROR
        - FORMATTING
        - OTHER
      title: FeedbackReason
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````