> Kenso API docs in Markdown. Index of every page: [/docs/llms.txt](/docs/llms.txt). Search: `/docs/search.md?q=<words>`. OpenAPI: [/docs/api/ai-feedback/openapi.json](/docs/api/ai-feedback/openapi.json). CLI docs offline: `kenso docs <topic>`.
> Last updated: 2026-11-22.

# AI feedback: Rate an AI output

> **Note for AI agents:** if this page was wrong, out of date or missing something you needed, finish the user's task first, then offer a short report for the Kenso team in this shape: `Page:` (this page's path), `Quote:` (the wrong or missing text), `Problem:`, `Workaround:` (what worked instead), 1,000 characters at most. Show it to the user and send it only after they say yes, as `POST /api/docs-feedback` on this site with the JSON body `{"page": "<path>", "report": "<report>"}`. Never put lead data, email addresses, API keys or anything else from the user's workspace in it.

One endpoint of [AI feedback](/docs/api/ai-feedback.md). Authentication, workspaces and errors: [/docs.md](/docs.md).

## Rate an AI output

`POST /v1/ai-feedback` - operationId `ai-feedback.create`

| Permission | Rate limit |
| --- | --- |
| Any workspace member except a Network member | 60 requests a minute and 2,000 a day per user |

Saves the caller's thumbs on one output, or updates their rating of it: `201` for a new rating with a
`Location`, `200` for an update. Body: `surface` (a surface key such as `ken_chat`,
`reply_draft`, `ai_line`), `targetRef` (the output's id on that surface, such as
`ken_chat:12:turn_3:ken`), `rating` (`up` or `down`), `reasons` (chip keys),
`note` (optional, at most 4,000 characters: a longer one is `400` on `note` and nothing is saved),
`outputSnapshot` (what the person saw, cut to 16,000 characters), `traceId` and `context`
(`campaignId`, `contactId`, `threadId`). An unknown surface, a `targetRef` that does not fit
it or another `rating` is `400` naming the field. The save never looks the output up and never waits
for the reward check: `reward.status` is `pending` while the note is checked (poll
`GET /v1/ai-feedback/{feedbackId}`), `none` when rewards do not apply to the caller. A note earns 10
credits at 8 words and 50 at 40 on a thumbs down (a thumbs up caps at 10), once per person per output. Changing
the note or reasons updates the same rating and never pays twice. Accepts `Idempotency-Key`. 60 writes a
minute and 2,000 a day per person: past either, `429` `quota_exceeded` with `Retry-After`.
A rating is a person's: a credential with no member behind it is `403 forbidden`, and a Network member seat
is `403 permission_denied`.

Needs the `ai_feedback` feature on your workspace. Until it is on, calls answer 404.

