publ betaReference (MCP guide)
Open publ console

course_comments_apply

# course_comments_apply

Writes, deletes or pins class or lesson comments 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 |
| --- | --- | --- |
| `target` | Yes | one of: `class`, `session` (by `kind`) |
| `target.seriesId` | Yes | When `target.kind` is `class`: integer; greater than 0 |
| `target.postId` | Yes | When `target.kind` is `session`: integer; greater than 0 |
| `action` | Yes | one of: `create`, `delete`, `pin` (by `kind`) |
| `action.content` | Yes | When `action.kind` is `create`: string; min length 1; max length 3000 |
| `action.imageTaskId` | No | When `action.kind` is `create`: string; pattern `^[A-Za-z0-9_-]{8,80}$` |
| `action.commentId` | Yes | When `action.kind` is `delete`: integer; greater than 0 |
| `action.confirmation` | Yes | When `action.kind` is `delete`: `DELETE_COURSE_COMMENT` |
| `action.commentId` | Yes | When `action.kind` is `pin`: integer; greater than 0 |
| `action.pinned` | Yes | When `action.kind` is `pin`: 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. |