import Global from '../../_global.mdx';
import TabItem from '@theme/TabItem';
import Tabs from '@theme/Tabs';

# outlook message move

Moves message to the specified folder

## Usage

```sh
m365 outlook message move [options]
```

## Options

```md definition-list
`--id <id>`
: ID of the message to move

`--sourceFolderName [sourceFolderName]`
: Name of the folder to move the message from

`--sourceFolderId [sourceFolderId]`
: ID of the folder to move the message from

`--targetFolderName [targetFolderName]`
: Name of the folder to move the message to

`--targetFolderId [targetFolderId]`
: ID of the folder to move the message to
```

<Global />

## Permissions

<Tabs>
  <TabItem value="Delegated">

  | Resource        | Permissions               |
  |-----------------|---------------------------|
  | Microsoft Graph | Mail.ReadWrite            |

  </TabItem>
  <TabItem value="Application">

  | Resource        | Permissions                    |
  |-----------------|--------------------------------|
  | Microsoft Graph | Mail.ReadWrite                 |

  </TabItem>
</Tabs>

## Examples

Move the specified message to another folder specified by ID

```sh
m365 outlook message move --id AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAEMAAAiIsqMbYjsT5e-T7KzowPTAALdyzhHAAA= --sourceFolderId AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OAAuAAAAAAAiQ8W967B7TKBjgx9rVEURAQAiIsqMbYjsT5e-T7KzowPTAAAAAAEKAAA= --targetFolderId AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OAAuAAAAAAAiQ8W967B7TKBjgx9rVEURAQAiIsqMbYjsT5e-T7KzowPTAAAeUO-fAAA=
```

Move the specified message to another folder specified by name

```sh
m365 outlook message move --id AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAEMAAAiIsqMbYjsT5e-T7KzowPTAALdyzhHAAA= --sourceFolderName Inbox --targetFolderName "Project X"
```

Move the specified message to another folder specified by its well-known
name

```sh
m365 outlook message move --id AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAEMAAAiIsqMbYjsT5e-T7KzowPTAALdyzhHAAA= --sourceFolderName inbox --targetFolderName archive
```

## Response

The command won't return a response on success.

## More information

- Well-known folder names: [https://learn.microsoft.com/graph/api/resources/mailfolder?view=graph-rest-1.0](https://learn.microsoft.com/graph/api/resources/mailfolder?view=graph-rest-1.0)
