---
title: "Apply Insight"
method: POST
path: "/tokenwise/insights/{insight_id}/apply"
---

# Apply Insight

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

Apply an insight's config suggestion to its agent (``published`` -> ``applied``).

## Path parameters

- `insight_id` string, required

## 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)
