message: move
Namespace: microsoft.graph
Important
APIs under the /beta
version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
Move a message to another folder within the specified user's mailbox. This creates a new copy of the message in the destination folder and removes the original message.
Permissions
One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.
Permission type | Permissions (from least to most privileged) |
---|---|
Delegated (work or school account) | Mail.ReadWrite |
Delegated (personal Microsoft account) | Mail.ReadWrite |
Application | Mail.ReadWrite |
HTTP request
POST /me/messages/{id}/move
POST /users/{id | userPrincipalName}/messages/{id}/move
POST /me/mailFolders/{id}/messages/{id}/move
POST /users/{id | userPrincipalName}/mailFolders/{id}/messages/{id}/move
Request headers
Header | Value |
---|---|
Authorization | Bearer {token} . Required. |
Content-Type | application/json . Required. |
Request body
In the request body, provide a JSON object with the following parameters.
Parameter | Type | Description |
---|---|---|
DestinationId | String | The destination folder ID, or a well-known folder name. For a list of supported well-known folder names, see mailFolder resource type. |
Response
If successful, this method returns 201 Created
response code and a message resource in the response body.
Example
Here is an example of how to call this API.
Request
The following request moves the specified message to the Deleted Items folder, identified by its well-known folder name deleteditems
.
POST https://graph.microsoft.com/beta/me/messages/AAMkADhAAATs28OAAA=/move
Content-type: application/json
{
"destinationId": "deleteditems"
}
Response
Here is an example of the response.
Note: The response object shown here might be shortened for readability. All the properties will be returned from an actual call.
HTTP/1.1 201 Created
Content-type: application/json
{
"@odata.context":"https://graph.microsoft.com/beta/$metadata#message",
"@odata.type":"#microsoft.graph.message",
"@odata.etag":"W/\"FwAAABYAAAC4ofQHEIqCSbQPot83AFcbAAAW/0tB\"",
"id":"AAMkADhAAAW-VPeAAA=",
"createdDateTime":"2018-08-12T08:43:22Z",
"lastModifiedDateTime":"2018-08-15T19:47:54Z",
"changeKey":"FwAAABYAAAC4ofQHEIqCSbQPot83AFcbAAAW/0tB",
"categories":[
],
"receivedDateTime":"2018-08-12T08:43:22Z",
"sentDateTime":"2018-08-12T08:43:20Z",
"hasAttachments":false,
"internetMessageId":"<00535324-5988-4b6a-b9af-d44cf2d0b691@MWHPR2201MB1022.namprd22.prod.outlook.com>",
"subject":"Undeliverable: Meet for lunch?",
"bodyPreview":"Delivery has failed to these recipients or groups:\r\n\r\nfannyd@contoso.onmicrosoft.com (fannyd@contoso.onmicrosoft.com)\r\nYour message couldn't be delivered. Despite repeated attempts to deliver your message, querying the Domain Name System (DNS) for the rec",
"importance":"normal",
"parentFolderId":"AAMkADhAAAAAAEKAAA=",
"conversationId":"AAQkADhJzfbkARFhe5kKhjihSA=",
"isDeliveryReceiptRequested":null,
"isReadReceiptRequested":false,
"isRead":false,
"isDraft":false,
"webLink":"https://outlook.office365.com/owa/?ItemID=AAMkADhAAAW%2FVPeAAA%3D&exvsurl=1&viewmodel=ReadMessageItem",
"inferenceClassification":"focused",
"body":{
"contentType":"html",
"content":"<html></html>"
},
"sender":{
"emailAddress":{
"name":"Microsoft Outlook",
"address":"MicrosoftExchange329e71ec88ae4615bbc36ab6ce41109e@contoso.onmicrosoft.com"
}
},
"from":{
"emailAddress":{
"name":"Microsoft Outlook",
"address":"MicrosoftExchange329e71ec88ae4615bbc36ab6ce41109e@contoso.onmicrosoft.com"
}
},
"toRecipients":[
{
"emailAddress":{
"name":"fannyd@contoso.onmicrosoft.com",
"address":"fannyd@contoso.onmicrosoft.com"
}
},
{
"emailAddress":{
"name":"danas@contoso.onmicrosoft.com",
"address":"danas@contoso.onmicrosoft.com"
}
}
],
"ccRecipients":[
],
"bccRecipients":[
],
"replyTo":[
],
"flag":{
"flagStatus":"notFlagged"
}
}