---
title: "Submit Insight Feedback"
method: POST
path: "/tokenwise/insights/{insight_id}/feedback"
---

# Submit Insight Feedback

`POST /tokenwise/insights/{insight_id}/feedback`

Record the user's verdict (+ optional comment) on an insight.

Orthogonal to the lifecycle — allowed in every customer-visible state, and
last write wins. The gateway owns the closed verdict set.

## Path parameters

- `insight_id` string, required

## Request body

- InsightFeedbackIn — Body for ``POST /tokenwise/insights/{insight_id}/feedback``. ``verdict`` stays a plain ``str`` for the same reason as :attr:`InsightOut.state` — the gateway owns the closed set (``helpful`` / ``not_helpful``) and answers 422 on anything else, so widening it there doesn't force an api-server release. ``comment`` is bounded at 1000 chars to mirror the gateway's own limit (and its ``varchar(1000)`` column) so an over-long body fails here instead of making the round trip just to come back 422. The gateway stays the authoritative enforcement point; keep this number in sync with it.
  - `verdict` string, required
  - `comment` string

## Response `200`

Successful Response

- InsightOut — Response shape for one insight — ``GET /tokenwise/insights`` and the ``apply`` / ``dismiss`` / ``acknowledge`` transitions. ``state``, ``source`` and ``kind`` stay plain ``str`` (not enums) so a new gateway lifecycle state, source or insight kind doesn't force an api-server release — the same stance as :class:`AgentOptimization`. The gateway is the source of truth (``ai21_intelligent_gateway_api.insights.schemas.InsightResponse``). Feedback is two columns, not three: ``verdict`` is required on submission, so a non-null ``feedback_verdict`` is itself the "has feedback" signal, and ``updated_at`` covers when it arrived.
  - `id` string, uuid, required — A unique ID for the request (not the message). Repeated identical requests get different IDs. However, for a streaming response, the ID will be the same for all responses in the stream.
  - `workspace_id` string, uuid, required
  - `agent_id` string, required
  - `state` string, required
  - `source` string, required
  - `kind` string, required
  - `author` string
  - `title` string, required
  - `narrative` string, required
  - `projected_savings` string
  - `optimization_id` string
  - `config_suggestion` object
  - `feedback_verdict` string
  - `feedback_comment` string
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/ai21/apis/ai21-studio-api.md) · [All operations](https://skmtc.net/ai21/apis/ai21-studio-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/ai21/ai21-studio-api/versions/4105747cd57d/schema)
