Get message detection details
client.emailSecurity.investigate.detections.get(stringinvestigateId, DetectionGetParams { account_id } params, RequestOptionsoptions?): DetectionGetResponse { action, attachments, findings, 6 more }
GET/accounts/{account_id}/email-security/investigate/{investigate_id}/detections
Returns detection details such as threat categories and sender information for non-benign messages.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
Example:
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Example:
Accepted Permissions (at least one required)
Get message detection details
import Cloudflare from 'cloudflare';
const client = new Cloudflare({
apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});
const detection = await client.emailSecurity.investigate.detections.get(
'4Njp3P0STMz2c02Q-2024-01-05T10:00:00-12345678',
{ account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
);
console.log(detection.validation);{
"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": "action",
"attachments": [
{
"size": 0,
"content_type": "content_type",
"detection": "MALICIOUS",
"encrypted": true,
"filename": "filename",
"md5": "md5",
"name": "name",
"sha1": "sha1",
"sha256": "sha256"
}
],
"findings": [
{
"attachment": "attachment",
"detail": "detail",
"detection": "MALICIOUS",
"field": "field",
"name": "name",
"portion": "portion",
"reason": "reason",
"score": 0,
"value": "value"
}
],
"headers": [
{
"name": "name",
"value": "value"
}
],
"links": [
{
"href": "href",
"text": "text"
}
],
"sender_info": {
"as_name": "as_name",
"as_number": 0,
"geo": "geo",
"ip": "ip",
"pld": "pld"
},
"threat_categories": [
{
"id": 0,
"description": "description",
"name": "name"
}
],
"validation": {
"comment": "comment",
"dkim": "pass",
"dmarc": "pass",
"spf": "pass"
},
"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": "action",
"attachments": [
{
"size": 0,
"content_type": "content_type",
"detection": "MALICIOUS",
"encrypted": true,
"filename": "filename",
"md5": "md5",
"name": "name",
"sha1": "sha1",
"sha256": "sha256"
}
],
"findings": [
{
"attachment": "attachment",
"detail": "detail",
"detection": "MALICIOUS",
"field": "field",
"name": "name",
"portion": "portion",
"reason": "reason",
"score": 0,
"value": "value"
}
],
"headers": [
{
"name": "name",
"value": "value"
}
],
"links": [
{
"href": "href",
"text": "text"
}
],
"sender_info": {
"as_name": "as_name",
"as_number": 0,
"geo": "geo",
"ip": "ip",
"pld": "pld"
},
"threat_categories": [
{
"id": 0,
"description": "description",
"name": "name"
}
],
"validation": {
"comment": "comment",
"dkim": "pass",
"dmarc": "pass",
"spf": "pass"
},
"final_disposition": "MALICIOUS"
},
"success": true
}