> ## Documentation Index
> Fetch the complete documentation index at: https://docs.automate.ax/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Update message

> Update writable properties on an Outlook message or draft.

`updateMessage` applies selected mutable fields. Recipient, subject, and body
changes are generally draft-only; read state, flags, categories, and importance
also apply to received mail where Microsoft allows them.

## Example

```ts automations/update-outlook-draft.automation.ts theme={null}
import { automation } from "automate.ax"
import { updateMessage } from "automate.ax/outlook"

export default automation("Update Outlook draft", () => {
  updateMessage({
    messageId: "AAMkAGI2...",
    subject: "Updated launch note",
    bodyType: "html",
    body: "<p>Approved copy.</p>",
    categories: ["Launch"],
  })
})
```

## Inputs

`messageId` is required. Optional replacements are `to`, `cc`, `bcc`, `subject`,
`body`, `bodyType`, `categories`, `importance`, `isRead`, and `flagStatus`
(`notFlagged`, `complete`, or `flagged`). `bodyType` only matters when replacing
`body` and defaults to text for that update. Recipient lists replace, rather
than append to, their existing fields. `account` selects the binding.

## Output

Returns Graph's updated normalized `OutlookMessage`. Microsoft rejects fields
that are not writable for the message's current state.
