[Embeddables](/embeddables)

# Course Builder

The Course Builder is a full course authoring experience, embedded in your product. Use it when your customers, partners, or admins need to build their own training and that creation should happen inside your platform. The example below loads a sample course into the builder so you can see how the authoring experience looks in context.

To delete source processing copies after generation, send `discardSourceDocuments: true`. See [source document retention](/source-documents) for embed inheritance, accepted requests, deletion timing and the editing trade-off.

It's common for partner enablement tools, platforms that let other companies create their own training, and any product where people are creating content. If course authoring needs to feel like a native feature of your product, this is the embeddable that gets you there quickly.

## Classic

Classic is the original screen-by-screen editor. Everything else on this page is the course builder. The same `POST /v1/headless/embed/course` edit embed loads either one. `options.legacy` is the API switch. The live demo header toggles that same flag.

|  | Course Builder | Classic |
| --- | --- | --- |
| `options.legacy` | `false` | omit or `true` |
| Authoring UI | Block layouts and start/finish covers. `flow: "ai"` with no `courseId` opens the create-course agent over an empty Course Builder course. | Original screen-by-screen course editor. |
| `courseId` | Omit it to lazy-create a blank Course Builder course. A supplied id with omitted `legacy` auto-routes by `Course.legacy`. Explicit `legacy: false` still requires a Builder 2 course. | Omit it to lazy-create a Classic stub. A supplied id with omitted `legacy` auto-routes by `Course.legacy`. Explicit `legacy: true` still requires a Classic course. |

On edit with a supplied `courseId`, omitted `options.legacy` routes to the course’s current builder. An explicit `legacy` that does not match the course is still rejected. Lazy-create (no `courseId`) still uses the flag to stamp the new course. Player (view) embeds do not apply this gate.

<a id="migration"></a>

## Let authors migrate Classic courses

Set `options.migration: true` when issuing a writable course edit embed to show the Classic builder's Migrate button. The option defaults to `false`. It does not enable migration in readonly, preview-only, player, or screen embeds.

**POST /v1/headless/embed/course · request body**

```json
{
  "action": "edit",
  "courseId": 123,
  "identifier": "your-user-id",
  "clientIdentifier": "your-tenant-id",
  "options": {
    "migration": true
  }
}
```

Authors can try Builder 2 inside the same iframe, then cancel to restore Classic or confirm to keep Builder 2. Reloading during a preview preserves the try flow. After confirmation, the original embed URL opens the migrated course in Builder 2. Migration keeps the course ID and does not publish the draft.

Omit `options.legacy` when issuing subsequent URLs for an existing course so the embed follows its current builder. An explicit builder flag that does not match the course is rejected when issuing a new URL. The shared sample-course demo is readonly, so its Migrate button remains hidden even with this option enabled.

For migrations controlled by your application, use the [single-course API](/api/courses#migrate-course) or [batch API with status polling or migration webhooks](/api/courses#batch-migrate-courses).

### API Endpoint

POST `/v1/headless/embed/course`

#### Body parameters

| Field | Type | Example | Description |
| --- | --- | --- | --- |
| `action` | `string` | `edit` | — |
| `identifier` | `string` | `your-user-id` | — |
| `clientIdentifier` | `string` | `your-tenant-id` | — |
| `name` | `string` | `Jane Doe` | Display name for presence avatars and comment authors. Optional. An empty or blank name is treated as not given. When not given, a colour-and-animal name such as Green Turtle is generated from identifier and stays the same for that identifier. Max 512 characters; longer values return HTTP 400 (\`name max=512, asked for N\`). |
| `avatar` | `string` | `https://example.com/avatar.jpg` | Image URL for presence avatars and comment authors. Optional. An empty or blank avatar is treated as not given: no avatar is shown, and it does not generate a name. Otherwise it must be an http(s) URL. Max 2048 characters; longer values return HTTP 400 (\`avatar max=2048, asked for N\`). Other schemes also return 400. |
| `themeId` | `number` |  | For a course this embed creates (action "edit", no courseId), Classic and new builder: the course starts with the default Brand Kit theme of the client passed as clientIdentifier; with no clientIdentifier it uses the workspace default; a client with no default theme gets no theme (no fallback to the workspace). A themeId on the request wins and is saved on the new course. On an existing course, themeId only styles that embed session. |
| `options.flow` | `preview` `ai` `generate` `transform` `convert` `document` `presentation` | `ai` | Initial creation flow. "preview" locks preview-only chrome on whichever builder \`legacy\` selects. "ai" with legacy=false opens the create-course agent over an empty Course Builder course. "document" is an alias of "transform" and "presentation" an alias of "convert". |
| `options.back` | `event` `hidden` `native` | `event` | Back button behaviour. |
| `options.translations` | `boolean` | `false` | Enable translation features. |
| `options.googleDrive` | `boolean` | `true` | Enable Google Drive import. |
| `options.oneDrive` | `boolean` | `true` | Enable OneDrive import. |
| `options.loom` | `boolean` | `false` | Enable Loom video recording. |
| `options.feedback` | `boolean` | `true` | Enable course feedback screen. |
| `options.publishing` | `boolean` | `false` | Enable publish controls. |
| `options.narrations` | `boolean` | `false` | Enable AI narrations. |
| `options.ai` | `boolean` | `true` | Enable AI-powered features. |
| `options.legacy` | `boolean` | `true` | Selects Classic (omit or true) or the course builder (false) when lazy-creating. The live demo header is the same control. On edit with a supplied courseId, omit this flag to auto-route by Course.legacy; an explicit value must still match that course. |
| `options.migration` | `boolean` | `false` | Show the Classic migration button and preview/confirm flow in writable course edit embeds. Disabled for readonly and preview-only embeds; the shared sample-course demo is readonly. |
| `options.hideOutline` | `boolean` | `false` | Builder 2 only. Hide the learner outline and Appearance switch in the builder preview. |
| `options.expiresIn` | `string` | `3h` | Link opening lifetime, "30s" to "3h" (e.g. "5m"). Invalid values return 400. |

### Emitted Events

[How to listen to events](/events)

| Type | Event | Description | Notes |
| --- | --- | --- | --- |
| `session` | `ready` | Fires when the course builder is mounted and ready. |  |
| `session` | — | Fires when a builder request fails. Sent as { type: "session", status: "error" }, with a status field and no event field. |  |
| `session` | — | Fires when the session expires (a request returns 401). Sent as { type: "session", status: "expired" }, with a status field and no event field. |  |
| `course` | `created` | Fires when the builder creates a course. | data: { id, title }. |
| `course` | `generated` | Classic only. Fires when AI course generation completes. | data: { id, title, screenCount }. |
| `course` | `updated` | Fires when a course is updated. |  |
| `back` | — | Fires when the Back button is clicked. |  |
