Create Module

Generate one interactive TutorFlow module, equivalent to a classroom standalone lesson.

POST /v1/platform/modules

Creates a single module. A platform module is the same content shape as a classroom module: one standalone lesson with lecture HTML, optional interactive content, optional quizzes, metadata, slug, publish flag, and S3-backed lecture storage. The ownership fields are platform-specific (platformWorkspaceId and platformApiKeyId) instead of classroom/user fields.

Pricing

The Module API is billed as one generated lesson. It uses the same per-lesson price as one Course API lesson.

UnitPrice
Per lesson$0.05

The response includes a priceSnapshot with the exact billable amount.

Request Body

FieldTypeRequiredDescription
promptstringYesPrompt describing the module to generate
topicstringNoClassroom-compatible alias for prompt
titlestringNoOverride title
descriptionstringNoOverride description
targetstringNoAdditional target learner/context
typestringNoLesson type. If omitted, TutorFlow infers one
languagestringNoContent language, default en
localestringNoUI/user locale, default en
slugstringNoURL-friendly slug
isPublicbooleanNoWhether the share-token endpoint can render it, default true
hasQuizbooleanNoWhether to include generated quiz items, default true
idempotencyKeystringNoPrevents duplicate processing. Can also be sent via Idempotency-Key

Example Request

curl -X POST https://api.tutorflow.io/v1/platform/modules \
  -H "Authorization: Bearer tf_platform_..." \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Create a short beginner lesson about Python variables with a quick practice quiz",
    "language": "en"
  }'

Example Response

{
  "id": "4d3b7f2a-7b8f-497c-a1d9-58b7f2e0c111",
  "title": "Python Variables",
  "description": "Create a lesson about Python variables.",
  "type": "markdown",
  "isPublic": true,
  "content": null,
  "lectureKey": "platform/workspaces/.../modules/.../lecture/1.txt",
  "lecture": "<h1>Python Variables</h1><p>...</p>",
  "lectureVersion": 1,
  "status": "completed",
  "metadata": { "locale": "en", "language": "en" },
  "slug": "python-variables-a1b2c3",
  "shareToken": "b018172542f9a3c4d5e6f7890abcdef12345678",
  "publicUrl": "https://tutorflow.io/en/platform/modules/b018172542f9...",
  "priceSnapshot": {
    "category": "module",
    "catalogKey": "module.default",
    "tier": "default",
    "unit": "lesson",
    "unitPrice": 0.05,
    "units": 1,
    "amountUsd": 0.05,
    "currency": "USD",
    "source": "platform_pricing_catalog_v2"
  },
  "quizzes": [],
  "createdAt": "2026-04-27T10:00:00.000Z",
  "updatedAt": "2026-04-27T10:00:12.000Z",
  "completedAt": "2026-04-27T10:00:12.000Z"
}

Public URL

publicUrl opens a learner-facing module page at:

/{locale}/platform/modules/{shareToken}