Update Discussion Topic
update_discussion_topicUpdate an existing Canvas discussion topic or announcement, including title, body, publish state, pinning, and locking. Edit one fragment safely or guard against overwriting changed content.
Instructions
Update an existing discussion topic or announcement.
message replaces the whole body. To change one fragment, pass find and replace instead. Optional guards (any of them makes the tool fetch the topic first, refuse rather than write on a failed check, and read it back after): expect_body_sha256 refuses if the message changed since you read it (Canvas gives topics no updated_at, so expect_updated_at is rejected); find/replace edits one fragment of the current message; require lists strings that must already be present in it.
Every update checks the topic through REST before writing. Anonymous topics cannot be updated here; use the Canvas UI instead. The optional GraphQL fallback is for reads only.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| find | No | Exact HTML fragment that must occur exactly once in the current message | |
| title | No | New title | |
| locked | No | Lock or unlock the topic | |
| pinned | No | Pin or unpin the topic | |
| lock_at | No | ISO 8601 datetime to auto-lock the discussion | |
| message | No | New body content (HTML supported) | |
| replace | No | Text that replaces find (may be empty to delete it) | |
| require | No | Strings that must already be present in the current message | |
| topic_id | Yes | Discussion topic ID | |
| published | No | Publish or unpublish the topic | |
| delayed_post_at | No | ISO 8601 datetime to schedule posting | |
| course_identifier | Yes | Course code or Canvas ID | |
| expect_updated_at | No | Not supported: Canvas returns no updated_at for discussion topics. Use expect_body_sha256 instead. | |
| expect_body_sha256 | No | SHA-256 (hex) of the message as Canvas returned it when you read it; refuse if the message has changed. Each guarded edit reports the new hash for the next edit. | |
| require_initial_post | No | Students must post before seeing others |