thincms_create_lesson
Create a new lesson in a module with HTML content, video, and drip scheduling. Lessons are automatically ordered within the module.
Instructions
Create a new lesson within a module. Content is raw HTML. Lessons are auto-ordered within their module. For large content (>10KB), use contentFile instead of content.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| slug | No | URL slug (auto-generated from title if omitted) | |
| title | Yes | Lesson title (required) | |
| isFree | No | Make this a free preview lesson (default: false) | |
| siteId | No | Override the active site for this single call. Pass to target a specific tenant without mutating shared active-site state — the right pattern when running concurrent agent sessions managing different tenants. Must match a siteId from your THINCMS_SITES config (use thincms_list_sites to inspect). When omitted, the call uses the active site set by thincms_switch_site. | |
| content | No | HTML content of the lesson | |
| dripDate | No | ISO date when this lesson becomes available (for scheduled drip mode) | |
| duration | No | Recording duration in seconds (e.g., 2700 for 45 minutes) | |
| moduleId | Yes | Module ID (required) | |
| videoUrl | No | Video embed URL (YouTube, Vimeo, etc.) | |
| isUnlocked | No | Manually unlock this lesson regardless of drip settings | |
| contentFile | No | Local file path containing HTML content — use instead of content for large lessons | |
| recordingDate | No | ISO date when the live session was held (for community recordings, distinct from createdAt) | |
| videoDuration | No | Video duration (e.g., '10:30') | |
| confirmProductionWrite | No | Acknowledge that this call may write to a configured production site (THINCMS_PRODUCTION_SITE_IDS env var). Required for any POST/PUT/PATCH/DELETE against a production-listed site; ignored otherwise. The error message lists which site triggered the requirement and recommends thincms_snapshot before any production write. |