Export logs
Purpose
This API allows you to export the desired logs—emails, activity and suppression list.
Request URL
Method : POST
https://api.zeptomail.com/v1.1/{{export_type}}/exports
OAuth scope
The steps to generate and use OAuth token can be found here.
scope=Zeptomail.Exports.All
or
scope=Zeptomail.Exports.CREATE
ALL -This gives full CRUD (Create, Read, Update and Delete) access to all export APIs.
CREATE - This allows access to perform the CREATE operations only.
Steps to obtain the Agent key
The Agent key represents the Agent whose logs you wish to export. The Agent key is the Agent alias available in your ZeptoMail account. To obtain the key:
- Navigate to the SMTP/API tab. Go to the API section.
- Copy the Agent alias from this section.
Agents >> API section >> Copy the Agent alias
Path parameters
| Parameter name | Value | Description |
| export_type* | Value: mail-logs or activity-logs or suppression-list | Type of data to be exported. |
Request Body
The request body varies for each type of export— email logs, suppression list logs and activity logs. Use the appropriate values in your request body, based on your preference of export.
Request body for email logs export
- date_from String
- Date from which the values are to be fetched.
- Format: DD/MM/YYYY, hh:mm AM/PM. Example: 19/02/2025, 01:00 AM.
- date_toString
- Date till which the values are to be fetched.
- Format: DD/MM/YYYY, hh:mm AM/PM. Example: 19/02/2025, 01:00 AM.
- is_sb Boolean
- Values: True or False.
- Specify if you wish to export soft bounce data.
- is_hb Boolean
- Values: True or False.
- Specify if you wish to export hard bounce data.
- is_delivered Boolean
- Values: True or False.
- Specify if you wish to export delivered emails' data.
- is_mailfailureBoolean
- Values: True or False.
- Specify if you wish to export any process failed logs.
- bounce_categoryString
- Specifies the type of bounce error encountered in ZeptoMail. The list of bounce errors are mentioned here. You can add the required value in your API call.
- mailagent_keyString
- The Agent alias value. Can be obtained using the steps mentioned here.
- passwordString
- The necessary password if you want to password-protect the exported data.
- fromString
- The sender whose email logs you wish to export.
- toString
- The recipient whose logs you wish to export.
- ccString
- The cc'd recipients whose data you wish to export.
- bcc String
- The bcc'd recipients whose data you wish to export.
- subjectString
- Any email subject based on which you wish to export the files.
- client_referenceString
- The reference id generated for the email.
Request body for suppression logs export
- date_from String
- Date from which the values are to be fetched.
- Format: DD/MM/YYYY, hh:mm AM/PM. Example: 19/02/2025, 01:00 AM.
- date_toString
- Date till which the values are to be fetched.
- Format: DD/MM/YYYY, hh:mm AM/PM. Example: 19/02/2025, 01:00 AM.
- dndType String
- Values: email | domain
- Represents the type of suppression you wish to export— email or domain.
- passwordString
- The necessary password if you want to password-protect the exported data.
Request body for activity logs export
- date_from String
- Date from which the values are to be fetched.
- Format: DD/MM/YYYY, hh:mm AM/PM. Example: 19/02/2025, 01:00 AM.
- date_toString
- Date till which the values are to be fetched.
- Format: DD/MM/YYYY, hh:mm AM/PM. Example: 19/02/2025, 01:00 AM.
- entity String
- Represents a section within the ZeptoMail account. For example: IP restriction, Agent, Email template.
- You can add the desired entity to export the related information.
- passwordString
- The necessary password if you want to password-protect the exported data.
- modified_byString
- The user who has performed an action on the entity.
Note:
- * - Mandatory parameter
- The exported files will be available only for 3 days. We recommend you to download them within that time. You can download the exported files using the Download Exports API.
Sample request
Copiedcurl "https://api.zeptomail.com/v1.1/{{export_type}}/exports"
-X POST
-H "Authorization : Zoho-oauthtoken ***"\
-H "Content-Type : application/json" \
-d
'{
"date_from":"19/02/2025;10 AM"
"date_to":"19/07/2025;10AM"
"is_sb":"true"
"is_hb":"false"
"is_delivered":"true"
"is_mailfailure":"false"
"bounce_category":"Invalid DNS"
"mailagent_key":"1bc8a7c7c719f435"
"password":"***"
"from":"rebecca@zylker.com"
"to":"paul@zylker.com"
"client_reference":"agent-1"
}Sample response
Copied"data": [
{
"created_time": "19 Jul 2025 09:00 AM",
"export_type": "mail-logs",
"modified_time": "19 Jul 2025 09:00 AM",
"is_content_included": false,
"file_status": "completed",
"file_name": "MailReport - 19 Jul 2025 09:00 AM.zip",
"is_downloaded": false,
"export_id": "38747230-0711-11f1-9ca1-5254003efefb",
"search_query": {
"mailagent_name": "All Agents",
"is_delivered": true,
"date_to": "19 Jul 2025 10:00 AM",
"date_from": "19 Feb 2025 10:00 AM"
},
"expiry_time": "22 Jul 2025 10:00 AM",
"created_by": "Rebecca",
"file_size": 3952
},
],
"status": "success"