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

# Feedback

> Give Snow Leopard feedback in plain text so it can understand your business logic and ontology better for more accurate answers

Use the Feedback API endpoint to teach Snow Leopard about your business logic, column definitions, and terminology. Feedback can be given at any time, in plain text, and is processed asynchronously to improve future query accuracy for your instance.

```python Python theme={null}
from snowleopard import SnowLeopardClient

client = SnowLeopardClient(api_key="{api_key}")
response = client.feedback(
    instance_id="{instance_id}",
    feedback_text="The revenue column should be labeled 'gross revenue before discounts'."
)
```


## OpenAPI

````yaml cloud_openapi.json POST /v1/instances/{instance_id}/feedback
openapi: 3.1.0
info:
  title: SnowLeopard API
  description: Natural language querying capabilities over structured data
  version: 1.0.0
servers:
  - url: https://api.snowleopard.ai
    description: Production server
security:
  - bearerAuth: []
paths:
  /v1/instances/{instance_id}/feedback:
    post:
      summary: Submit feedback
      description: >-
        Submit plain-text feedback to help Snow Leopard better understand your
        schema. Feedback is processed asynchronously and updates your instance's
        annotation. Corrections persist across sessions and improve future query
        results.
      operationId: submitFeedback
      parameters:
        - name: instance_id
          in: path
          required: true
          description: Unique identifier for the instance
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - feedbackText
              properties:
                feedbackText:
                  type: string
                  description: >-
                    Plain-text description of the correction. Maximum 2000
                    characters; longer values are silently truncated and the
                    response will include truncated: true.
                  example: >-
                    The revenue column in the orders table should be labeled
                    'gross revenue before discounts', not 'net revenue'.
                datasourceId:
                  type: string
                  format: uuid
                  description: >-
                    UUID of the target data source. Takes priority over schemaId
                    when both are provided. Recommended for instances with
                    multiple data sources.
                schemaId:
                  type: string
                  description: >-
                    Schema identifier for the target data source (e.g.
                    'northwind'). Available as the schemaId field in /retrieve
                    and /response results. Used when datasourceId is not
                    provided. If neither field is supplied, feedback is applied
                    to the first connected data source.
      responses:
        '202':
          description: Feedback accepted and queued for processing
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeedbackResponse'
        '400':
          description: Bad request (e.g. missing feedbackText)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
        '404':
          description: Instance or data source not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
        '422':
          description: Instance has no connected data source
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
        '500':
          description: Internal error submitting feedback to the processing pipeline
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
      x-codeSamples:
        - lang: Python
          label: Asynchronous
          source: |
            from snowleopard import AsyncSnowLeopardClient

            async def main():
                client = AsyncSnowLeopardClient(api_key="{api_key}")
                response = await client.feedback(
                    instance_id="{instance_id}",
                    feedback_text="The revenue column should be labeled 'gross revenue before discounts'."
                )
        - lang: Python
          label: Synchronous
          source: |
            from snowleopard import SnowLeopardClient

            client = SnowLeopardClient(api_key="{api_key}")
            response = client.feedback(
                instance_id="{instance_id}",
                feedback_text="The revenue column should be labeled 'gross revenue before discounts'."
            )
        - lang: TypeScript
          label: TypeScript
          source: |
            import { SnowLeopardClient } from '@snowleopard-ai/client';

            const client = new SnowLeopardClient({
                apiKey: 'your-api-key'
            });

            await client.feedback({
                instanceId: 'your-instance-id',
                feedbackText: "The revenue column should be labeled 'gross revenue before discounts'."
            });

            await client.close();
components:
  schemas:
    FeedbackResponse:
      type: object
      required:
        - ok
        - feedbackId
        - gateStatus
      properties:
        ok:
          type: boolean
          enum:
            - true
          description: Always true for a 202 response.
        feedbackId:
          type: string
          format: uuid
          description: Unique identifier for the submitted feedback
        gateStatus:
          type: string
          enum:
            - raw
          description: >-
            Acknowledgment state at submission time. Always 'raw'. Snow Leopard
            processes feedback asynchronously; there is no polling endpoint to
            track status changes.
        truncated:
          type: boolean
          description: >-
            Only present when feedbackText exceeded 2000 characters and was
            silently truncated to fit.
    APIError:
      type: object
      required:
        - __type__
        - callId
        - responseStatus
        - description
      properties:
        __type__:
          type: string
          enum:
            - apiError
          description: Type discriminator
        callId:
          type: string
          format: uuid
          description: Unique identifier for this API call
        responseStatus:
          type: string
          description: Status of the response
        description:
          type: string
          description: Error description
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: api_key
      description: >-
        Bearer authentication header of the form `Bearer <api_key>`. API keys
        are created per instance in Snow Leopard Cloud.

````