Skip to content
Start here

Move a message

client.emailSecurity.investigate.move.create(stringinvestigateId, MoveCreateParams { account_id, destination } params, RequestOptionsoptions?): SinglePage<MoveCreateResponse { success, completed_at, completed_timestamp, 6 more } >
POST/accounts/{account_id}/email-security/investigate/{investigate_id}/move

Moves a single message to a specified mailbox folder (Inbox, JunkEmail, DeletedItems, RecoverableItemsDeletions, or RecoverableItemsPurges). Requires active integration.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
Cloud Email Security: Write
ParametersExpand Collapse
investigateId: string

Unique identifier for a message retrieved from investigation

params: MoveCreateParams { account_id, destination }
account_id: string

Path param: Identifier.

maxLength32
destination: "Inbox" | "JunkEmail" | "DeletedItems" | 2 more

Body param

One of the following:
"Inbox"
"JunkEmail"
"DeletedItems"
"RecoverableItemsDeletions"
"RecoverableItemsPurges"
ReturnsExpand Collapse
MoveCreateResponse { success, completed_at, completed_timestamp, 6 more }
success: boolean

Whether the operation succeeded

completed_at?: string | null

When the move operation completed (UTC)

formatdate-time
Deprecatedcompleted_timestamp?: string

Deprecated, use completed_at instead. End of life: November 1, 2026.

formatdate-time
destination?: string | null

Destination folder for the message

Deprecateditem_count?: number

Number of items moved. End of life: November 1, 2026.

message_id?: string | null

Message identifier

operation?: string | null

Type of operation performed

recipient?: string | null

Recipient email address

status?: string | null

Operation status

Move a message

import Cloudflare from 'cloudflare';

const client = new Cloudflare({
  apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const moveCreateResponse of client.emailSecurity.investigate.move.create(
  '4Njp3P0STMz2c02Q-2024-01-05T10:00:00-12345678',
  { account_id: '023e105f4ecef8ad9ca31a8372d0c353', destination: 'Inbox' },
)) {
  console.log(moveCreateResponse.message_id);
}
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "result": [
    {
      "success": true,
      "completed_at": "2019-12-27T18:11:19.117Z",
      "completed_timestamp": "2019-12-27T18:11:19.117Z",
      "destination": "destination",
      "item_count": 0,
      "message_id": "message_id",
      "operation": "operation",
      "recipient": "recipient",
      "status": "status"
    }
  ],
  "success": true
}
Returns Examples
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "result": [
    {
      "success": true,
      "completed_at": "2019-12-27T18:11:19.117Z",
      "completed_timestamp": "2019-12-27T18:11:19.117Z",
      "destination": "destination",
      "item_count": 0,
      "message_id": "message_id",
      "operation": "operation",
      "recipient": "recipient",
      "status": "status"
    }
  ],
  "success": true
}