[Embeddables](/embeddables)

# Course Agent

The Course Agent embeds Coassemble's agent as a chat editor for an existing course. Your users ask it to add screens, rewrite content, generate quizzes, and more — and it edits the course for them. It's chat only: there's no builder canvas, so live-builder tools (selecting a screen, capturing the screen) are unavailable.

Edits are persisted server-side as the agent works. Live sync updates a connected builder directly. When live sync is not connected, `course-updated` is a fallback event so your host can refresh a player or builder shown alongside the agent.

### API Endpoint

POST `/v1/headless/embed/agent`

#### Body parameters

| Field | Type | Example | Description |
| --- | --- | --- | --- |
| `mode` | `string` | `coach` | — |
| `courseId` | `number` | `123` | The course the agent edits (required). |
| `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` |  | Custom theme ID to render with. |
| `options.ai` | `boolean` | `true` | Same flag as course and builder embeds. Does not disable the coach chat itself. |
| `options.language` | `string` | `en` | Language for the conversation and edits. |
| `options.brandVoice` | `boolean` | `false` | Apply the workspace brand voice during edits. |
| `options.expiresIn` | `string` | `3h` | Link opening lifetime, "30s" to "3h" (e.g. "5m"). Invalid values return 400. A builder link handed over from this agent gets the same lifetime. |

### Emitted Events

[How to listen to events](/events)

| Type | Event | Description | Notes |
| --- | --- | --- | --- |
| `agent` | `course-updated` | Fallback after the agent edits the course, sent only when live sync is not connected. Payload includes { courseId }. |  |
