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/jsonSubmission 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
| Field | Type | Required | Notes |
|---|---|---|---|
rating | up | down | Yes | The verdict. |
reason | string | No | Why — especially useful on downvotes. |
correlation_id | string | No | Ties the feedback to a specific answer. |
question | string | No | The original question. |
answer | string | No | The 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
201with afeedback_idandstatus: "recorded". - Verify: Downvotes include a
correlation_idso operators can trace the answer. - Verify: Your UI reads
X-Correlation-Idfrom the chat response and reuses it here.
Common mistakes and fixes
- Missing or wrong
rating→ must be exactlyupordown; otherwise422. - 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.
Related next steps
- Build the confidence display that motivates good feedback in Trust & citations.
- Find the
correlation_idin the response shape in Chatting.