curl --request POST \
--url https://api.devic.ai/v1/agents/threads/{threadId}/feedback \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"messageId": "msg-123456",
"feedback": true,
"feedbackComment": "This response was very helpful!",
"feedbackData": {
"rating": 5,
"categories": [
"helpful",
"accurate"
]
}
}
'import requests
url = "https://api.devic.ai/v1/agents/threads/{threadId}/feedback"
payload = {
"messageId": "msg-123456",
"feedback": True,
"feedbackComment": "This response was very helpful!",
"feedbackData": {
"rating": 5,
"categories": ["helpful", "accurate"]
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
messageId: 'msg-123456',
feedback: true,
feedbackComment: 'This response was very helpful!',
feedbackData: {rating: 5, categories: ['helpful', 'accurate']}
})
};
fetch('https://api.devic.ai/v1/agents/threads/{threadId}/feedback', 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://api.devic.ai/v1/agents/threads/{threadId}/feedback",
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([
'messageId' => 'msg-123456',
'feedback' => true,
'feedbackComment' => 'This response was very helpful!',
'feedbackData' => [
'rating' => 5,
'categories' => [
'helpful',
'accurate'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.devic.ai/v1/agents/threads/{threadId}/feedback"
payload := strings.NewReader("{\n \"messageId\": \"msg-123456\",\n \"feedback\": true,\n \"feedbackComment\": \"This response was very helpful!\",\n \"feedbackData\": {\n \"rating\": 5,\n \"categories\": [\n \"helpful\",\n \"accurate\"\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.devic.ai/v1/agents/threads/{threadId}/feedback")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"messageId\": \"msg-123456\",\n \"feedback\": true,\n \"feedbackComment\": \"This response was very helpful!\",\n \"feedbackData\": {\n \"rating\": 5,\n \"categories\": [\n \"helpful\",\n \"accurate\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devic.ai/v1/agents/threads/{threadId}/feedback")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"messageId\": \"msg-123456\",\n \"feedback\": true,\n \"feedbackComment\": \"This response was very helpful!\",\n \"feedbackData\": {\n \"rating\": 5,\n \"categories\": [\n \"helpful\",\n \"accurate\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"_id": "64f5a5b8c123456789abcdef",
"requestId": "msg-123456",
"creationTimestamp": "2024-01-15T10:30:00.000Z",
"threadId": "64f5a5b8c123456789abcdef",
"agentId": "64f5a5b8c123456789abcdef",
"feedback": true,
"feedbackComment": "This was very helpful!",
"feedbackData": {},
"lastEditTimestamp": "2024-01-15T11:00:00.000Z"
}Submit feedback for a thread message
Submits feedback (positive/negative) for a specific message in an agent thread. If feedback already exists for the message, it will be updated.
curl --request POST \
--url https://api.devic.ai/v1/agents/threads/{threadId}/feedback \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"messageId": "msg-123456",
"feedback": true,
"feedbackComment": "This response was very helpful!",
"feedbackData": {
"rating": 5,
"categories": [
"helpful",
"accurate"
]
}
}
'import requests
url = "https://api.devic.ai/v1/agents/threads/{threadId}/feedback"
payload = {
"messageId": "msg-123456",
"feedback": True,
"feedbackComment": "This response was very helpful!",
"feedbackData": {
"rating": 5,
"categories": ["helpful", "accurate"]
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
messageId: 'msg-123456',
feedback: true,
feedbackComment: 'This response was very helpful!',
feedbackData: {rating: 5, categories: ['helpful', 'accurate']}
})
};
fetch('https://api.devic.ai/v1/agents/threads/{threadId}/feedback', 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://api.devic.ai/v1/agents/threads/{threadId}/feedback",
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([
'messageId' => 'msg-123456',
'feedback' => true,
'feedbackComment' => 'This response was very helpful!',
'feedbackData' => [
'rating' => 5,
'categories' => [
'helpful',
'accurate'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.devic.ai/v1/agents/threads/{threadId}/feedback"
payload := strings.NewReader("{\n \"messageId\": \"msg-123456\",\n \"feedback\": true,\n \"feedbackComment\": \"This response was very helpful!\",\n \"feedbackData\": {\n \"rating\": 5,\n \"categories\": [\n \"helpful\",\n \"accurate\"\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.devic.ai/v1/agents/threads/{threadId}/feedback")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"messageId\": \"msg-123456\",\n \"feedback\": true,\n \"feedbackComment\": \"This response was very helpful!\",\n \"feedbackData\": {\n \"rating\": 5,\n \"categories\": [\n \"helpful\",\n \"accurate\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devic.ai/v1/agents/threads/{threadId}/feedback")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"messageId\": \"msg-123456\",\n \"feedback\": true,\n \"feedbackComment\": \"This response was very helpful!\",\n \"feedbackData\": {\n \"rating\": 5,\n \"categories\": [\n \"helpful\",\n \"accurate\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"_id": "64f5a5b8c123456789abcdef",
"requestId": "msg-123456",
"creationTimestamp": "2024-01-15T10:30:00.000Z",
"threadId": "64f5a5b8c123456789abcdef",
"agentId": "64f5a5b8c123456789abcdef",
"feedback": true,
"feedbackComment": "This was very helpful!",
"feedbackData": {},
"lastEditTimestamp": "2024-01-15T11:00:00.000Z"
}Authorizations
Use JWT token for authentication
Path Parameters
The unique identifier of the thread
Body
The unique message ID (uid) to submit feedback for
"msg-123456"
Feedback value: true = positive, false = negative
true
Optional comment explaining the feedback
"This response was very helpful!"
Optional additional structured feedback data
{
"rating": 5,
"categories": ["helpful", "accurate"]
}
Response
Feedback submitted successfully
Feedback ID
"64f5a5b8c123456789abcdef"
Message ID the feedback is for
"msg-123456"
Creation timestamp
"2024-01-15T10:30:00.000Z"
Thread ID
"64f5a5b8c123456789abcdef"
Agent ID
"64f5a5b8c123456789abcdef"
Feedback value
true
Feedback comment
"This was very helpful!"
Additional feedback data
Last edit timestamp
"2024-01-15T11:00:00.000Z"