---
updatedAt: 2025-06-04T20:31:09.000Z
agentTools:
  projectIndex: https://developer-docs.datamotion.com/v2/llms.txt
---

# Move a Message

This method is used to move a particular message into a specific folder.
Messages can only be moved within their respective type (ie: Inbox or Outbox), but they can be placed in any subfolder with the same type.
A session key must be submitted via the X-Session-Key header.
The message ID of the message you'd like to move must be passed in the URL of this method.
The response body will be empty.
A successful transaction will receive a 200 status code.

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "Secure Messaging API",
    "version": "v2"
  },
  "servers": [
    {
      "url": "https://sandbox.datamotion.com/SecureMessagingApi"
    }
  ],
  "paths": {
    "/Message/{messageId}/Move": {
      "post": {
        "tags": [
          "Message"
        ],
        "summary": "Move a Message",
        "description": "This method is used to move a particular message into a specific folder.\r\nMessages can only be moved within their respective type (ie: Inbox or Outbox), but they can be placed in any subfolder with the same type.\r\nA session key must be submitted via the X-Session-Key header.\r\nThe message ID of the message you'd like to move must be passed in the URL of this method.\r\nThe response body will be empty.\r\nA successful transaction will receive a 200 status code.",
        "operationId": "Message_MoveMessage",
        "parameters": [
          {
            "name": "messageId",
            "in": "path",
            "description": "Unique message identifier",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Session-Key",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "The move message request data",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MoveMessageRequestData"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Ok",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "The MoveMessageRequestData model is required in the request body. ||\r\nThe DestinationFolderId field is required.",
            "content": {}
          },
          "401": {
            "description": "The X-Session-Key header is missing. ||\r\nBad session key. ||\r\nSession key expired. ||\r\nCould not parse the message ID into an integer. ||\r\nYou do not have access to message with id [MessageId]. ||\r\nFolderId [FolderId] not found. ||\r\nCould not move the message into the destination folder. ||\r\nMessage could not be moved to the recovery folder. ||\r\nMessage could not be moved to the trash folder. ||\r\nThe message has been deleted from the Inbox and is no longer available. ||\r\nThis message has been deleted from Track Sent and is no longer available.",
            "content": {}
          }
        },
        "x-codegen-request-body-name": "requestData"
      }
    }
  },
  "components": {
    "schemas": {
      "MoveMessageRequestData": {
        "required": [
          "DestinationFolderId"
        ],
        "type": "object",
        "properties": {
          "DestinationFolderId": {
            "type": "integer",
            "description": "The destination folder's unique identifier",
            "format": "int32"
          }
        },
        "description": "The move message request data"
      }
    }
  },
  "x-original-swagger-version": "2.0",
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```