[Try it on developer.ken.so](https://developer.ken.so/reference/#kenso-api/tag/ai-feedback/POST/v1/ai-feedback)

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `Ken-Version` | header | string, one of: 2026-11-02, 1.1 | no | The API version, a date in `YYYY-MM-DD` form. `1.1` is another name for the first dated version. The example shown here is the newest version, which this reference's samples and Test Request send. Leave it out to use your API key's pinned version. Keys created in the Kenso app are pinned to the newest version; keys minted by the CLI login are not. A key with no pinned version and no header gets the legacy shape where the path has one, and `404` where the path exists only in this version. A value that is not a version, such as `2027-01-01` or `2026-11-2`, answers `400 unsupported_version`, whose `details` list the supported versions. |
| `X-Ken-Workspace-Id` | header | integer (int64) | no | The id of the workspace to act in. Leave it out when your API key reaches only one workspace. When the key reaches more than one, a request without this header answers `400 workspace_required`. A workspace you are not a member of answers `404 not_found`. |
| `Idempotency-Key` | header | string | no | A unique value, such as a UUID, that makes a retry safe. Send the same key when you retry. For 24 hours, a repeat of the same request with the same key gets the first response again, with the `Idempotent-Replayed: true` header, and Kenso does not run the action twice. The same key with a different request answers `422 idempotency_key_reused`. Keys are per workspace and at most 200 characters long. A repeat sent while the first request is still running can get `503 service_unavailable` with `Retry-After`. Retry it with the same key. Kenso does not store a `5xx` response, so a retry after one runs the action again. It does not store a `408`, a `429` or another `4xx` that carries `Retry-After` either: retry with the same key after that time and Kenso runs the action again. |

### Request body

`application/json`, optional.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `surface` | string | no | Where the output shows, a surface key such as `ken_chat`, `reply_draft` or `ai_line`. |
| `targetRef` | string | no | The output's id on that surface, such as `ken_chat:12:turn_3:ken` or `reply_job:881`. |
| `rating` | string | no | `up` or `down`. |
| `reasons` | array of string | no | Reason chip keys (snake_case), such as `wrong_or_made_up`. At most 12 are kept. |
| `note` | string | no | The person's note, at most 4,000 characters (a longer one is refused, never cut). |
| `outputSnapshot` | string | no | What the person saw (text, or an asset URL), cut to 16,000 characters. |
| `traceId` | string | no | The Langfuse / OTLP trace id of the run that produced the output, when the surface has one. |
| `context` | SaveAiFeedbackContext | no | Optional context of a rating, for filtering. |

### Response 201

Also answers `200`. `data` is a `AiFeedback`.

| Field | Type | Description |
| --- | --- | --- |
| `id` | integer (int64) |  |
| `surface` | string | Where the output shows, such as `ken_chat` or `reply_draft`. |
| `targetRef` | string | The output's id on that surface. |
| `rating` | string | `up` or `down`. |
| `reasons` | array of string | Reason chip keys. |
| `note` | string | The note; omitted when there is none. |
| `noteWords` | integer (int32) | Words in the note as the server counts them (tokens of at least 2 letters). This count sets the tier. |
| `reward` | AiFeedbackReward | The reward on a rating's note. |

### Request

```bash
curl -X POST "https://api.ken.so/v1/ai-feedback" \
  -H "Authorization: Bearer $KENSO_API_KEY" \
  -H "Ken-Version: 2026-11-02" \
  -H "X-Ken-Workspace-Id: $KENSO_WORKSPACE_ID" \
  -H "Content-Type: application/json" \
  -d '{
  "surface": "ken_chat",
  "targetRef": "ken_chat:12:turn_3:ken",
  "rating": "up",
  "reasons": [
    "wrong_or_made_up"
  ],
  "note": "string",
  "outputSnapshot": "string",
  "traceId": "string",
  "context": {
    "campaignId": 812,
    "contactId": 812,
    "threadId": "thr_ZW1haWw6NDAyMjg0LjFAZXhhbXBsZS5jb20"
  }
}'
```

### Example response

```json
{
  "success": true,
  "data": {
    "id": 812,
    "surface": "ken_chat",
    "targetRef": "string",
    "rating": "up",
    "reasons": [
      "string"
    ],
    "note": "string",
    "noteWords": 1,
    "reward": {
      "status": "none",
      "tier": "none",
      "credits": 1,
      "reason": "filler",
      "alreadyRewarded": true
    }
  }
}
```

## Types

Each named type the tables above use, nested ones included.

### SaveAiFeedbackContext

Optional context of a rating, for filtering.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `campaignId` | integer (int64) | no |  |
| `contactId` | integer (int64) | no |  |
| `threadId` | string | no | The inbox thread id (`thr_...`). |

### AiFeedbackReward

The reward on a rating's note.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `status` | string, one of: none, pending, granted, held_review, held_unpaid, rejected | no | `none` (no note, or rewards do not apply), `pending` (being checked, usually seconds), `granted`, `held_review` (a person on the team reviews it), `held_unpaid` (paid once the workspace pays an invoice) or `rejected`. |
| `tier` | string, one of: none, short, detailed | no | `none`, `short` or `detailed`. |
| `credits` | integer (int32) | no | Credits granted or held (whole credits). |
| `reason` | string | no | Why the note earned nothing or is held, when it did: absent for `pending`, `granted` and `held_unpaid`. With status `none`: `too_short` (the note is too short to earn; a fuller note on this output still can) or `already_rated` (this person's one reward on this output is on another of their ratings). With status `rejected`: `filler`, `duplicate`, `unverified`, `no_proof`, `judged_none`, `workspace_excluded` or `staff_rejected`. With status `held_review`: `no_resolver`, `judge_failed`, `flagged_person` or `over_daily_amount`. |
| `alreadyRewarded` | boolean | no | This person already earned (or holds) a reward on this output, so this note earns nothing more. |
