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

# Submit or update feedback

> Upsert feedback for a turn. 201 created, 200 updated. 403 if session not owned, 404 if session/turn not found, 422 if rating invalid.



## OpenAPI

````yaml /openapi/em-talk2data-v2.yaml post /talk2data/chat/sessions/{session_id}/turns/{turn_id}/feedback
openapi: 3.1.0
info:
  title: Talk to Data Service
  version: 3.2.0-dev1
servers: []
security: []
paths:
  /talk2data/chat/sessions/{session_id}/turns/{turn_id}/feedback:
    post:
      tags:
        - chat-sessions
      summary: Submit or update feedback
      description: >-
        Upsert feedback for a turn. 201 created, 200 updated. 403 if session not
        owned, 404 if session/turn not found, 422 if rating invalid.
      operationId: >-
        submit_feedback_talk2data_chat_sessions__session_id__turns__turn_id__feedback_post
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            type: string
            description: Session ID
            title: Session Id
          description: Session ID
        - name: turn_id
          in: path
          required: true
          schema:
            type: string
            description: Turn ID
            title: Turn Id
          description: Turn ID
        - name: x-project-id
          in: header
          required: true
          schema:
            type: string
            description: Project identifier
            title: X-Project-Id
          description: Project identifier
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FeedbackSubmitRequest'
      responses:
        '200':
          description: Feedback updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeedbackResponse'
        '201':
          description: Feedback created
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    FeedbackSubmitRequest:
      properties:
        rating:
          type: string
          enum:
            - thumbs_up
            - thumbs_down
          title: Rating
          description: thumbs_up or thumbs_down
        comment:
          anyOf:
            - type: string
              maxLength: 2000
            - type: 'null'
          title: Comment
          description: Optional comment
      type: object
      required:
        - rating
      title: FeedbackSubmitRequest
      description: Request body for POST .../turns/{turn_id}/feedback.
    FeedbackResponse:
      properties:
        feedback_id:
          type: string
          title: Feedback Id
        turn_id:
          type: string
          title: Turn Id
        rating:
          type: string
          title: Rating
        comment:
          anyOf:
            - type: string
            - type: 'null'
          title: Comment
        created_at:
          type: string
          title: Created At
        updated_at:
          type: string
          title: Updated At
      type: object
      required:
        - feedback_id
        - turn_id
        - rating
        - comment
        - created_at
        - updated_at
      title: FeedbackResponse
      description: Feedback for a turn (POST 200/201, GET 200).
    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

````