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

# Provide Feedback

> Provide feedback for a generation or a retrieval. Feedback can be used to track overall `Agent` performance through the `Feedback` page in the Contextual UI, and as a basis for model fine-tuning.



## OpenAPI

````yaml api-reference/openapi.json post /agents/{agent_id}/feedback
openapi: 3.1.0
info:
  title: Endpoints
  version: '1.0'
servers:
  - url: https://api.contextual.ai/v1
security:
  - BearerAuth: []
paths:
  /agents/{agent_id}/feedback:
    post:
      tags:
        - /agents/{id}/query
      summary: Provide Feedback
      description: >-
        Provide feedback for a generation or a retrieval. Feedback can be used
        to track overall `Agent` performance through the `Feedback` page in the
        Contextual UI, and as a basis for model fine-tuning.
      operationId: provide_feedback_agents__agent_id__feedback_post
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: ID of the agent for which to provide feedback
            title: Agent Id
          description: ID of the agent for which to provide feedback
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FeedbackRequestV0_1'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeedbackSubmitResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    FeedbackRequestV0_1:
      properties:
        message_id:
          type: string
          format: uuid
          title: Message ID
          description: ID of the message on which to provide feedback.
        feedback:
          $ref: '#/components/schemas/FeedbackStatus'
          title: Feedback
          description: >-
            Feedback to provide on the message. Set to "removed" to undo
            previously provided feedback.
        explanation:
          type: string
          title: Explanation
          description: Optional explanation for the feedback.
        content_id:
          type: string
          format: uuid
          title: Content ID
          description: >-
            ID of the content on which to provide feedback, if feedback is on
            retrieval. Do not set (or set to null) while providing generation
            feedback.
        query_category:
          type: string
          title: Query Category
          description: The query category for the feedback.
      additionalProperties: false
      type: object
      required:
        - message_id
        - feedback
      title: FeedbackRequestV0_1
      description: Input to POST feedback endpoint
    FeedbackSubmitResponse:
      properties:
        feedback_id:
          type: string
          format: uuid
          title: Feedback ID
          description: ID of the submitted or updated feedback.
      type: object
      required:
        - feedback_id
      title: FeedbackSubmitResponse
      description: Response schema for feedback submission endpoint.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    FeedbackStatus:
      type: string
      enum:
        - thumbs_up
        - thumbs_down
        - flagged
        - removed
      title: FeedbackStatus
    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:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key

````