> ## Documentation Index
> Fetch the complete documentation index at: https://docs.keenable.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Submit feedback

> Submit feedback on search results to improve relevance over time

Submit per-URL relevance scores after a search to improve result quality over time.

<CodeGroup>
  ```bash curl theme={null}
  curl -X POST "https://api.keenable.ai/v1/feedback" \
    -H "X-API-Key: <YOUR_API_KEY>" \
    -H "Content-Type: application/json" \
    -d '{
      "query": "typescript best practices",
      "feedback": {
        "https://example.com/ts-best-practices": 5,
        "https://example.com/old-js-guide": 1
      }
    }'
  ```

  ```python Python theme={null}
  import requests

  requests.post(
      "https://api.keenable.ai/v1/feedback",
      headers={"X-API-Key": "<YOUR_API_KEY>"},
      json={
          "query": "typescript best practices",
          "feedback": {
              "https://example.com/ts-best-practices": 5,
              "https://example.com/old-js-guide": 1,
          },
      },
  )
  ```

  ```typescript TypeScript theme={null}
  await fetch("https://api.keenable.ai/v1/feedback", {
    method: "POST",
    headers: {
      "X-API-Key": "<YOUR_API_KEY>",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      query: "typescript best practices",
      feedback: {
        "https://example.com/ts-best-practices": 5,
        "https://example.com/old-js-guide": 1,
      },
    }),
  });
  ```
</CodeGroup>

<Note>
  When using Keenable via MCP, the client agent will submit feedback automatically on search results, using its session context to score documents.
</Note>

## Request

<ParamField body="query" type="string" required>
  The original search query.
</ParamField>

<ParamField body="feedback" type="object" required>
  Map of URL to relevance score (0–5).
</ParamField>

<ParamField body="feedback_text" type="string">
  Additional feedback in free text.
</ParamField>

Score scale:

| Score | Meaning            |
| ----- | ------------------ |
| `0`   | Content not loaded |
| `1`   | Low relevance      |
| `2`   | Somewhat relevant  |
| `3`   | Relevant           |
| `4`   | Highly relevant    |
| `5`   | Perfect match      |

## Response

<ResponseField name="message" type="string">
  Confirmation message.
</ResponseField>

### Example

```json theme={null}
{
  "message": "Feedback submitted successfully"
}
```
