> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mavioapp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate diagram

> Generate an AI-powered diagram from meeting content such as a flowchart, sequence diagram, mind map, or infographic.

Generates a visual diagram from the meeting's transcript and summary using AI. The diagram is created asynchronously -- the response returns immediately with a `processing` status. Use the [list diagrams](/api-reference/diagrams/list-diagrams) endpoint or subscribe to the `diagram.completed` [webhook event](/api-reference/webhooks/events) to check when generation finishes.

<ParamField path="id" type="string" required>
  The unique meeting identifier (e.g., `mtg_8f3k2j1m4n5p`). The meeting must have a completed transcript.
</ParamField>

<ParamField body="type" type="string" required>
  The type of diagram to generate. One of `flowchart` (process and decision flows), `sequence` (interaction sequence diagrams), `mindmap` (hierarchical topic maps), or `infographic` (visual data summary with key metrics).
</ParamField>

<ParamField body="style" type="string">
  Optional visual style hint. One of `minimal`, `detailed`, or `colorful`. Defaults to `detailed`.
</ParamField>

<ParamField body="focus_topics" type="array">
  Optional array of topic strings to focus the diagram on specific subjects discussed in the meeting. When provided, the AI narrows the diagram to content related to these topics. Maximum 5 topics.
</ParamField>

### Response

<ResponseField name="id" type="string">
  Unique diagram identifier (e.g., `dgm_k1l2m3n4o5`).
</ResponseField>

<ResponseField name="meeting_id" type="string">
  The meeting this diagram is being generated from.
</ResponseField>

<ResponseField name="type" type="string">
  Diagram type: `flowchart`, `sequence`, `mindmap`, or `infographic`.
</ResponseField>

<ResponseField name="title" type="string | null">
  Auto-generated title. May be `null` while still processing.
</ResponseField>

<ResponseField name="status" type="string">
  Generation status: `processing`. Will change to `completed` or `failed` once finished.
</ResponseField>

<ResponseField name="image_url" type="string | null">
  `null` while processing. Populated with the rendered image URL once completed.
</ResponseField>

<ResponseField name="source_markup" type="string | null">
  `null` while processing. Populated with Mermaid or SVG markup once completed.
</ResponseField>

<ResponseField name="created_at" type="string">
  ISO 8601 timestamp when diagram generation was requested.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.mavioapp.com/v1/meetings/mtg_8f3k2j1m4n5p/diagrams \
    -H "Authorization: Bearer mvo_live_abc123" \
    -H "Content-Type: application/json" \
    -d '{
      "type": "mindmap",
      "style": "colorful",
      "focus_topics": ["launch timeline", "payment integration"]
    }'
  ```

  ```python Python theme={null}
  diagram = client.diagrams.generate(
      meeting_id="mtg_8f3k2j1m4n5p",
      type="mindmap",
      style="colorful",
      focus_topics=["launch timeline", "payment integration"]
  )
  print(f"Diagram {diagram.id} is {diagram.status}")
  ```

  ```javascript Node.js theme={null}
  const diagram = await client.diagrams.generate('mtg_8f3k2j1m4n5p', {
    type: 'mindmap',
    style: 'colorful',
    focusTopics: ['launch timeline', 'payment integration'],
  });
  console.log(`Diagram ${diagram.id} is ${diagram.status}`);
  ```
</RequestExample>

<ResponseExample>
  ```json 202 theme={null}
  {
    "id": "dgm_k1l2m3n4o5",
    "meeting_id": "mtg_8f3k2j1m4n5p",
    "type": "mindmap",
    "title": null,
    "status": "processing",
    "image_url": null,
    "source_markup": null,
    "created_at": "2026-04-14T09:20:00Z"
  }
  ```
</ResponseExample>
