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

# Upsert feedback

> Create or update feedback for a message or thread. For message feedback, provide message_id and use sentiment values of -1 (down) or 1 (up). For thread feedback, omit message_id and use sentiment values from 0 to 5.



## OpenAPI

````yaml openapi.json post /v1/feedback/
openapi: 3.1.0
info:
  title: Illumina Lab API
  description: AI-powered workflow orchestration API for building AI applications.
  version: 0.1.0
servers:
  - url: https://api.illuminalab.com
security: []
tags:
  - name: workflow
    description: Workflow execution endpoints for running AI conversations
  - name: resources
    description: Resource and thread management within specific resources
  - name: threads
    description: Direct thread access endpoints for the authenticated team
  - name: feedback
    description: Endpoints for providing feedback on AI responses and conversations
paths:
  /v1/feedback/:
    post:
      tags:
        - feedback
      summary: Upsert feedback
      description: >-
        Create or update feedback for a message or thread. For message feedback,
        provide message_id and use sentiment values of -1 (down) or 1 (up). For
        thread feedback, omit message_id and use sentiment values from 0 to 5.
      operationId: postV1Feedback
      parameters:
        - name: authorization
          in: header
          required: true
          schema:
            type: string
            pattern: ^Bearer [\s\S]{0,}$
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $schema: https://json-schema.org/draft/2020-12/schema
              type: object
              properties:
                id:
                  description: UUID of the feedback
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                thread_id:
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                  description: UUID of the thread
                message_id:
                  anyOf:
                    - type: string
                    - type: 'null'
                  description: UUID of the message
                sentiment:
                  type: number
                  minimum: -1
                  maximum: 5
                  description: >-
                    Sentiment rating; for messages, use -1 for down and 1 for
                    up. For threads, use a score from 0 to 5.
                comment:
                  anyOf:
                    - type: string
                    - type: 'null'
                  description: Optional feedback comment
                resource_id:
                  anyOf:
                    - type: string
                    - type: 'null'
                  description: Optional resource identifier
              required:
                - thread_id
                - message_id
                - sentiment
              additionalProperties: false
          application/x-www-form-urlencoded:
            schema:
              $schema: https://json-schema.org/draft/2020-12/schema
              type: object
              properties:
                id:
                  description: UUID of the feedback
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                thread_id:
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                  description: UUID of the thread
                message_id:
                  anyOf:
                    - type: string
                    - type: 'null'
                  description: UUID of the message
                sentiment:
                  type: number
                  minimum: -1
                  maximum: 5
                  description: >-
                    Sentiment rating; for messages, use -1 for down and 1 for
                    up. For threads, use a score from 0 to 5.
                comment:
                  anyOf:
                    - type: string
                    - type: 'null'
                  description: Optional feedback comment
                resource_id:
                  anyOf:
                    - type: string
                    - type: 'null'
                  description: Optional resource identifier
              required:
                - thread_id
                - message_id
                - sentiment
              additionalProperties: false
          multipart/form-data:
            schema:
              $schema: https://json-schema.org/draft/2020-12/schema
              type: object
              properties:
                id:
                  description: UUID of the feedback
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                thread_id:
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                  description: UUID of the thread
                message_id:
                  anyOf:
                    - type: string
                    - type: 'null'
                  description: UUID of the message
                sentiment:
                  type: number
                  minimum: -1
                  maximum: 5
                  description: >-
                    Sentiment rating; for messages, use -1 for down and 1 for
                    up. For threads, use a score from 0 to 5.
                comment:
                  anyOf:
                    - type: string
                    - type: 'null'
                  description: Optional feedback comment
                resource_id:
                  anyOf:
                    - type: string
                    - type: 'null'
                  description: Optional resource identifier
              required:
                - thread_id
                - message_id
                - sentiment
              additionalProperties: false
      responses:
        '200':
          description: Response for status 200
          content:
            application/json:
              schema:
                $schema: https://json-schema.org/draft/2020-12/schema
                type: object
                properties:
                  feedback:
                    type: object
                    properties:
                      id:
                        type: string
                        description: UUID of the feedback
                      thread_id:
                        type: string
                        format: uuid
                        pattern: >-
                          ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                        description: UUID of the thread
                      message_id:
                        anyOf:
                          - type: string
                          - type: 'null'
                        description: UUID of the message (null for thread-level feedback)
                      sentiment:
                        type: number
                        minimum: -1
                        maximum: 5
                        description: >-
                          Sentiment value: -1 (down), 1 (up) for messages; 0-5
                          for thread feedback
                      comment:
                        anyOf:
                          - type: string
                          - type: 'null'
                        description: Optional feedback comment
                      created_at:
                        type: string
                        description: ISO timestamp of creation
                      updated_at:
                        type: string
                        description: ISO timestamp of last update
                    required:
                      - id
                      - thread_id
                      - message_id
                      - sentiment
                      - comment
                      - created_at
                      - updated_at
                    additionalProperties: false
                    description: The feedback object
                required:
                  - feedback
                additionalProperties: false
        '401':
          description: Error response following IlluminaError format
          content:
            application/json:
              schema:
                $schema: https://json-schema.org/draft/2020-12/schema
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: >-
                          Error code in format 'type:surface' (e.g.,
                          'not_found:database')
                      message:
                        type: string
                        description: Human-readable error message
                      details:
                        description: Additional error context
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties:
                          $ref: '#/components/schemas/AnyValue'
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
                description: Error response following IlluminaError format
        '404':
          description: Error response following IlluminaError format
          content:
            application/json:
              schema:
                $schema: https://json-schema.org/draft/2020-12/schema
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: >-
                          Error code in format 'type:surface' (e.g.,
                          'not_found:database')
                      message:
                        type: string
                        description: Human-readable error message
                      details:
                        description: Additional error context
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties:
                          $ref: '#/components/schemas/AnyValue'
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
                description: Error response following IlluminaError format
        '500':
          description: Error response following IlluminaError format
          content:
            application/json:
              schema:
                $schema: https://json-schema.org/draft/2020-12/schema
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: >-
                          Error code in format 'type:surface' (e.g.,
                          'not_found:database')
                      message:
                        type: string
                        description: Human-readable error message
                      details:
                        description: Additional error context
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties:
                          $ref: '#/components/schemas/AnyValue'
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
                description: Error response following IlluminaError format
components:
  schemas:
    AnyValue:
      description: JSON-compatible value
      anyOf:
        - anyOf:
            - type: string
            - type: number
            - type: boolean
            - type: 'null'
        - type: array
          items:
            $ref: '#/components/schemas/AnyValue'
        - type: object
          propertyNames:
            type: string
          additionalProperties:
            $ref: '#/components/schemas/AnyValue'

````