Feedback REST API

Use this API to collect feedback about Cortex Agents from end users.

Collect feedback about a Cortex Agent

POST /api/v2/databases/{database}/schemas/{schema}/agents/{name}:feedback

Creates a feedback event for a Cortex Agent response.

Request

Path parameters

ParameterDescription
database(Required) Identifier for the database to which the resource belongs. You can use the /api/v2/databases GET request to get a list of available databases.
schema(Required) Identifier for the schema to which the resource belongs. You can use the /api/v2/databases/{database}/schemas GET request to get a list of available schemas for the specified database.
name(Required) Identifier for the agent.

Request headers

HeaderDescription
Authorization(Required) Authorization token. For more information, see Authentication.
Content-Type(Required) application/json

Request body

The request body contains the feedback details for the agent response.

FieldTypeDescription
orig_request_idstringRequest ID for the message associated with the feedback. If this value is not set, then feedback is logged for the agent.
positivebooleanWhether the response was good (true) or bad (false).
feedback_messagestringThe text for the detailed feedback message.
categoriesarray of stringsList of categories for the feedback. Each category is a string that represents a specific category of feedback.
thread_idintegerThe id of the thread.

Example request body for agent-level feedback

{
  "categories": [
    "Something worked well"
  ],
  "feedback_message": "this is fantastic!",
  "positive": true
}

Example request body for request-level feedback

{
  "orig_request_id": "aa123456-789a-a1-2a34-a1a234a56789",
  "categories": [
    "Something worked well"
  ],
  "feedback_message": "this is fantastic!",
  "positive": true
}

Response

A successful response returns a confirmation message.

Response headers

HeaderDescription
X-Snowflake-Request-IDUnique ID of the API request.

Response body

{
  "status": "Feedback submitted successfully"
}

View feedback for Cortex Agents

For information about required privileges and how to query feedback events (including example SQL), see View feedback provided by users.