POST /mindmaps/generate

Generate a hierarchical mindmap structure from a given topic using AI. The endpoint creates a mindmap with a central concept and nested branches representing main ideas and sub-ideas.

application/json

Body Required

  • topic string Required

    The main topic or subject for the mindmap generation

    Minimum length is 1, maximum length is 500.

  • model string Required

    The AI model to use for generation

    Values are gpt-4o, gpt-4-turbo, gpt-3.5-turbo, claude-3-opus, claude-3-sonnet, or claude-3-haiku.

  • provider string Required

    The AI service provider

    Values are openai, anthropic, or google.

  • language string Required

    The language for the mindmap content (ISO 639-1 code)

    Values are en, vi, fr, es, de, ja, or zh.

  • maxDepth integer

    Maximum depth of the mindmap branches (default 3)

    Minimum value is 1, maximum value is 5. Default value is 3.

  • maxBranchesPerNode integer

    Maximum number of branches per node (default 5)

    Minimum value is 1, maximum value is 10. Default value is 5.

Responses

  • 200 application/json

    Mindmap generated successfully

    Hide response attributes Show response attributes object
    • success boolean
    • code integer(int32)
    • message string
    • data object

      Response schema for mindmap generation with hierarchical structure

      Hide data attributes Show data attributes object
      • content string Required

        The central concept or root content

      • children array[object]

        Array of main branches as child nodes

        A node in the mindmap hierarchy with recursive children structure

        Hide children attributes Show children attributes object
        • content string Required

          Text content of the node

        • children array[object]

          Child nodes branching from this node

          A node in the mindmap hierarchy with recursive children structure

          Default value is [] (empty).

          A node in the mindmap hierarchy with recursive children structure

  • 400 application/json

    Bad Request - Invalid input data or malformed request

    Hide response attributes Show response attributes object
    • success boolean
    • code integer
    • errorCode string
    • message string
    • timestamp string(date-time)
  • 401 application/json

    Unauthorized - Invalid or missing authentication token

    Hide response attributes Show response attributes object
    • success boolean
    • code integer
    • errorCode string
    • message string
    • timestamp string(date-time)
  • 500 application/json

    Internal Server Error

    Hide response attributes Show response attributes object
    • success boolean
    • code integer
    • errorCode string
    • message string
    • timestamp string(date-time)
POST /mindmaps/generate
curl \
 --request POST 'http://localhost:8080/api/mindmaps/generate' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"model":"gpt-4o","topic":"Python Programming","language":"en","provider":"openai"}'
Request examples
{
  "model": "gpt-4o",
  "topic": "Python Programming",
  "language": "en",
  "provider": "openai"
}
{
  "model": "claude-3-sonnet",
  "topic": "Web Development Fundamentals",
  "language": "en",
  "provider": "anthropic"
}
Response examples (200)
{
  "code": 200,
  "data": {
    "content": "Python Programming",
    "children": [
      {
        "content": "Core Concepts",
        "children": [
          {
            "content": "Variables & Data Types"
          },
          {
            "content": "Functions"
          }
        ]
      },
      {
        "content": "Advanced Topics",
        "children": [
          {
            "content": "Decorators"
          },
          {
            "content": "Async Programming"
          }
        ]
      }
    ]
  },
  "message": "Mindmap generated successfully",
  "success": true
}
Response examples (400)
{
  "success": false,
  "code": 42,
  "errorCode": "string",
  "message": "string",
  "timestamp": "2025-05-04T09:42:00Z"
}
Response examples (401)
{
  "success": false,
  "code": 42,
  "errorCode": "string",
  "message": "string",
  "timestamp": "2025-05-04T09:42:00Z"
}
Response examples (500)
{
  "success": false,
  "code": 42,
  "errorCode": "string",
  "message": "string",
  "timestamp": "2025-05-04T09:42:00Z"
}