publ betaReference (MCP guide)
Open publ console

course_classes_apply

# course_classes_apply

Creates, edits, publishes or deletes a class, or changes its description, cover or labels 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 | one of: `course-description`, `cover`, `labels`, `create`, `edit`, `publication`, `delete` (by `kind`) |
| `action.seriesId` | Yes | When `action.kind` is `course-description`: integer; greater than 0 |
| `action.descriptionHtml` | Yes | When `action.kind` is `course-description`: string; max length 5000 |
| `action.inlineImages` | No | When `action.kind` is `course-description`: array; max items 100; default `[]` |
| `action.inlineImages[].token` | Yes | When `action.kind` is `course-description`: string; pattern `^[A-Za-z0-9_-]{1,80}$` |
| `action.inlineImages[].imageTaskId` | Yes | When `action.kind` is `course-description`: string; pattern `^[A-Za-z0-9_-]{8,80}$` |
| `action.seriesId` | Yes | When `action.kind` is `cover`: integer; greater than 0 |
| `action.change` | Yes | When `action.kind` is `cover`: one of: `replace`, `restore` (by `kind`) |
| `action.change.imageTaskId` | Yes | When `action.kind` is `cover` and `action.change.kind` is `replace`: string; pattern `^[A-Za-z0-9_-]{8,80}$` |
| `action.change.sourceTaskId` | Yes | When `action.kind` is `cover` and `action.change.kind` is `restore`: string; pattern `^[A-Za-z0-9_-]{8,80}$` |
| `action.seriesId` | Yes | When `action.kind` is `labels`: integer; greater than 0 |
| `action.change` | Yes | When `action.kind` is `labels`: object |
| `action.change.operation` | Yes | When `action.kind` is `labels`: `attach`, `detach`, `replace` |
| `action.change.labelId` | Yes | When `action.kind` is `labels`: integer; greater than 0 |
| `action.title` | Yes | When `action.kind` is `create`: string; min length 1; max length 50 |
| `action.isPublished` | No | When `action.kind` is `create`: boolean; default `false` |
| `action.navigationType` | No | When `action.kind` is `create`: `NAV_C00006_HORIZONTAL_VIDEO_VIEWING`, `NAV_C00006_VERTICAL_VIDEO_VIEWING`; Serial C00006 only; omitted means the original default horizontal viewing. |
| `action.scheduledAt` | No | When `action.kind` is `create`: string; pattern `^(?:(?:\d\d[2468][048]\|\d\d[13579][26]\|\d\d0[48]\|[02468][048]00\|[13579][26]00)-02-29\|\d{4}-(?:(?:0[13578]\|1[02])-(?:0[1-9]\|[12]\d\|3[01])\|(?:0[469]\|11)-(?:0[1-9]\|[12]\d\|30)\|(?:02)-(?:0[1-9]\|1\d\|2[0-8])))T(?:(?:[01]\d\|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z\|([+-](?:[01]\d\|2[0-3]):[0-5]\d)))$`; format `date-time`; OTT C00002, Serial C00006 and basic VOD C00001 only, private series or playlists only: schedule publication at creation, as the original create modal does. Whole minutes with an explicit time zone, in the future. Other apps schedule after creation with their schedules tool (for example course_schedules_apply). |
| `action.seriesId` | Yes | When `action.kind` is `edit`: integer; greater than 0 |
| `action.changes` | Yes | When `action.kind` is `edit`: object |
| `action.changes.publishedAt` | No | When `action.kind` is `edit`: string; pattern `^(?:(?:\d\d[2468][048]\|\d\d[13579][26]\|\d\d0[48]\|[02468][048]00\|[13579][26]00)-02-29\|\d{4}-(?:(?:0[13578]\|1[02])-(?:0[1-9]\|[12]\d\|3[01])\|(?:0[469]\|11)-(?:0[1-9]\|[12]\d\|30)\|(?:02)-(?:0[1-9]\|1\d\|2[0-8])))T(?:(?:[01]\d\|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z\|([+-](?:[01]\d\|2[0-3]):[0-5]\d)))$`; format `date-time` |
| `action.changes.navigationType` | No | When `action.kind` is `edit`: `NAV_C00006_HORIZONTAL_VIDEO_VIEWING`, `NAV_C00006_VERTICAL_VIDEO_VIEWING`; Serial C00006 only: horizontal or vertical video viewing for this series. |
| `action.changes.instructor` | No | When `action.kind` is `edit`: string; max length 30 |
| `action.changes.preparingMessage` | No | When `action.kind` is `edit`: string; max length 20 |
| `action.changes.title` | No | When `action.kind` is `edit`: string; min length 1; max length 50 |
| `action.changes.description` | No | When `action.kind` is `edit`: string; max length 5000 |
| `action.changes.ott` | No | When `action.kind` is `edit`: object |
| `action.changes.ott.director` | No | When `action.kind` is `edit`: string; max length 30 |
| `action.changes.ott.casting` | No | When `action.kind` is `edit`: string; max length 200 |
| `action.changes.ott.synopsis` | No | When `action.kind` is `edit`: string; max length 500 |
| `action.changes.ott.productionYear` | No | When `action.kind` is `edit`: string; pattern `^[0-9]{4}$` |
| `action.seriesId` | Yes | When `action.kind` is `publication`: integer; greater than 0 |
| `action.isPublished` | Yes | When `action.kind` is `publication`: boolean |
| `action.seriesId` | Yes | When `action.kind` is `delete`: integer; greater than 0 |
| `action.confirmation` | Yes | When `action.kind` is `delete`: `DELETE_COLLECTION` |
| `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. |