This API retrieves email trace information as per the attributes and traffic type that are accessible in the Email Security — Cloud portal. Attributes can be specified individually or in combination. If no attributes are passed, a sorted list of messages (starting with the oldest) is returned based on their last modified status time.
POST https://<etp_instance_addr>/api/v1/messages/trace
Required headers:
Content-Type: application/json—Specifies that the server's response body is expected to be in JSON format.
x-fireeye-api-key: <key>—Specifies your personal API key.
Options
traffic_type—Traffic type defaults to inbound. To handle outbound traffic, set the traffic_type parameter to outbound.
Request body examples:
Values for ID and other fields are for illustration only.
{ "traffic_type" : "outbound",
"attributes": {
"fromEmail": {
"value": ["test@etp.com"], "filter": "in", "includes": ["SMTP"]
},
"recipients": {
"value": ["userb@etp-testdomain5.com", "usera@etp-testdomain5.com"], "filter": "in", "includes": ["SMTP", "HEADER"]
},
"subject": {
"value": ["test message"], "filter": "in"
},
"period": {
"range": {
"fromAcceptedDateTime": "2017-07-11T04:52:26.365000+00:00",
"toAcceptedDateTime": "2017-07-10T04:51:26.365000+00:00"
}
},
"lastModifiedDateTime": {
"value": "2017-07-11T04:51:26.365000+00:00", "filter": ">="
},
"status": {
"value": ["accepted", "rejected"], "filter": "in"
},
"rejectionReason":{
"value": ["ETP203"]
},
"atVerdict":{
"value": ["pass"], "filter": "in"
},
"avVerdict": {
"value": ["pass", "fail"], "filter": "in"
},
"asVerdict": {
"value": ["pass"], "filter": "in"
},
"pvAction": {
"value": ["others"], "filter": "not in"
},
"yaraVerdict": {
"value": ["pass"], "action": ["no match"], "filter": "in",
},
"hasAttachment": {
"value": false
},
"messageSize":{
"min": 0, "max": 1000
},
"senderIP":{
"value": ["10.128.1.1", "10.128.1.2"], "filter": "in"
},
"domains": {
"value": ["etp-testdomain5.com"]
},
"domainGroups": {
"value": ["test domain group"]
},
"tags": {
"value": ["impersonation"], "filter": "in"
},
"hasRetroactiveAlert": {
"value": true
},
"hasMaliciousQR": {
"value": true
},
"remediateAction": {
"value": ["delete", "move"], "filter": "not in"
},
"integrationType": {
"value": ["SMTP"], "filter": "in"
},
"riskwareRules": {
"value": ["65001", "65002"], "filter": "in"
},
"yaraRulesAction": {
"value": ["alert and quarantine", "alert only", "monitor", "no match"], "filter": "in"
},
"dlpPolicyAction": {
"value": ["drop"], "filter": "in"
},
"dlpClassifications": {
"filter": "in",
"value": [
"Classification 1"
]
},
"dlpRules": {
"filter": "in",
"value": [
"Rule 1"
]
}
},
"size":20
}'This example searches for messages that are between 0 and 1000 KB:
{
"attributes": {
"messageSize":{
"min": 0, "max": 1000
}
}
}This example searches for messages that were rejected for error ETP203. Note that the status filter is mandatory when using the rejectionReason filter:
{
"attributes": {
"status":{
"value":["rejected"], "filter":"in"
},
"rejectionReason":{
"value":["ETP203"]
}
}
}This example searches for the traffic parameter for outbound trace messages. Traffic type defaults to inbound.
{
"traffic_type":"outbound",
"attributes": {
"messageSize":{
"min": 0, "max": 1000
}
}
}Request body fields:
All parameters are optional.
type: Specify the type of the query. Currently, this can have only one value:MessageAttributes.size: (integer) The number of records returned by the search query. Default is 20 and range is 1-300.attributes: The following attributes are available:
Parameter | Filter / Includes / Description |
|---|---|
|
|
|
|
|
Note: MD5 sums will be followed by SHA256 sums in a list in the attachmentHashes response field |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"attributes": {
"hasAttachment": {
"value": true
}
|
|
|
|
|
|
|
|
|
|
For example: 2017-10-03T00:00:00.000Z |
|
|
|
|
|
|
|
|
|
Note: The value of For example: {
"attributes":{
"status":{
"value":["rejected"],
"filter":"in"
},
"rejectionReason":{
"value":["ETP203"]
}
}
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
userSubmissionType |
|
|
|
|
|
Important
Parameters that take a list require an array.
For scrolling through all the trace records (using the fromLastModifiedOn field), use the "end" time (of "fromLastModifiedOn") of the first API response in the "lastModifiedDateTime" field of the next API call. For example, from this response of the first call:
...
"meta": {
"fromLastModifiedOn": {
"start": "2019-08-21T10:02:46.052",
"end": "2019-08-26T11:21:46.533"
},
"total": 1880,
"copyright": "Copyright 2019 Fireeye Inc"
}Use the end value in the next request body:
{
"attributes":{
"lastModifiedDateTime": {
"value": "2019-08-26T11:21:46.533Z",
"filter": ">="
}
}
}Email trace response
Values for ID and other fields are for illustration only.
{
"data": [
{
"attributes": {
"acceptedDateTime": "2019-08-07T10:54:54.000",
"countryCode": "us",
"domain": "etp-testdomain5.com",
"downStreamMsgID": "250 2.0.0 Ok: queued as ACBA05B3C",
"emailSize": 0.52,
"lastModifiedDateTime": "2017-07-11T04:51:26.365000",
"originalMessageID": "\u003c20190807162453.092921@JDEORE-MBP\u003e",
"recipientHeader": [
"userb@etp-testdomain5.com"
],
"recipientSMTP": [
"userb@etp-testdomain5.com"
],
"tags": [
"impersonation"
],
"senderHeader": "",
"senderSMTP": "test@etp.com",
"senderIP": "10.128.1.1",
"status": "accepted",
"subject": "test message",
"verdicts": {
"AS": "pass",
"AV": "pass",
"AT": "pass",
"PV": "pass",
"YARA": "pass",
"ActionYARA": "no match"
},
"riskwareRules": [
"65001"
],
"yaraRulesAction": "no match"
},
"included": [
{
"type": "domain",
"attributes": {
"name": "etp-testdomain5.com"
}
}
],
"hasRetroactiveAlert": true,
"hasMaliciousQR": true,
"integrationType": "SMTP",
"dlpPolicyAction": "drop",
"id": "6D1004243EFDAA4D55b90d4f3",
"type": "trace"
}
],
"meta": {
"total": 193299,
"size": 20,
"copyright": "Copyright 2019 Fireeye Inc",
"fromLastModifiedOn": {
"start": "2019-07-31T08:12:32.030Z",
"end": "2017-07-11T04:51:27.365000Z"
},
"warnings": [
"Fields verdicts.YARA and verdicts.ActionYARA in API response are deprecated and will be removed. Please refer to API documentation for more details.",
"Parameter yaraVerdict in API request is deprecated and will be removed. Parameter yaraRulesAction can be used to filter Yara matches to get same results. Please refer to API documentation for more details."
]
}
}Error response header:
{
"errors": [
{
"code": "ETP101",
"detail": "hasAttachment has to be a Boolean",
"status": "rejected",
"title": "Invalid Query Parameter"
}
]
}Response fields:
code—Email Security — Cloud-specific response code.detail—Details of the error.status—The HTTP status code applicable to this problem, expressed as a string.title—The error title.
cURL code sample: email trace
This will display all the records in the specified time and date range that received the Email Accepted timestamp. Line breaks have been added for readability.
curl -k -X POST https://etp.us.fireeye.com/api/v1/messages/trace -H "Content-Type: application/json" -H "x-fireeye-api-key: xxxxxxxxxxxxx" -d
'
{
"attributes": {
"period": {
"range": {
"fromAcceptedDateTime": "2018-11-06T13:13:36.000Z",
"toAcceptedDateTime": "2018-11-28T13:13:36.000Z"
}
},
"recipients": {
"value": ["usera"],
"filter": "in",
"includes": ["SMTP", "HEADER"]
}
},
"Type": "MessageAttributes",
"size": 1
}
'This cURL sample includes the following options:
-X POST—This option changes the HTTP method to POST.-H "Content-Type: application/json"—This header specifies that the server's response body is expected to be in JSON format.-H 'x-fireeye-api-key: xxxxxxxxxxxxxxx'—This header specifies your personal API key.https://etp.us.fireeye.com/v1/messages/trace—The email trace request URL. Replaceetp.us.fireeye.comwith the IP address of your Email Security — Cloud instance.-d '<data>'—The attributes to search for.
Results
This example returns a list of messages with the specified attributes.