learndash/manage-lesson creates a new lesson or updates an existing one.
A newly created lesson is not attached to any course. learndash/attach-step does that.
At a glance
| Ability | learndash/manage-lesson |
| Toolset | LearnDash — toolset/learndash |
| Group | LearnDash › Lessons, Topics & Quizzes |
| Requires | AcrossAI Pro, plus LearnDash LMS active on the site |
| Capability | manage_options |
| Safety | Writes data |
| Repeatable | Idempotent — running it twice leaves the same result |
| Ships in | AcrossAI Pro 0.9.16 and later |
How it works
The separation is deliberate rather than an omission. A lesson can belong to several courses, and the attachment carries its own information — which course, under which parent, in which position — that a creation call has no natural place for.
It also means a lesson created and never attached is a normal intermediate state rather than a failure.
Settings are written through LearnDash’s own accessor, so the meta LearnDash mirrors internally stays consistent. Writing the meta directly leaves the two copies disagreeing, and LearnDash reads whichever one it happens to read.
The settings worth knowing: sample_lesson marks a free preview, visible_after and visible_after_specific_date control drip-feed, lesson_assignment_upload requires a file, lesson_assignment_points_enabled and lesson_assignment_points_amount score it, forced_lesson_time sets a minimum time on the page, and lesson_video_enabled with lesson_video_url adds video progression.
Several of those block completion. Setting them on a lesson learners are already partway through changes what they have to do, retroactively.
Idempotent.
Input
| Name | Type | Required | What it is |
|---|---|---|---|
action | string | Yes | create or update. |
lesson_id | integer | For update | Which lesson. |
title | string | For create | The lesson title. |
content | string | No | The lesson content. |
status | string | No | Post status. |
settings | object | No | LearnDash settings keys. |
What comes back
| Name | Type | What it is |
|---|---|---|
lesson | object | The lesson after the write. |
success | boolean | Whether the call completed. |
message | string | A one-line summary of what happened, suitable for showing a human. |
error_code | string | Present only on failure — a stable machine-readable reason, such as a missing field, a wrong field type or an unmet confirmation. |
Example
Ask your assistant:
Create a lesson and add it to the course.
It resolves to one call:
{
"ability": "learndash/manage-lesson",
"parameters": {
"action": "create",
"title": "Setting up your workspace"
}
}Worth knowing
- Not attached on creation. Attaching is a separate call and can target several courses.
- Completion-blocking settings apply retroactively to learners already in progress.
- Written through LearnDash’s accessor.
- Idempotent.
Related abilities
- LearnDash Attach Step — the required second step
- LearnDash Get Lesson — read the current settings
Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager
Browse the rest: Every ability, by category