> For the complete documentation index, see [llms.txt](https://docs.athenachat.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.athenachat.ai/api-reference/en/endpoints/answer-feedback.md).

# Answer feedback

Rate AI agent replies and teach the agent the right answers

Rate the AI agent's replies from your own tools — for example, from a quality-control dashboard. These endpoints work with **message IDs**, not chat IDs. Take the ID of an agent reply from `messages[].id` of a [`new_messages`](/api-reference/en/guides/webhooks.md#new_messages) webhook event with `role: assistant`.

Only AI agent replies can be rated.

## Mark a reply as correct

`GET /chats/chat/like`

Marks the agent's reply as correct. The mark is shown in the **Inbox**.

| Parameter   | Type   | Required | Description             |
| ----------- | ------ | -------- | ----------------------- |
| `messageId` | string | Yes      | ID of the agent's reply |

```bash
curl "https://hub.athenachat.ai/api/v1/chats/chat/like?messageId=e1c4a7b2-9f3d-4b6e-8c21-7a5d0f9e3b64" \
  -H "Authorization: YOUR_API_KEY"
```

`200 OK`

```json
{ "message": "Message liked" }
```

The mark is applied in the background. A reply that was already corrected can't be marked as correct.

## Correct a reply

`POST /chats/chat/dislike`

Marks the agent's reply as incorrect and saves the right answer to the knowledge base connected to the channel. The customer's question before the reply and your corrected answer are added as a question-and-answer pair, so the agent answers better next time.

The channel must have a knowledge base connected.

| Parameter   | Type   | Required | Description             |
| ----------- | ------ | -------- | ----------------------- |
| `messageId` | string | Yes      | ID of the agent's reply |
| `textEdit`  | string | Yes      | The correct answer      |

```bash
curl -X POST "https://hub.athenachat.ai/api/v1/chats/chat/dislike" \
  -H "Authorization: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "messageId": "e1c4a7b2-9f3d-4b6e-8c21-7a5d0f9e3b64",
    "textEdit": "We deliver on Saturdays from 10:00 to 16:00, and on Sundays by appointment."
  }'
```

`200 OK`

```json
{ "message": "Message disliked" }
```

A reply that was already marked as correct can't be corrected.

### Errors

| Status | `message`                      | What it means                                     |
| ------ | ------------------------------ | ------------------------------------------------- |
| `400`  | `Message not found`            | There's no message with this ID                   |
| `400`  | `Message already disliked`     | The reply has already been corrected              |
| `400`  | `Knowledge base not connected` | Connect a knowledge base to the channel in Athena |

See [Errors and limits](/api-reference/en/errors-and-limits.md) for the other errors.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.athenachat.ai/api-reference/en/endpoints/answer-feedback.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
