---
title: "Generate Email Draft"
method: POST
path: "/api/businesses/{business_id}/insights/generate-email-draft"
tags: ["Insights"]
---

# Generate Email Draft

`POST /api/businesses/{business_id}/insights/generate-email-draft`

## 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/businesses/{business_id}/insights/generate-email-draft`
- Auth: HTTP bearer

Generate a draft email for missing insights without sending.

Returns the email subject and body for advisor review/editing before
approval.

Args:
    business_id: Business UUID
    request: Insight IDs and optional context message
    ctx: Advisor context

Returns:
    Email draft with subject, body, and recipient info

## Path parameters

- `business_id` string, required

## Request body

- AppRoutersInsightsGenerateEmailDraftRequest: Request to generate email draft preview.
  - `insight_ids` string[], required
  - `message` string, nullable

## Response `200`

Successful Response

- EmailDraftResponse: Response with generated email draft.
  - `subject` string, required
  - `body_html` string, required
  - `body_text` string, required
  - `recipient_email` string, required
  - `recipient_name` string, nullable, required
  - `missing_insights` object[], 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)
