Nurama Developers
AI

Rate one assistant reply (Nu Feedback).

Records a thumbs-up / thumbs-down on a single assistant reply, together with a **snapshot of the interaction that produced it**, for the team to review in the admin site under *Nu Feedback*. **What gets stored.** The reply being rated, up to ten preceding turns of the conversation, and — when the client supplies them — the page context and pinned Context-column items that were in play at the time. Each captured message is truncated at 4,000 characters. The user is told this before submitting: the dialog states that context from the interaction will be submitted to the team for review. Do not widen what this endpoint captures without changing that sentence too. The interaction is **snapshotted, not referenced**. Two reasons: - Admins reviewing feedback hold no membership in the submitter's workspace, so they could not read the source chat through the normal permission path — and granting them one would be a far larger change than this feature needs. - A referenced chat can be deleted, or the topic rewritten, long before anyone looks. The record's value is what the model actually said at the time. **Authorisation.** `auth()` plus, inside the service, `assertChatReadable` — the same `canGetChat` the chat routes run. A user can only rate a reply in a chat they can already read, so this endpoint cannot be used to capture someone else's conversation by guessing message ids. Failure is `403 forbidden`. **Deliberately NOT gated** by `validateSubscription`, `requireAiEnabled` or `requireSufficientAiBalance`. Those gate *use* of the AI; this is feedback *about* it, and a workspace whose AI add-on was just switched off is exactly the one whose feedback matters most. A snapshot that cannot be built does not fail the request — the rating is still recorded, with `context.snapshotError: true`. Losing a thumbs-down to a transcript read failure would be the wrong trade.

POST
/ai/feedback

Records a thumbs-up / thumbs-down on a single assistant reply, together with a snapshot of the interaction that produced it, for the team to review in the admin site under Nu Feedback.

What gets stored. The reply being rated, up to ten preceding turns of the conversation, and — when the client supplies them — the page context and pinned Context-column items that were in play at the time. Each captured message is truncated at 4,000 characters. The user is told this before submitting: the dialog states that context from the interaction will be submitted to the team for review. Do not widen what this endpoint captures without changing that sentence too.

The interaction is snapshotted, not referenced. Two reasons:

  • Admins reviewing feedback hold no membership in the submitter's workspace, so they could not read the source chat through the normal permission path — and granting them one would be a far larger change than this feature needs.
  • A referenced chat can be deleted, or the topic rewritten, long before anyone looks. The record's value is what the model actually said at the time.

Authorisation. auth() plus, inside the service, assertChatReadable — the same canGetChat the chat routes run. A user can only rate a reply in a chat they can already read, so this endpoint cannot be used to capture someone else's conversation by guessing message ids. Failure is 403 forbidden.

Deliberately NOT gated by validateSubscription, requireAiEnabled or requireSufficientAiBalance. Those gate use of the AI; this is feedback about it, and a workspace whose AI add-on was just switched off is exactly the one whose feedback matters most.

A snapshot that cannot be built does not fail the request — the rating is still recorded, with context.snapshotError: true. Losing a thumbs-down to a transcript read failure would be the wrong trade.

Authorization

AuthorizationBearer <token>

OAuth 2.1 authorization code flow with PKCE (required of every client, public or confidential). Scopes are a ceiling on the credential, not a grant of access: a token also cannot exceed what the user who approved it may already do. A write scope does not imply its matching read — ask for both.

In: header

Scope: ai:use

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/ai/feedback" \  -H "Content-Type: application/json" \  -d '{    "rating": "negative",    "surface": "chat",    "chatId": "0192f3a4-5b6c-7d8e-9f01-23456789abcd",    "messageId": "0192f3a4-5b6c-7d8e-9f01-23456789abce",    "notes": "It summarised the wrong asset.",    "workspaceId": "0192f3a4-5b6c-7d8e-9f01-23456789ab01"  }'
{  "id": "0192f3a4-5b6c-7d8e-9f01-23456789abcf"}