Submit feedback on a conversation
curl --request PUT \
--url https://api.clarityq.ai/api/v1/products/{product_id}/conversations/{conversation_id}/feedback \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"comment": "<string>"
}
'import requests
url = "https://api.clarityq.ai/api/v1/products/{product_id}/conversations/{conversation_id}/feedback"
payload = { "comment": "<string>" }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({comment: '<string>'})
};
fetch('https://api.clarityq.ai/api/v1/products/{product_id}/conversations/{conversation_id}/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.clarityq.ai/api/v1/products/{product_id}/conversations/{conversation_id}/feedback",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'comment' => '<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://api.clarityq.ai/api/v1/products/{product_id}/conversations/{conversation_id}/feedback"
payload := strings.NewReader("{\n \"comment\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.clarityq.ai/api/v1/products/{product_id}/conversations/{conversation_id}/feedback")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"comment\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.clarityq.ai/api/v1/products/{product_id}/conversations/{conversation_id}/feedback")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"comment\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"conversation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"updated_at": "2023-11-07T05:31:56Z",
"rating": "<string>",
"comment": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}API Reference
Submit Feedback
Submit or replace the rating and/or comment on the conversation’s latest answer. The feedback is stored on the answer exactly like the in-app rating, so API and in-app feedback are interchangeable. The conversation must be COMPLETED. The call is idempotent: a repeat call fully replaces prior feedback. At least one of rating or comment is required.
PUT
/
api
/
v1
/
products
/
{product_id}
/
conversations
/
{conversation_id}
/
feedback
Submit feedback on a conversation
curl --request PUT \
--url https://api.clarityq.ai/api/v1/products/{product_id}/conversations/{conversation_id}/feedback \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"comment": "<string>"
}
'import requests
url = "https://api.clarityq.ai/api/v1/products/{product_id}/conversations/{conversation_id}/feedback"
payload = { "comment": "<string>" }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({comment: '<string>'})
};
fetch('https://api.clarityq.ai/api/v1/products/{product_id}/conversations/{conversation_id}/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.clarityq.ai/api/v1/products/{product_id}/conversations/{conversation_id}/feedback",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'comment' => '<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://api.clarityq.ai/api/v1/products/{product_id}/conversations/{conversation_id}/feedback"
payload := strings.NewReader("{\n \"comment\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.clarityq.ai/api/v1/products/{product_id}/conversations/{conversation_id}/feedback")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"comment\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.clarityq.ai/api/v1/products/{product_id}/conversations/{conversation_id}/feedback")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"comment\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"conversation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"updated_at": "2023-11-07T05:31:56Z",
"rating": "<string>",
"comment": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Submit or replace feedback — a thumbs rating and/or a free-text comment — on a conversation’s
latest answer. The feedback is stored on the answer exactly like the in-app 👍 / 👎, so
feedback left through the API and through the ClarityQ app are interchangeable and appear in the
same places.
You only pass the
conversation_id: the server resolves which answer to rate from the
conversation’s latest message. The conversation must be completed — submitting before the
answer is ready returns 409.
The call is idempotent: submitting again fully replaces the previous feedback for that
answer. Provide at least one of rating or comment; send "rating": null to clear a rating.
Example request
PUT /api/v1/products/{product_id}/conversations/{conversation_id}/feedback
Content-Type: application/json
{
"rating": "POSITIVE",
"comment": "Matched our dashboard exactly."
}
Example response
{
"conversation_id": "9f1c2b4a-3d5e-4f6a-8b7c-1d2e3f4a5b6c",
"rating": "POSITIVE",
"comment": "Matched our dashboard exactly.",
"updated_at": "2026-07-01T12:34:56Z"
}
Authorizations
API key obtained from the ClarityQ dashboard.
Body
application/json
Response
Successful Response
The feedback stored on an answer (its metadata.rating).