AIFeedbackAdd¶
POST ai/chat/feedback
Stores a rating for one answer. Rating the same message again replaces the previous rating — a user may change their mind, and two contradicting votes from one person would only distort the statistics.
Negative ratings with comments are the working list for improving prompts and the knowledge base, so the comment field is worth showing immediately rather than behind a second click.
Access Control¶
Allowed: client, manager, admin. Only messages of the current session.
Request¶
POST request
POST https://{broker_domain}/ai/chat/feedback
Authorization: <JWT_TOKEN>
Content-Type: application/json
{
"messageId": "msg_1c7…",
"rating": -1,
"comment": "Quoted the wrong threshold"
}
{
"command": "AIFeedbackAdd",
"extID": "1",
"data": { "messageId": "msg_1c7…", "rating": 1 }
}
await platform.AIFeedbackAdd({ messageId, rating: 1 });
Parameters¶
| Parameter | Type | Description |
|---|---|---|
messageId |
string | The assistant message being rated |
rating |
int | 1 or -1 |
comment |
string | Optional, up to 1024 characters |
accountLogin |
int | Account context. Required for a client session of an account owner |
Response Data¶
{ "messageId": "msg_1c7…", "rating": -1 }
Errors¶
| Code | Error | Description |
|---|---|---|
400 |
AI_INVALID_DATA |
No such message |
403 |
AI_ACCESS_DENIED |
The message belongs to another session |