Feedback REST API

Use this API to give collect for the performance of Cortex Agents.

Send feedback for Cortex Agent response

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

Creates a feedback event for a Cortex Agent response.

Request

Path parameters

Parameter

Description

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

Header

Description

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.

Field

Type

Description

request_id

string

Request ID associated with the feedback.

positive

boolean

Whether the response was good (true) or bad (false).

feedback_message

string

The text for the detailed feedback message.

categories

array of strings

List of categories for the feedback. Each category is a string that represents a specific category of feedback.

thread_id

integer

The id of the thread.

Example request body

{
 "message_id": "msg_001",
 "rating": "positive",
 "comment": "The answer was helpful and accurate."
}
Copy

Response

A successful response returns a confirmation message.

Response headers

Header

Description

X-Snowflake-Request-ID

Unique ID of the API request.

Response body

{
 "status": "Feedback submitted successfully"
}
Copy