Retrieve log files

Everything that passes through SMTPeter gets logged: deliveries, bounces, clicks, opens - all these events are written to log files. These log files are accessible through the REST API with the following methods:


The above methods can be used to (1) see for which dates log files are available, to (2) see the log files kept for one specific date and to (3-6) download a single log file.

Available dates

We store all log files in directories grouped per date. To get an overview of all available dates, you can call the "logfiles" method without a date or filename parameter (the first method shown above). This returns a JSON array holding dates.

[ "2016-03-20", "2016-03-21", "2016-03-22" ]
// UTC time

Log files per date

To get a list of all log files available for one date, you can use the second method. The date must be in "YYYY-MM-DD" format. This method returns a list of all available log files.


The names of the log files have the form "PREFIX.DATE.log". The "PREFIX" tells you what sort of events get logged. The following prefixes exist:

Prefix Description
attempts log file information about all messages sent through SMTPeter
bounces log file information about messages that bounced
clicks log file information about the clicks generated
deliveries log file information about the messages delivered
dmarc log file information about received dmarc reports
failures log file information about failed deliveries
opens log file information about when messages are opened
responses log file information about response mails received by SMTPeter

Downloading files

Log files can be downloaded in CSV, JSON, and XML format, so you can use the tools you are accustomed to, to process the log files. To download a log file in the CSV format you, append the name of a log file to the REST API url. You should use a HTTP GET call to get the log file

This returns a CSV file without any variable names. If you want to have variable names on the first line of your CSV file, you append header to the call.

The exact names are given in the articles on the specific logfile (see the table above). Note that some fields in the returned CSV file contain newlines, if this is a setting that your CSV processing tool has.

To download the file in JSON format you add "/json" to the filename you want to download.

You JSON that you receive is an array containing JSON objects that have as properties the names of the variables. These names are given in the articles on the specific log file (see the table above).

Finally if you want to download the files in XML format you add "/xml" to the file name you want to download.

The format of the xml file is as follows:


The NAMEs can be found in the articles on the specific log file articles (see the table above).

More information

Found a typo?

You can find this documentation page on GitHub.
Propose a change