Rates an answer Wren AI returned, or updates a rating you sent earlier
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
The POST /v2/answers/{answerId}/feedback endpoint records your user's rating of an answer: thumbs up or down, optionally with topics that say what went wrong, a comment, and a correction.
Project availability: ✅ Classic projects • ✅ Agentic projects
Answer feedback is currently available on self-hosted Wren AI. Coming soon to Wren AI Cloud.
{answerId} is the answerId returned by the call that produced the answer — see Getting an answerId for where each endpoint returns it.
Basic Usage
Send the body as JSON with Content-Type: application/json. Only rating is required:
{
"rating": "up"
}{
"feedbackId": "b6e2d0f4-91a3-4c57-8e2b-5d7f1a9c3e60",
"answerId": "3f1c9a52-7d4e-4b8a-9c61-2e5f0b7a8d13",
"rating": "up",
"channel": "API",
"createdAt": "2026-10-27T08:15:30.412Z",
"updatedAt": "2026-10-27T08:15:30.412Z"
}A negative rating usually says more:
{
"rating": "down",
"topics": ["INCORRECT_DATA_RETRIEVED", "INCOMPLETE_ANSWER"],
"comment": "Cancelled orders are included in the total.",
"correction": "Exclude orders with order_status = 'canceled'.",
"metadata": {
"endUserId": "u-48213",
"screen": "sales-dashboard"
}
}Keep the feedbackId from the response if your user may change their rating later — see Updating feedback.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
answerId | string (path) | Yes | The answerId of the answer being rated. |
rating | string | Yes | up or down. |
topics | string[] | No | What went wrong, from the topic list. Duplicates are ignored. |
comment | string | No | Free text from your user. At most 5,000 characters. |
correction | string | No | What the right answer would have been. At most 5,000 characters. |
metadata | object | No | Your own key-value pairs, stored with the feedback. At most 10 keys; each key 1–64 characters, each value a string of at most 256 characters. |
feedbackId | string | No | Omit it, or send null, to create new feedback. Send a feedbackId this endpoint returned to update that feedback instead. Must not be an empty string. |
Sending null for an optional field is the same as leaving it out. Lengths are counted in UTF-16 code units, so some emoji count as two characters.
Topics
Any of these values is accepted on any answer:
| Value | Meaning |
|---|---|
SQL_GENERATION_FAILED | SQL generation failed |
INCORRECT_DATA_RETRIEVED | Incorrect data retrieved |
INCORRECT_AI_SUMMARY | Incorrect AI summary |
FAILED_TO_ADHERE_INSTRUCTIONS | Failed to follow instructions |
FAILED_TO_ADHERE_SUMMARY_INSTRUCTIONS | Failed to follow summary instructions |
FAILED_TO_ADHERE_SQL_PAIRS | Failed to follow question-SQL pairs |
INCORRECT_CHART_DATA | Incorrect chart data |
INCORRECT_CHART_TYPE | Wrong chart type |
CHART_GENERATION_FAILED | Chart generation failed |
DID_NOT_FOLLOW_CHART_INSTRUCTIONS | Did not follow chart instructions |
MISUNDERSTOOD_QUESTION | Misunderstood the question |
ASKED_UNNECESSARY_CLARIFICATIONS | Asked unnecessary clarifications |
SHOULD_HAVE_ASKED_CLARIFICATION | Should have asked for clarification |
WRONG_FILE_FORMAT | Wrong file format |
INCORRECT_FILE_CONTENT | Incorrect file content |
DOWNLOAD_FAILED | Download failed |
INCORRECT_OR_HALLUCINATED_ANSWER | Incorrect or hallucinated answer |
INCOMPLETE_ANSWER | Incomplete answer |
WRONG_APPROACH_OR_PLAN | Wrong approach or plan |
TOO_MANY_STEPS | Too many steps |
SKILL_MEMORY_ISSUE | Skill or memory issue |
OTHER | Other |
A value outside this list returns 422 INVALID_INPUT. Anything the list does not cover belongs in comment.
Response Fields
| Field | Type | Description |
|---|---|---|
feedbackId | string | Identifies this feedback. Send it back as feedbackId to update it. |
answerId | string | The answer this feedback rates. |
rating | string | up or down, as sent. |
channel | string | Where the feedback came from. Always API on this endpoint. |
createdAt | string | When the feedback was first created (ISO 8601). An update keeps the original time. |
updatedAt | string | When this call was handled (ISO 8601). |
Updating feedback
Send the same request again with the feedbackId you received, and that feedback is overwritten — no second feedback is created:
{
"feedbackId": "b6e2d0f4-91a3-4c57-8e2b-5d7f1a9c3e60",
"rating": "down",
"topics": ["INCORRECT_DATA_RETRIEVED"]
}{
"feedbackId": "b6e2d0f4-91a3-4c57-8e2b-5d7f1a9c3e60",
"answerId": "3f1c9a52-7d4e-4b8a-9c61-2e5f0b7a8d13",
"rating": "down",
"channel": "API",
"createdAt": "2026-10-27T08:15:30.412Z",
"updatedAt": "2026-10-27T09:02:11.087Z"
}- An update replaces the whole feedback. Fields you leave out are cleared, not kept — send
comment,correctionandmetadataagain if you want to keep them. - Only a
feedbackIdthis endpoint returned, for the same answer, can be updated. Anything else returns404FEEDBACK_NOT_FOUND. - New feedback is not deduplicated. Sending the same request twice without a
feedbackIdcreates two feedback records.
Sending answerId and feedbackId
answerId and feedbackIdSend answerId and feedbackId back exactly as Wren AI returned them. Both are compared as given, not case-folded: Wren AI returns them in lower case, and a value sent in a different case is not found (404).
Send the answerId, not the response id. Only an answerId identifies an answer.
Error handling
Error bodies carry code and error. Unlike most endpoints, they carry no id:
{
"code": "INVALID_INPUT",
"error": "rating is required and must be 'up' or 'down'"
}Three responses differ: 405 returns only error, and 400 (a body that is not valid JSON) and 413 (a body over 1 MB) return a plain-text body instead of JSON.
| Status | When |
|---|---|
400 | The request body is sent as application/json but is not valid JSON. The response body is the plain text Invalid JSON. A body sent without that Content-Type is not read as JSON and gets 422 INVALID_INPUT instead. |
401 | Missing or invalid API key (UNAUTHORIZED_API_KEY), or the deployment's license is not valid (UNSUBSCRIBED_ACCESS). See below. |
404 | The answer or the feedbackId was not found (ANSWER_NOT_FOUND, FEEDBACK_NOT_FOUND). See below. |
405 | The method is not POST. |
413 | The request body is larger than 1 MB. The response body is plain text. |
422 | The answer cannot be rated, or a field breaks a rule (ANSWER_PREDATES_FEEDBACK, ANSWER_HAS_NO_TRACE, INVALID_INPUT). See below. |
500 | Unexpected server error (INTERNAL_SERVER_ERROR). |
502 | The feedback could not be saved (FEEDBACK_WRITE_FAILED). It may have been saved in part. |
503 | Feedback storage is not configured on this deployment (FEEDBACK_NOT_CONFIGURED). Contact your administrator. |
Checks run in this order, so a request with several problems gets the error of the first one: body size, JSON parsing, method, API key, answer lookup, license, feedback storage, whether the answer can be rated, request fields, feedbackId lookup, saving.
Telling the two 401s apart
code | Cause | What to do |
|---|---|---|
UNAUTHORIZED_API_KEY | The Authorization header is missing, or the key is not a valid sk- or osk- key. | Send a valid API key. |
UNSUBSCRIBED_ACCESS | The license of this self-hosted deployment has expired or is not valid. The error text reads Unauthorized: Organization is not subscribed. | Contact your administrator to renew the license. |
Telling the two 404s apart
code | Cause | What to do |
|---|---|---|
ANSWER_NOT_FOUND | No answer with this answerId is visible to this key. Either it does not exist, it belongs to a project the key cannot access (an sk- key sees its own project; an osk- key sees its own organization), or the value is not an answerId — such as the id returned by run_sql. | Check that you sent the answerId exactly as returned, with a key for the answer's project. |
FEEDBACK_NOT_FOUND | The feedbackId does not exist, belongs to another answer, or was not created by this endpoint. | Send the feedbackId this endpoint returned for this answer, or omit it to create new feedback. |
Telling the three 422s apart
code | Cause | What to do |
|---|---|---|
ANSWER_PREDATES_FEEDBACK | The answer was produced before this deployment supported feedback. | Not retryable. Ask the question again and rate the new answer. |
ANSWER_HAS_NO_TRACE | The call that produced this answerId failed before Wren AI recorded a trace, so there is nothing to attach feedback to. | Not retryable. |
INVALID_INPUT | A field breaks a rule. error describes the problem, usually naming the field; only the first problem is reported. | Fix the request and send it again. |
Retrying a 502
FEEDBACK_WRITE_FAILED is retryable, but the feedback may already be partly saved:
- An update can be retried safely with the same
feedbackId; the retry overwrites the same feedback. - New feedback gets a new
feedbackIdon retry, so the answer may end up with two copies of it.
