Skip to main content
POST
/
api
/
v1
/
feedback
/
chat
Create Chat Message Feedback
curl --request POST \
  --url https://agent-studio.thena.ai/api/v1/feedback/chat \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "message_id": "<string>",
  "source": "<string>",
  "feedback_details": {
    "issue_type": "<string>",
    "comment": "<string>",
    "context_id": "<string>"
  }
}
'
import requests

url = "https://agent-studio.thena.ai/api/v1/feedback/chat"

payload = {
"message_id": "<string>",
"source": "<string>",
"feedback_details": {
"issue_type": "<string>",
"comment": "<string>",
"context_id": "<string>"
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
message_id: '<string>',
source: '<string>',
feedback_details: {issue_type: '<string>', comment: '<string>', context_id: '<string>'}
})
};

fetch('https://agent-studio.thena.ai/api/v1/feedback/chat', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://agent-studio.thena.ai/api/v1/feedback/chat",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'message_id' => '<string>',
'source' => '<string>',
'feedback_details' => [
'issue_type' => '<string>',
'comment' => '<string>',
'context_id' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://agent-studio.thena.ai/api/v1/feedback/chat"

payload := strings.NewReader("{\n \"message_id\": \"<string>\",\n \"source\": \"<string>\",\n \"feedback_details\": {\n \"issue_type\": \"<string>\",\n \"comment\": \"<string>\",\n \"context_id\": \"<string>\"\n }\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://agent-studio.thena.ai/api/v1/feedback/chat")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"message_id\": \"<string>\",\n \"source\": \"<string>\",\n \"feedback_details\": {\n \"issue_type\": \"<string>\",\n \"comment\": \"<string>\",\n \"context_id\": \"<string>\"\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://agent-studio.thena.ai/api/v1/feedback/chat")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"message_id\": \"<string>\",\n \"source\": \"<string>\",\n \"feedback_details\": {\n \"issue_type\": \"<string>\",\n \"comment\": \"<string>\",\n \"context_id\": \"<string>\"\n }\n}"

response = http.request(request)
puts response.read_body
{
  "portkey_trace_id": "<string>",
  "user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "human_message_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "ai_message_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "flow_execution_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "issue_type": "<string>",
  "comment": "<string>",
  "portkey_synced": false,
  "portkey_sync_timestamp": "2023-11-07T05:31:56Z",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z"
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}

Authorizations

x-api-key
string
header
required

Body

application/json

Model for creating feedback.

message_id
string
required
source
string
required

The source of the feedback, e.g., 'chat' or 'flow'

feedback_details
ChatMessageFeedbackUpdate · object
required

Model for updating chat message feedback.

Response

Successful Response

Model for chat message feedback.

portkey_trace_id
string
required
user_id
string<uuid>
required
organization_id
string<uuid>
required
id
string<uuid> | null
human_message_id
string<uuid> | null
ai_message_id
string<uuid> | null
flow_execution_id
string<uuid> | null
feedback_type
enum<string> | null

Enum for feedback types.

Available options:
positive,
negative
issue_type
string | null
comment
string | null
portkey_synced
boolean
default:false
portkey_sync_timestamp
string<date-time> | null
created_at
string<date-time> | null
updated_at
string<date-time> | null