Skip to content
Start here

Get message detection details

GET/accounts/{account_id}/email-security/investigate/{postfix_id}/detections

Returns detection details such as threat categories and sender information for non-benign messages.

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
Path ParametersExpand Collapse
account_id: string

Account Identifier

maxLength32
minLength32
postfix_id: string

The identifier of the message.

ReturnsExpand Collapse
errors: array of ResponseInfo { code, message, documentation_url, source }
code: number
minimum1000
message: string
documentation_url: optional string
source: optional { pointer }
pointer: optional string
messages: array of ResponseInfo { code, message, documentation_url, source }
code: number
minimum1000
message: string
documentation_url: optional string
source: optional { pointer }
pointer: optional string
result: { action, attachments, headers, 5 more }
action: string
attachments: array of { size, content_type, detection, 2 more }
size: number
minimum0
content_type: optional string
detection: optional "MALICIOUS" or "MALICIOUS-BEC" or "SUSPICIOUS" or 7 more
One of the following:
"MALICIOUS"
"MALICIOUS-BEC"
"SUSPICIOUS"
"SPOOF"
"SPAM"
"BULK"
"ENCRYPTED"
"EXTERNAL"
"UNKNOWN"
"NONE"
encrypted: optional boolean
name: optional string
headers: array of { name, value }
name: string
value: string
sender_info: { as_name, as_number, geo, 2 more }
as_name: optional string

The name of the autonomous system.

as_number: optional number

The number of the autonomous system.

formatint64
geo: optional string
ip: optional string
pld: optional string
threat_categories: array of { id, description, name }
id: number
formatint64
description: optional string
name: optional string
validation: { comment, dkim, dmarc, spf }
comment: optional string
dkim: optional "pass" or "neutral" or "fail" or 2 more
One of the following:
"pass"
"neutral"
"fail"
"error"
"none"
dmarc: optional "pass" or "neutral" or "fail" or 2 more
One of the following:
"pass"
"neutral"
"fail"
"error"
"none"
spf: optional "pass" or "neutral" or "fail" or 2 more
One of the following:
"pass"
"neutral"
"fail"
"error"
"none"
final_disposition: optional "MALICIOUS" or "MALICIOUS-BEC" or "SUSPICIOUS" or 7 more
One of the following:
"MALICIOUS"
"MALICIOUS-BEC"
"SUSPICIOUS"
"SPOOF"
"SPAM"
"BULK"
"ENCRYPTED"
"EXTERNAL"
"UNKNOWN"
"NONE"
success: boolean

Get message detection details

curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/email-security/investigate/$POSTFIX_ID/detections \
    -H "X-Auth-Email: $CLOUDFLARE_EMAIL" \
    -H "X-Auth-Key: $CLOUDFLARE_API_KEY"
{
  "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": {
    "action": "QUARANTINED",
    "attachments": [
      {
        "size": 0,
        "content_type": "content_type",
        "detection": "MALICIOUS",
        "encrypted": true,
        "name": "name"
      }
    ],
    "headers": [
      {
        "name": "From",
        "value": "Sender Name <d1994@example.com>"
      },
      {
        "name": "Subject",
        "value": "listen, I highly recommend u to read that email, just to ensure not a thing will take place"
      }
    ],
    "links": [
      {
        "href": "https://example.com",
        "text": "Click here!"
      }
    ],
    "sender_info": {
      "as_name": "AS0",
      "as_number": 0,
      "geo": "US/-/-",
      "ip": "127.0.0.1",
      "pld": "example.com"
    },
    "threat_categories": [
      {
        "id": 1234,
        "description": null,
        "name": "IP Reputation"
      }
    ],
    "validation": {
      "comment": null,
      "dkim": "pass",
      "dmarc": "none",
      "spf": "fail"
    },
    "final_disposition": "MALICIOUS"
  },
  "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": {
    "action": "QUARANTINED",
    "attachments": [
      {
        "size": 0,
        "content_type": "content_type",
        "detection": "MALICIOUS",
        "encrypted": true,
        "name": "name"
      }
    ],
    "headers": [
      {
        "name": "From",
        "value": "Sender Name <d1994@example.com>"
      },
      {
        "name": "Subject",
        "value": "listen, I highly recommend u to read that email, just to ensure not a thing will take place"
      }
    ],
    "links": [
      {
        "href": "https://example.com",
        "text": "Click here!"
      }
    ],
    "sender_info": {
      "as_name": "AS0",
      "as_number": 0,
      "geo": "US/-/-",
      "ip": "127.0.0.1",
      "pld": "example.com"
    },
    "threat_categories": [
      {
        "id": 1234,
        "description": null,
        "name": "IP Reputation"
      }
    ],
    "validation": {
      "comment": null,
      "dkim": "pass",
      "dmarc": "none",
      "spf": "fail"
    },
    "final_disposition": "MALICIOUS"
  },
  "success": true
}