edit_message
Edit a previously sent Teams message by replacing its body, swapping one exact phrase, or renaming a channel root post title.
Instructions
Edit a message previously sent by the signed-in user. Choose exactly one mode: markdown (replace full body), find + replace (replace one unique literal phrase while preserving HTML), or subject (rename a channel root post title). Requires Chat.ReadWrite (chats) or ChannelMessage.ReadWrite (channels) and Teams policy allowing edits. Returns { ok, conv_key, msg_id }.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| find | No | Exact phrase occurring once in a single editable text node (must be paired with replace). | |
| msg_id | Yes | ID of the message sent by the current user to edit. | |
| target | Yes | Conversation conv_key (chat:... or chan:team:channel), "Team/Channel", or unique conversation title substring. | |
| replace | No | Literal replacement text for find; pass an empty string to remove the matched phrase. | |
| subject | No | New plain-text title for a channel root post you sent (mutually exclusive with body edits and thread_root_id). | |
| markdown | No | Markdown to replace the entire message body (mutually exclusive with find/replace and subject). | |
| thread_root_id | No | Optional channel thread root post ID required when editing a reply inside a channel thread. |