---
title: "Generate Charts"
method: POST
path: "/api/insights/{insight_id}/generate-charts"
tags: ["charts"]
---

# Generate Charts

`POST /api/insights/{insight_id}/generate-charts`

## Request

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

Generate charts for an insight.

Args:
    insight_id: The insight ID to generate charts for
    ctx: Advisor context

Returns:
    Success response with number of charts generated

Raises:
    HTTPException: For 404 or 403 errors only
    (Rate limits and other API errors result in fallback charts)

## Path parameters

- `insight_id` string, required

## Response `200`

Successful Response

- GenerateChartsResponse: Response for generate charts request.
  - `success` boolean, required
  - `insight_id` string, required
  - `charts_generated` integer, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/flagpost/apis/flagpost-api.md) - [All operations](https://skmtc.dev/flagpost/apis/flagpost-api/llms.txt) - [OpenAPI document](https://skmtc.dev/flagpost/apis/flagpost-api/revisions/0308cef485ca?raw)
