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

# Update product context based on user feedback

> Merge user-supplied feedback into a product's optimization-notes context. The notes have a prose body plus a capped audit trail of recent corrections — both are managed for you. Returns a short summary of what changed; the full notes are not echoed back. Available on all plans.



## OpenAPI

````yaml https://www.greenflash.ai/api/openapi patch /products/{productId}/context
openapi: 3.1.0
info:
  title: Greenflash API Reference
  version: 1.0.0
  description: >-
    Greenflash endpoints for capturing interactions, managing prompts, and
    identifying users.
servers:
  - url: https://www.greenflash.ai/api/v1
    description: Greenflash API v1
security: []
tags:
  - name: Interactions
    description: Capture interactions between users and AI
  - name: Business Events
    description: Capture business events
  - name: Analytics
    description: Understand chat and agentic interactions analyses
  - name: Inbox
    description: Review flagged conversations
  - name: Segments
    description: Manage user segments
  - name: Prompts
    description: Manage prompts
  - name: Chat
    description: Stream chat and agentic conversations
  - name: Models
    description: Manage AI models
  - name: Products
    description: Manage products
  - name: Users
    description: Manage users
  - name: Organizations
    description: Manage organizations
paths:
  /products/{productId}/context:
    patch:
      tags:
        - Products
      summary: Update product context based on user feedback
      description: >-
        Merge user-supplied feedback into a product's optimization-notes
        context. The notes have a prose body plus a capped audit trail of recent
        corrections — both are managed for you. Returns a short summary of what
        changed; the full notes are not echoed back. Available on all plans.
      parameters:
        - schema:
            type: string
            format: uuid
            description: The product ID whose context notes should be updated.
          required: true
          description: The product ID whose context notes should be updated.
          name: productId
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateProductContextRequest'
            example:
              feedback: >-
                Users on the enterprise plan should always be routed to a human
                agent for billing questions.
              source: conversation 123e4567-e89b-12d3-a456-426614174000
      responses:
        '200':
          description: Product context updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateProductContextResponse'
              example:
                productId: 123e4567-e89b-12d3-a456-426614174000
                summary: >-
                  Added rule routing enterprise-plan billing questions to a
                  human agent.
                updatedAt: '2026-04-26T18:30:00Z'
        '400':
          description: Invalid request - validation error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Whether the API call was successful (false for errors).
                  error:
                    type: string
                    description: Error message describing what went wrong.
                description: Error response for update product context operations.
              example:
                success: false
                error: 'Validation error: feedback is required'
        '404':
          description: Product not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Whether the API call was successful (false for errors).
                  error:
                    type: string
                    description: Error message describing what went wrong.
                description: Error response for update product context operations.
              example:
                success: false
                error: Product not found
        '500':
          description: Server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Whether the API call was successful (false for errors).
                  error:
                    type: string
                    description: Error message describing what went wrong.
                description: Error response for update product context operations.
      security:
        - bearerAuth: []
components:
  schemas:
    UpdateProductContextRequest:
      type: object
      properties:
        feedback:
          type: string
          minLength: 1
          maxLength: 4000
          description: >-
            The user-provided correction or context, in their words. Pass
            exactly what the user said (or a faithful summary of multiple turns)
            — do not pre-edit or generalize.
        source:
          type:
            - string
            - 'null'
          maxLength: 200
          description: >-
            Optional reference to what triggered this update (e.g. "conversation
            abc-123"). Pass null or omit if there is no specific source.
      required:
        - feedback
    UpdateProductContextResponse:
      type: object
      properties:
        productId:
          type: string
          format: uuid
          description: The product ID that was updated.
        summary:
          type: string
          description: Short human-readable summary of what changed in the notes.
        updatedAt:
          type: string
          description: When the notes were updated (ISO 8601).
      required:
        - productId
        - summary
        - updatedAt
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````