---
updatedAt: 2025-04-22T20:06:51.000Z
agentTools:
  projectIndex: https://email.opensrs.guide/llms.txt
---

# move_user_messages

The **move_user_messages** method moves the specified user messages to a different folder.

## Syntax

```perl
{
  <credentials object>
  "user": <mailbox_name>,
  "ids": [<list of message ids>] 
  "folder": <destination folder>
}
```

## Request fields for move\_user\_messages

The following fields can be used in the **move\_user\_messages** method:

<Table align={["left","left","left"]}>
  <thead>
    <tr>
      <th>
        Field name
      </th>

      <th>
        Obligation
      </th>

      <th>
        Definition/Value
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        folder
      </td>

      <td>
        Optional
      </td>

      <td>
        The folder to search for messages. If not specified, the INBOX folder is searched.
      </td>
    </tr>

    <tr>
      <td>
        ids
      </td>

      <td>
        Required
      </td>

      <td>
        The list of ids that you want to move.

        The ids are returned by the [get\_user\_messages](https://api-opensrs-email.readme.io/v1.0/docs/get_deleted_messages?bypass=8272e34bb5) method.
      </td>
    </tr>

    <tr>
      <td>
        user
      </td>

      <td>
        Required
      </td>

      <td>
        The user's account name.
      </td>
    </tr>
  </tbody>
</Table>

## Response fields for move\_user\_messages

The following fields may be returned in response to the **move\_user\_messages** method:

<Table align={["left","left","left"]}>
  <thead>
    <tr>
      <th>
        Field name
      </th>

      <th>
        Obligation
      </th>

      <th>
        Description/Value
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        count
      </td>

      <td>
        Returned if **success = true**
      </td>

      <td>
        The number of messages returned in the **messages** list.
      </td>
    </tr>

    <tr>
      <td>
        error
      </td>

      <td>
        Returned if **success = false**
      </td>

      <td>
        A text string that explains the error.
      </td>
    </tr>

    <tr>
      <td>
        error\_number
      </td>

      <td>
        Returned if **success = false**
      </td>

      <td>
        A number that represents the error.
      </td>
    </tr>

    <tr>
      <td>
        ids
      </td>

      <td>
        Returned if **success = true**
      </td>

      <td>
        A list of hashes, one for each of the message ids submitted in the request. Includes the following information for each message listed:

        * **error**—A text string that explains the error.

        * **error\_number**—A number that represents the error.

        * **id**—The id number of the message.

        * **success**—Indicates whether the message was moved successfully or not. Allowed values are **true** and **false**.
      </td>
    </tr>

    <tr>
      <td>
        success
      </td>

      <td>
        Always returned
      </td>

      <td>
        Indicates whether the request was successful or not. Allowed values are **true** and **false**.
      </td>
    </tr>
  </tbody>
</Table>

## Examples for move\_user\_messages

**Request**

```perl
{
  "credentials": {
		"user": "domain_admin@example.com",
    "password": "pencil75"
  },
  "user": "joe_user@example.com",
  "folder": "Spam",
  "ids": [
		"U2FsdGVkX1/1NoyVE6nnFbezjndojMCc+wKwHMv6al2buE2jNziDQTGzZUA7Gb0ivD u/6v0fJWAIrR2S0"
	] 
}
```

**Response**

```perl
{
  "success": true,
  "ids": [
    {
      "success": true,
      "id": "U2FsdGVkX1/1NoyVE6nnFbezjndojMCc+wKwHMv6al2buE2jNziDQTGzZUA7Gb0ivDu/6v 0fJWAIrR2S0"
		} 
	],
}
```