Skip to content
Start here

Get email trace

email_security.investigate.trace.get(strpostfix_id, TraceGetParams**kwargs) -> TraceGetResponse
GET/accounts/{account_id}/email-security/investigate/{postfix_id}/trace

Gets the delivery trace for an email message, showing its path through email security processing.

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: WriteCloud Email Security: Read
ParametersExpand Collapse
account_id: str

Account Identifier

maxLength32
minLength32
postfix_id: str

The identifier of the message.

ReturnsExpand Collapse
class TraceGetResponse:
inbound: Inbound
lines: Optional[List[InboundLine]]
lineno: int
formatint64
message: str
ts: datetime
formatdate-time
pending: Optional[bool]
outbound: Outbound
lines: Optional[List[OutboundLine]]
lineno: int
formatint64
message: str
ts: datetime
formatdate-time
pending: Optional[bool]

Get email trace

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
)
trace = client.email_security.investigate.trace.get(
    postfix_id="4Njp3P0STMz2c02Q",
    account_id="023e105f4ecef8ad9ca31a8372d0c353",
)
print(trace.inbound)
{
  "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": {
    "inbound": {
      "lines": [
        {
          "lineno": 0,
          "message": "message",
          "ts": "2019-12-27T18:11:19.117Z"
        }
      ],
      "pending": true
    },
    "outbound": {
      "lines": [
        {
          "lineno": 0,
          "message": "message",
          "ts": "2019-12-27T18:11:19.117Z"
        }
      ],
      "pending": true
    }
  },
  "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": {
    "inbound": {
      "lines": [
        {
          "lineno": 0,
          "message": "message",
          "ts": "2019-12-27T18:11:19.117Z"
        }
      ],
      "pending": true
    },
    "outbound": {
      "lines": [
        {
          "lineno": 0,
          "message": "message",
          "ts": "2019-12-27T18:11:19.117Z"
        }
      ],
      "pending": true
    }
  },
  "success": true
}