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

# Submit Feedback

> Submit or replace the rating and/or comment on the conversation's latest answer. The feedback is stored on the answer exactly like the in-app rating, so API and in-app feedback are interchangeable. The conversation must be COMPLETED. The call is idempotent: a repeat call fully replaces prior feedback. At least one of rating or comment is required.

Submit or replace feedback — a thumbs rating and/or a free-text comment — on a conversation's
**latest answer**. The feedback is stored on the answer exactly like the in-app 👍 / 👎, so
feedback left through the API and through the ClarityQ app are interchangeable and appear in the
same places.

You only pass the `conversation_id`: the server resolves which answer to rate from the
conversation's latest message. The conversation must be **completed** — submitting before the
answer is ready returns `409`.

The call is **idempotent**: submitting again fully replaces the previous feedback for that
answer. Provide at least one of `rating` or `comment`; send `"rating": null` to clear a rating.

```text Example request theme={null}
PUT /api/v1/products/{product_id}/conversations/{conversation_id}/feedback
Content-Type: application/json

{
  "rating": "POSITIVE",
  "comment": "Matched our dashboard exactly."
}
```

```json Example response theme={null}
{
  "conversation_id": "9f1c2b4a-3d5e-4f6a-8b7c-1d2e3f4a5b6c",
  "rating": "POSITIVE",
  "comment": "Matched our dashboard exactly.",
  "updated_at": "2026-07-01T12:34:56Z"
}
```


## OpenAPI

````yaml put /api/v1/products/{product_id}/conversations/{conversation_id}/feedback
openapi: 3.1.0
info:
  title: ClarityQ API
  description: ClarityQ API, authenticated via API keys.
  version: 1.0.0
servers:
  - url: https://api.clarityq.ai
    description: Production
security:
  - ApiKeyAuth: []
paths:
  /api/v1/products/{product_id}/conversations/{conversation_id}/feedback:
    put:
      tags:
        - API
      summary: Submit feedback on a conversation
      description: >-
        Submit or replace the rating and/or comment on the conversation's latest
        answer. The feedback is stored on the answer exactly like the in-app
        rating, so API and in-app feedback are interchangeable. The conversation
        must be COMPLETED. The call is idempotent: a repeat call fully replaces
        prior feedback. At least one of rating or comment is required.
      operationId: >-
        submit_conversation_feedback_api_v1_products__product_id__conversations__conversation_id__feedback_put
      parameters:
        - name: product_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Product Id
        - name: conversation_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Conversation Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FeedbackRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeedbackResponse'
        '409':
          description: Conversation is not completed yet; there is no answer to rate.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    FeedbackRequest:
      properties:
        rating:
          anyOf:
            - $ref: '#/components/schemas/FeedbackRating'
            - type: 'null'
          description: >-
            Thumbs rating on the answer (POSITIVE or NEGATIVE). null clears the
            rating.
        comment:
          anyOf:
            - type: string
              maxLength: 2000
            - type: 'null'
          title: Comment
          description: Optional free-text comment on the answer.
      type: object
      title: FeedbackRequest
      description: Feedback to set on an answer; written to the answer's metadata.rating.
    FeedbackResponse:
      properties:
        conversation_id:
          type: string
          format: uuid
          title: Conversation Id
          description: Conversation the answer belongs to.
        rating:
          anyOf:
            - type: string
            - type: 'null'
          title: Rating
          description: POSITIVE or NEGATIVE; null if comment-only.
        comment:
          anyOf:
            - type: string
            - type: 'null'
          title: Comment
          description: The comment, if any.
        updated_at:
          type: string
          format: date-time
          title: Updated At
          description: When the feedback was last set (RFC3339 UTC).
      type: object
      required:
        - conversation_id
        - updated_at
      title: FeedbackResponse
      description: The feedback stored on an answer (its metadata.rating).
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    FeedbackRating:
      type: string
      enum:
        - POSITIVE
        - NEGATIVE
      title: FeedbackRating
      description: Thumbs rating a user leaves on an answer.
    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:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key obtained from the ClarityQ dashboard.

````