{{ notif.message || notif.error || notif }}
{{ qs.message }}
{{ qs.error }}

Mail Stats and SPAM Detection API


This API requires a paid mail stats subscription for access.



Notes

Authentication to the API is done in the same way as the standard APIs.

Disposable messages are usually stored for about 7 days.

Private addresses data is not returned by the this set of APIs.


Addresses

GET /api/mailstats/top-addresses

Search for the top non-private addresses that have been receiving mail.


Querystring Params
startDateDate (UTC)RequiredLimit results to inboxes that received messages after this date.
endDateDate (UTC)RequiredLimit results to inboxes that received messages before this date.
limitIntegerOptionalLimit results to this many.Default: 20, Max: 1000
skipDateOptionalSkip this many results.Default: 0

Example Request
GET /api/mailstats/top-addresses?startDate=2017-04-26T03:14:40.412Z&endDate=2017-04-28T07:14:40.412Z

Example Response
[
    {
        _id: "apad@mailsac.com",
        n: 10
    },
    {
        _id: "foooo@mailsac.com",
        n: 7
    },
    {
        _id: "fcca3a@mailsac.com",
        n: 6
    },
    {
        _id: "11111@mailsac.com",
        n: 4
    }
]

Attachments

GET /api/mailstats/common-attachments

Search for attachments that were received during the given time period.

Limited to non-private inboxes.

startDateDate (UTC)RequiredLimit results to inboxes that received messages after this date.
endDateDate (UTC)RequiredLimit results to inboxes that received messages before this date.
limitIntegerOptionalLimit results to this many.Default: 20, Max: 1000
skipDateOptionalSkip this many results.Default: 0

Example Request
GET /api/mailstats/common-attachments?startDate=2017-03-25&endDate=2017-03-28T02:53:50.269Z&limit=100&skip=10000

Example Response
[
    {
        _id: "d98f50c1cb9598b1d3cdf69779d5a435",
        n: 3
    },
    {
        _id: "b556203c4d5f74def67e1b7087548907",
        n: 3
    },
    {
        _id: "a58180dd3c36128f48e425f8f15ce204",
        n: 2
    },
    {
        _id: "29f28a35b7fe4c870a5db3b0b3fe712c",
        n: 2
    },
    {
        _id: "f7f3f975bdfb0044a96c1dc27d18d0fb",
        n: 2
    }
]

GET /api/mailstats/common-attachments/:md5sum/count

Count the number of email messages that have attachments with this md5sum.

Limited to non-private inboxes.


Example Response
{
  n: 70
}

GET /api/mailstats/common-attachments/:md5sum

List the email messages that have attachments with the supplied md5sum.

Limited to non-private inboxes.


Example Request
GET /api/mailstats/common-attachments/666b9ef33066967f24c57445e07fb1a0

Example Response
[
   {
       inbox: "xh@mailsac.com",
       _id: "qC4068KcUG0ht6eBfnFcEtXs7",
       from: [
           {
               address: "a@b.com",
               name: "Aaa"
           }
       ],
       subject: "Stuff",
       received: "2017-04-23T05:49:29.297Z",
       originalInbox: "xh@mailsac.com",
       attachments: [
           "06f33e07967f624c57445666b9efb1a9",
           "666b9ef33066967f24c57445e07fb1a0"
       ]
   },
   {
       inbox: "joe@example.com",
       _id: "Ms8PPC9FKPOwi2o8OwMs89CQw",
       from: [
           {
               address: "belmo@a.co",
           }
       ],
       subject: "Chicken sandwich",
       received: "2017-04-26T05:42:29.444Z",
       originalInbox: "joe@example.com",
       attachments: [
           "06f33e07967f624c57445666b9efb1a9"
       ]
   }
]

GET /api/mailstats/common-attachments/:md5sum/download

Download the attachment with the md5sum.

Blacklist

GET /api/mailstats/blacklist

Get an array of blacklisted domains and IP addresses.

[
    'example.com',
    '192.168.0.1'
]

GET /api/mailstats/blacklist/:domainOrIP

Check if a domain or IP is on the blacklist.

Returns 404 if not blacklisted.

Returns 200 if blacklisted.