---
title: "Regenerate Insight"
method: POST
path: "/api/search-insights/{insight_id}/regenerate"
tags: ["Search Insights"]
---

# Regenerate Insight

`POST /api/search-insights/{insight_id}/regenerate`

## Request

- Base URL: `https://api.kolens.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.kolens.ai/api/search-insights/{insight_id}/regenerate`
- Auth: HTTP bearer

Kick off a fresh generation, overwriting the existing row.

EPIC #117 Phase 3 — Regenerate flips the existing insight back to
``pending`` and schedules a fresh generation against the same
(workspace_id, keyword, intent) tuple. When the background task
completes it overwrites ``report_json`` + bumps ``generated_at`` so
the row id stays stable and any pinned UI / link to the report
continues to work.

Section-scoped regenerate is still in the contract for forwards-
compat but not yet wired (Phase 4 polish). Membership gate is
strict 404 so we never leak the existence of an insight in a
different workspace.

Rate-limited to 5 calls / 60s per (workspace_id, insight_id). The
BFF can forward Retry-After to the UI.

## Path parameters

- `insight_id` string, required

## Headers

- `x-kolens-user-id` string, nullable

## Request body

- RegenerateRequest
  - `section` string, nullable

## Response `202`

Successful Response

- CreateInsightResponse
  - `insight_id` string, required
  - `status` string, required
  - `intent` string, required
  - `keyword` string, required
  - `cached` boolean

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/kolens/apis/kolens-api.md) · [All operations](https://skmtc.dev/kolens/apis/kolens-api/llms.txt) · [OpenAPI document](https://skmtc.dev/kolens/apis/kolens-api/revisions/5d6865ab0a24?raw)
