> ## 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.

# Move message

> Move an Outlook message to another mail folder.

`moveMessage` relocates a message and returns the message record created in the
destination folder.

```ts automations/archive-outlook-message.automation.ts theme={null}
import { automation } from "automate.ax"
import { moveMessage } from "automate.ax/outlook"

export default automation("Archive Outlook message", () => {
  moveMessage({ messageId: "AAMkAGI2...", destinationFolder: "Archive/2026" })
})
```

`messageId` and `destinationFolder` are required. The destination accepts an
exact display path, folder ID, or well-known name. Optional `account` selects
the Microsoft binding. Returns the relocated `OutlookMessage`.

Moving can change the provider message ID. Use the returned `messageId` for
later actions rather than retaining only the source ID. Ambiguous folder names
fail; a path or ID resolves the ambiguity.
