AI feedback
The AI feedback endpoints of the Kenso API.
Rate an AI output
/v1/ai-feedbackai-feedback.createNeeds the ai_feedback feature on your workspace. Until it is on, calls answer 404.
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.
Parameters
YYYY-MM-DD form. 1.1 is another name for the first dated version. 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 date that is not a version answers 400 unsupported_version; any other value that is not a version is treated as legacy.400 workspace_required. A workspace you are not a member of answers 404 not_found.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.Request body
application/json, optional.
ken_chat, reply_draft or ai_line.ken_chat:12:turn_3:ken or reply_job:881.up or down.wrong_or_made_up. At most 12 are kept.Response 201
Also answers 200. data is a AiFeedback.
ken_chat or reply_draft.up or down.curl -X POST "https://api.ken.so/v1/ai-feedback" \
-H "Authorization: Bearer $KEN_API_KEY" \
-H "Ken-Version: 1.1" \
-H "X-Ken-Workspace-Id: $KEN_WORKSPACE_ID" \
-H "Content-Type: application/json" \
-d '{
"surface": "string",
"targetRef": "string",
"rating": "string",
"reasons": [
"string"
],
"note": "string",
"outputSnapshot": "string",
"traceId": "string",
"context": {
"campaignId": 812,
"contactId": 812,
"threadId": "thr_ZW1haWw6NDAyMjg0LjFAZXhhbXBsZS5jb20"
}
}'{
"success": true,
"data": {
"id": 812,
"surface": "string",
"targetRef": "string",
"rating": "string",
"reasons": [
"string"
],
"note": "string",
"noteWords": 1,
"reward": {
"status": "none",
"tier": "none",
"credits": 1,
"reason": "string",
"alreadyRewarded": true
}
}
}Get one of the caller's ratings
/v1/ai-feedback/{feedbackId}ai-feedback.getNeeds the ai_feedback feature on your workspace. Until it is on, calls answer 404.
The caller's own rating and its reward, for the poll after Send (every 1.5 s for up to 15 s). Another person's rating, another workspace's, a cleared rating or an unknown id is 404.
Parameters
YYYY-MM-DD form. 1.1 is another name for the first dated version. 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 date that is not a version answers 400 unsupported_version; any other value that is not a version is treated as legacy.400 workspace_required. A workspace you are not a member of answers 404 not_found.Response 200
data is a AiFeedback.
ken_chat or reply_draft.up or down.curl -X GET "https://api.ken.so/v1/ai-feedback/812" \ -H "Authorization: Bearer $KEN_API_KEY" \ -H "Ken-Version: 1.1" \ -H "X-Ken-Workspace-Id: $KEN_WORKSPACE_ID"
{
"success": true,
"data": {
"id": 812,
"surface": "string",
"targetRef": "string",
"rating": "string",
"reasons": [
"string"
],
"note": "string",
"noteWords": 1,
"reward": {
"status": "none",
"tier": "none",
"credits": 1,
"reason": "string",
"alreadyRewarded": true
}
}
}Clear one of the caller's ratings
/v1/ai-feedback/{feedbackId}ai-feedback.deleteNeeds the ai_feedback feature on your workspace. Until it is on, calls answer 404.
Removes the caller's thumbs from the output (204). A reward already granted or held on it stays, and a new rating of the same output earns nothing more. Another person's rating, another workspace's or an unknown id is 404; clearing a cleared rating again is 204.
Parameters
YYYY-MM-DD form. 1.1 is another name for the first dated version. 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 date that is not a version answers 400 unsupported_version; any other value that is not a version is treated as legacy.400 workspace_required. A workspace you are not a member of answers 404 not_found.Response 204
curl -X DELETE "https://api.ken.so/v1/ai-feedback/812" \ -H "Authorization: Bearer $KEN_API_KEY" \ -H "Ken-Version: 1.1" \ -H "X-Ken-Workspace-Id: $KEN_WORKSPACE_ID"
HTTP/1.1 204 No Content
Record that the caller regenerated a Ken draft or suggestion
/v1/ai-feedback/signalsai-feedback.signalNeeds the ai_feedback feature on your workspace. Until it is on, calls answer 404.
The one implicit signal only the client sees: Rewrite on a Ken reply draft or composer suggestion. Body: surface (reply_draft or reply_suggest), targetRef (the draft's or suggestion's id, such as reply_job:881 or reply_suggest:sug_12) and signal (regenerated). Recorded as a thumbs down that earns nothing (204); a repeat on the same output updates the one record. Anything else is 400 naming the field. Shares the rating write limit.
Parameters
YYYY-MM-DD form. 1.1 is another name for the first dated version. 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 date that is not a version answers 400 unsupported_version; any other value that is not a version is treated as legacy.400 workspace_required. A workspace you are not a member of answers 404 not_found.Request body
application/json, optional.
reply_draft or reply_suggest.reply_job:881 or reply_suggest:sug_12.regenerated.Response 204
curl -X POST "https://api.ken.so/v1/ai-feedback/signals" \
-H "Authorization: Bearer $KEN_API_KEY" \
-H "Ken-Version: 1.1" \
-H "X-Ken-Workspace-Id: $KEN_WORKSPACE_ID" \
-H "Content-Type: application/json" \
-d '{
"surface": "string",
"targetRef": "string",
"signal": "string"
}'HTTP/1.1 204 No Content