course_curriculum_apply
# course_curriculum_apply
Adds or renames chapters, adds, removes or moves lessons and sets previews in a class table of contents in the Course app (pApp C00007). Shows a preview first; the change runs only after confirmation. Called without confirmToken it previews and returns a confirmToken; repeating the same input with it executes once.
## Inputs
| Field | Required here | Contract |
| --- | --- | --- |
| `action` | Yes | object |
| `action.kind` | Yes | `curriculum` |
| `action.seriesId` | Yes | integer; greater than 0 |
| `action.change` | Yes | one of: `add-chapter`, `rename-chapter`, `add-sessions`, `remove`, `move`, `preview` (by `kind`) |
| `action.change.title` | Yes | When `action.change.kind` is `add-chapter`: string |
| `action.change.itemId` | Yes | When `action.change.kind` is `rename-chapter`: integer; greater than 0 |
| `action.change.title` | Yes | When `action.change.kind` is `rename-chapter`: string |
| `action.change.chapterId` | Yes | When `action.change.kind` is `add-sessions`: integer; greater than 0 |
| `action.change.postIds` | Yes | When `action.change.kind` is `add-sessions`: array; items: integer; greater than 0; min items 1; max items 200 |
| `action.change.itemId` | Yes | When `action.change.kind` is `remove`: integer; greater than 0 |
| `action.change.confirmation` | Yes | When `action.change.kind` is `remove`: `REMOVE_CURRICULUM_ITEM` |
| `action.change.itemId` | Yes | When `action.change.kind` is `move`: integer; greater than 0 |
| `action.change.chapterId` | No | When `action.change.kind` is `move`: integer; greater than 0 |
| `action.change.beforeItemId` | Yes | When `action.change.kind` is `move`: integer; greater than 0 or null |
| `action.change.itemIds` | Yes | When `action.change.kind` is `preview`: array; items: integer; greater than 0; min items 1; max items 200 |
| `action.change.isPreview` | Yes | When `action.change.kind` is `preview`: boolean |
| `confirmToken` | No | string; pattern `^ct[a-f\d]{32}$`; The confirmToken from this tool's preview result. Omit it to preview; repeat the same input with it to execute. |