Skip to content
Start here

Move a message

email_security.investigate.move.create(strpostfix_id, MoveCreateParams**kwargs) -> SyncSinglePage[MoveCreateResponse]
POST/accounts/{account_id}/email-security/investigate/{postfix_id}/move

Moves a single email message to a different folder or changes its quarantine status.

Security

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
account_id: str

Account Identifier

maxLength32
minLength32
postfix_id: str

The identifier of the message.

destination: Literal["Inbox", "JunkEmail", "DeletedItems", 2 more]
One of the following:
"Inbox"
"JunkEmail"
"DeletedItems"
"RecoverableItemsDeletions"
"RecoverableItemsPurges"
ReturnsExpand Collapse
class MoveCreateResponse:
Deprecatedcompleted_timestamp: datetime

Deprecated, use completed_at instead

formatdate-time
Deprecateditem_count: int
formatint32
success: bool
completed_at: Optional[datetime]
formatdate-time
destination: Optional[str]
message_id: Optional[str]
operation: Optional[str]
recipient: Optional[str]
status: Optional[str]

Move a message

import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_email=os.environ.get("CLOUDFLARE_EMAIL"),  # This is the default and can be omitted
    api_key=os.environ.get("CLOUDFLARE_API_KEY"),  # This is the default and can be omitted
)
page = client.email_security.investigate.move.create(
    postfix_id="4Njp3P0STMz2c02Q",
    account_id="023e105f4ecef8ad9ca31a8372d0c353",
    destination="Inbox",
)
page = page.result[0]
print(page.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": [
    {
      "completed_timestamp": "2019-12-27T18:11:19.117Z",
      "item_count": 0,
      "success": true,
      "completed_at": "2019-12-27T18:11:19.117Z",
      "destination": "destination",
      "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": [
    {
      "completed_timestamp": "2019-12-27T18:11:19.117Z",
      "item_count": 0,
      "success": true,
      "completed_at": "2019-12-27T18:11:19.117Z",
      "destination": "destination",
      "message_id": "message_id",
      "operation": "operation",
      "recipient": "recipient",
      "status": "status"
    }
  ],
  "success": true
}