Submit feedback on an agent message
curl --request POST \
--url https://{host}/v2/workspaces/slug:ai-insights-v2/webhooks/v1/feedback \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"vote": "dislike",
"task_id": "task_789",
"message_id": "msg_42",
"context_id": "ctx_123",
"agent_id": "agt_abc"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
vote: 'dislike',
task_id: 'task_789',
message_id: 'msg_42',
context_id: 'ctx_123',
agent_id: 'agt_abc'
})
};
fetch('https://{host}/v2/workspaces/slug:ai-insights-v2/webhooks/v1/feedback', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{host}/v2/workspaces/slug:ai-insights-v2/webhooks/v1/feedback"
payload = {
"vote": "dislike",
"task_id": "task_789",
"message_id": "msg_42",
"context_id": "ctx_123",
"agent_id": "agt_abc"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"vote": "like",
"category": "incorrect_incomplete",
"updated": true
}{
"error": "<string>",
"message": "<string>"
}{
"error": "UNAUTHORIZED",
"message": "Authentication required"
}{
"error": "FORBIDDEN",
"message": "Access denied: missing permission 'ai-insights-v2:analytics:read'"
}{
"error": "TooManyRequests",
"message": "Too many requests for 'Insights'",
"details": {
"name": "Insights",
"ok": false,
"retryAfter": 42.5,
"limit": 100,
"window": 60,
"remaining": 0
}
}Feedback
Submit feedback on an agent message
Records a like or dislike on an agent message. There is one feedback
per message: submitting again for the same task_id + message_id
replaces the previous vote. category is only accepted on dislikes;
omit it rather than sending null.
Requires ai-insights-v2:feedback (write). Rate limit: 50
requests per minute.
POST
/
v1
/
feedback
Submit feedback on an agent message
curl --request POST \
--url https://{host}/v2/workspaces/slug:ai-insights-v2/webhooks/v1/feedback \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"vote": "dislike",
"task_id": "task_789",
"message_id": "msg_42",
"context_id": "ctx_123",
"agent_id": "agt_abc"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
vote: 'dislike',
task_id: 'task_789',
message_id: 'msg_42',
context_id: 'ctx_123',
agent_id: 'agt_abc'
})
};
fetch('https://{host}/v2/workspaces/slug:ai-insights-v2/webhooks/v1/feedback', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{host}/v2/workspaces/slug:ai-insights-v2/webhooks/v1/feedback"
payload = {
"vote": "dislike",
"task_id": "task_789",
"message_id": "msg_42",
"context_id": "ctx_123",
"agent_id": "agt_abc"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"vote": "like",
"category": "incorrect_incomplete",
"updated": true
}{
"error": "<string>",
"message": "<string>"
}{
"error": "UNAUTHORIZED",
"message": "Authentication required"
}{
"error": "FORBIDDEN",
"message": "Access denied: missing permission 'ai-insights-v2:analytics:read'"
}{
"error": "TooManyRequests",
"message": "Too many requests for 'Insights'",
"details": {
"name": "Insights",
"ok": false,
"retryAfter": 42.5,
"limit": 100,
"window": 60,
"remaining": 0
}
}Authorizations
BearerAuthOrgApiKeyAuth
Body
application/json
Was this page helpful?