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

# Rate a Flexy reply

> Stores a like or dislike for one assistant reply. The first rating of a `message_key` is kept:
a repeated request returns 200 with the stored rating instead of changing it.



## OpenAPI

````yaml /api-referansi/openapi.json post /v1/flexy-chat/feedback
openapi: 3.1.0
info:
  title: Flextell API
  version: 0.0.1
  description: >-
    Flextell REST API referansı. Kimlik doğrulama, scope ve istek kuralları için
    API sekmesindeki rehberlere bakın.
servers:
  - url: https://app.flextell.ai/api
    description: Üretim
security:
  - oauth2: []
  - bearer: []
paths:
  /v1/flexy-chat/feedback:
    post:
      tags:
        - FlexyChat
        - FlexyChatApi
      summary: Rate a Flexy reply
      description: >-
        Stores a like or dislike for one assistant reply. The first rating of a
        `message_key` is kept:

        a repeated request returns 200 with the stored rating instead of
        changing it.
      operationId: flexy-chat.feedback
      parameters:
        - name: X-Tenant
          in: header
          required: true
          description: >-
            Tenant identifier. Send the Tenant ID in the `X-Tenant` header to
            scope API requests to a specific tenant.
          schema:
            type: number
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FlexyChatFeedbackStoreRequest'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: string
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '422':
          $ref: '#/components/responses/ValidationException'
        '428':
          description: >-
            Mandatory setup is incomplete. Finish the setup wizard first;
            `data.next_step` names the step to continue with.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    examples:
                      - false
                  error_code:
                    type: string
                    enum:
                      - SETUP_REQUIRED
                    examples:
                      - SETUP_REQUIRED
                  message:
                    type: string
                    examples:
                      - Complete the required setup steps to continue.
                  data:
                    type: object
                    properties:
                      next_step:
                        type:
                          - string
                          - 'null'
                        examples:
                          - clinic_info
                    required:
                      - next_step
                required:
                  - success
                  - error_code
                  - message
                  - data
components:
  schemas:
    FlexyChatFeedbackStoreRequest:
      type: object
      properties:
        message_key:
          type: string
          description: >-
            Client-generated key of the rated assistant reply (e.g. a UUID); one
            feedback is kept per key and the first one wins.
          maxLength: 100
        feedback_type:
          $ref: '#/components/schemas/FlexyChatFeedbackType'
          description: The rating of the reply.
        user_message:
          type: string
          description: The user prompt that produced the rated reply.
          maxLength: 20000
        assistant_message:
          type: string
          description: The rated assistant reply.
          maxLength: 20000
        model:
          type:
            - string
            - 'null'
          description: >-
            The model that produced the reply, as reported in the stream's
            `stream_start` event.
          maxLength: 100
      required:
        - message_key
        - feedback_type
        - user_message
        - assistant_message
      title: FlexyChatFeedbackStoreRequest
    FlexyChatFeedbackType:
      type: string
      enum:
        - good
        - bad
      title: FlexyChatFeedbackType
  responses:
    AuthenticationException:
      description: Unauthenticated
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
              - message
              - errors
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://app.flextell.ai/oauth/authorize
          tokenUrl: https://app.flextell.ai/oauth/token
          scopes:
            '*': all
    bearer:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.