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.
| Unit | Price |
|---|---|
| Per lesson | $0.05 |
The response includes a priceSnapshot with the exact billable amount.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | Prompt describing the module to generate |
topic | string | No | Classroom-compatible alias for prompt |
title | string | No | Override title |
description | string | No | Override description |
target | string | No | Additional target learner/context |
type | string | No | Lesson type. If omitted, TutorFlow infers one |
language | string | No | Content language, default en |
locale | string | No | UI/user locale, default en |
slug | string | No | URL-friendly slug |
isPublic | boolean | No | Whether the share-token endpoint can render it, default true |
hasQuiz | boolean | No | Whether to include generated quiz items, default true |
idempotencyKey | string | No | Prevents 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}