Submit answer feedback

Rates an answer Wren AI returned, or updates a rating you sent earlier

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

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

ParameterTypeRequiredDescription
answerIdstring (path)YesThe answerId of the answer being rated.
ratingstringYesup or down.
topicsstring[]NoWhat went wrong, from the topic list. Duplicates are ignored.
commentstringNoFree text from your user. At most 5,000 characters.
correctionstringNoWhat the right answer would have been. At most 5,000 characters.
metadataobjectNoYour 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.
feedbackIdstringNoOmit 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:

ValueMeaning
SQL_GENERATION_FAILEDSQL generation failed
INCORRECT_DATA_RETRIEVEDIncorrect data retrieved
INCORRECT_AI_SUMMARYIncorrect AI summary
FAILED_TO_ADHERE_INSTRUCTIONSFailed to follow instructions
FAILED_TO_ADHERE_SUMMARY_INSTRUCTIONSFailed to follow summary instructions
FAILED_TO_ADHERE_SQL_PAIRSFailed to follow question-SQL pairs
INCORRECT_CHART_DATAIncorrect chart data
INCORRECT_CHART_TYPEWrong chart type
CHART_GENERATION_FAILEDChart generation failed
DID_NOT_FOLLOW_CHART_INSTRUCTIONSDid not follow chart instructions
MISUNDERSTOOD_QUESTIONMisunderstood the question
ASKED_UNNECESSARY_CLARIFICATIONSAsked unnecessary clarifications
SHOULD_HAVE_ASKED_CLARIFICATIONShould have asked for clarification
WRONG_FILE_FORMATWrong file format
INCORRECT_FILE_CONTENTIncorrect file content
DOWNLOAD_FAILEDDownload failed
INCORRECT_OR_HALLUCINATED_ANSWERIncorrect or hallucinated answer
INCOMPLETE_ANSWERIncomplete answer
WRONG_APPROACH_OR_PLANWrong approach or plan
TOO_MANY_STEPSToo many steps
SKILL_MEMORY_ISSUESkill or memory issue
OTHEROther

A value outside this list returns 422 INVALID_INPUT. Anything the list does not cover belongs in comment.

Response Fields

FieldTypeDescription
feedbackIdstringIdentifies this feedback. Send it back as feedbackId to update it.
answerIdstringThe answer this feedback rates.
ratingstringup or down, as sent.
channelstringWhere the feedback came from. Always API on this endpoint.
createdAtstringWhen the feedback was first created (ISO 8601). An update keeps the original time.
updatedAtstringWhen 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, correction and metadata again if you want to keep them.
  • Only a feedbackId this endpoint returned, for the same answer, can be updated. Anything else returns 404 FEEDBACK_NOT_FOUND.
  • New feedback is not deduplicated. Sending the same request twice without a feedbackId creates two feedback records.

Sending answerId and feedbackId

Send 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.

StatusWhen
400The 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.
401Missing or invalid API key (UNAUTHORIZED_API_KEY), or the deployment's license is not valid (UNSUBSCRIBED_ACCESS). See below.
404The answer or the feedbackId was not found (ANSWER_NOT_FOUND, FEEDBACK_NOT_FOUND). See below.
405The method is not POST.
413The request body is larger than 1 MB. The response body is plain text.
422The answer cannot be rated, or a field breaks a rule (ANSWER_PREDATES_FEEDBACK, ANSWER_HAS_NO_TRACE, INVALID_INPUT). See below.
500Unexpected server error (INTERNAL_SERVER_ERROR).
502The feedback could not be saved (FEEDBACK_WRITE_FAILED). It may have been saved in part.
503Feedback 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

codeCauseWhat to do
UNAUTHORIZED_API_KEYThe Authorization header is missing, or the key is not a valid sk- or osk- key.Send a valid API key.
UNSUBSCRIBED_ACCESSThe 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

codeCauseWhat to do
ANSWER_NOT_FOUNDNo 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_FOUNDThe 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

codeCauseWhat to do
ANSWER_PREDATES_FEEDBACKThe answer was produced before this deployment supported feedback.Not retryable. Ask the question again and rate the new answer.
ANSWER_HAS_NO_TRACEThe call that produced this answerId failed before Wren AI recorded a trace, so there is nothing to attach feedback to.Not retryable.
INVALID_INPUTA 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 feedbackId on retry, so the answer may end up with two copies of it.
Path Params
string
required

The answerId returned by the call that produced the answer. Not the response id.

Body Params
string
enum
required
Allowed:
topics
array of strings

What went wrong. Duplicates are ignored.

topics
string | null

Free text from your user.

string | null

What the right answer would have been.

metadata
object | null

Your own key-value pairs, stored with the feedback. Keys are 1–64 characters; values are strings of at most 256 characters.

string | null

Omit or send null to create new feedback. Send a feedbackId this endpoint returned to update that feedback. Must not be an empty string.

Headers
string
enum
Defaults to application/json

Generated from available response content types

Allowed:
Responses

Language
Credentials
Bearer
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json
text/plain