GuidesRating answers

Rating answers

Help improve the bot by rating an answer. Flagging a bad answer genuinely helps — downvotes feed the operator’s review queue and the evaluation set.

Audience: developers wiring a thumbs-up/down control into a chat UI. What you will accomplish: submit feedback tied to a specific answer.

The endpoint

POST http://127.0.0.1:8000/api/v1/feedback
Content-Type: application/json

Submission is open — no API key needed. Include the correlation_id from the answer you are rating (returned in meta.correlation_id and the X-Correlation-Id header) so operators can trace it.

Request body

FieldTypeRequiredNotes
ratingup | downYesThe verdict.
reasonstringNoWhy — especially useful on downvotes.
correlation_idstringNoTies the feedback to a specific answer.
questionstringNoThe original question.
answerstringNoThe answer being rated.

Submit feedback

curl
curl -X POST http://127.0.0.1:8000/api/v1/feedback \
-H "Content-Type: application/json" \
-d '{"rating":"down","reason":"cited the wrong policy","correlation_id":"b1f3…",
     "question":"return window?","answer":"…"}'

If it fails: A 422 means the body failed validation — rating must be up or down.

Expected result

{ "feedback_id": "a1b2c3d4e5f6", "rating": "down", "status": "recorded" }

The status code is 201 Created.

Verify your result

  • Verify: The call returns 201 with a feedback_id and status: "recorded".
  • Verify: Downvotes include a correlation_id so operators can trace the answer.
  • Verify: Your UI reads X-Correlation-Id from the chat response and reuses it here.

Common mistakes and fixes

  • Missing or wrong rating → must be exactly up or down; otherwise 422.
  • No correlation_id → the feedback is still recorded, but operators cannot trace it back to a specific answer. Always include it when you have it.
  • Build the confidence display that motivates good feedback in Trust & citations.
  • Find the correlation_id in the response shape in Chatting.