SFTP

Overview

Secure File Transfer Protocol (SFTP) is a network protocol for securely accessing, transferring, and managing large files and sensitive data over any reliable data stream. Designed by the Internet Engineering Task Force as an extension of Secure Shell (SSH) version 2.0, SFTP provides secure file transfer capabilities.

How Does MoEngage Work with SFTP?

MoEngage allows customers to automatically import users and events from their SFTP servers and export events from MoEngage through flat files.

Integration with SFTP servers allows MoEngage to:

  • Share periodic exports of campaign interaction events in JSON format.
  • Support for Username + Password and Username + SSH Key auth.
  • Support for hosts Virtual Private Cloud (VPC) or private endpoints. 

You can export all user and campaign events created, received, or generated by MoEngage to your SFTP servers. By performing this, you can analyze the exported data to gather insights into user behavior, preferences, and other related issues.

Integration

library_add_check

Prerequisites

Make sure you have the necessary connection access to your SFTP server.

Configure a New SFTP Connection

To import data from or export data to SFTP servers, you must configure a connection between MoEngage and your SFTP server.

To create a new SFTP connection, perform the following steps:

  1. On the left navigation menu on the MoEngage UI, click App marketplace
  2. On the App marketplace page, in the search bar, type SFTP.
  3. Click the SFTP tile. The SFTP page appears.
  4. Go to the Integrate tab, and then click + Add connection.
  5. In the Connection details section, enter the following details:


    Field Description Example
    Connection Name Specifies the identifiable name of the connection. SFTP Connection
    Host

    Enter the hostname that you want to connect to.

    128.0.0.0 or ftp.moengage.com
    Port Enter or select the port to which you want to connect your SFTP server.

    Valid ports range from 1 to 65535. The default port is 22.

    Username

    Enter the username for the SFTP connection. You can enter an existing user with read and write access or create a new one for MoEngage.

    John Doe
    Authentication
    Method

    You must select one of the following methods for MoEngage to connect to your SFTP server:

    • Password: Enter the password of the SFTP user (username) in the Password box.
    • Key: MoEngage connects to your SFTP server using the key pair authentication method. You must use this option to generate a key. For more information, refer to Manage Your SFTP Key (Key Rotation)
    • 2FA (Both): MoEngage attempts to connect using both Password and Key authentication. The connection proceeds successfully if either the password or the key matches; it does not perform a strict check requiring both.

    For Key and 2FA (Both) authentication:

    1. Select Key or 2FA (Both) as your Authentication method.
    2. Click the Generate Key icon , and MoEngage displays your public key. You must add this public key to your SFTP server. For more information, refer to How to add a new SSH key to a cloud server (unverified public article).

      Note: The key generated is a public key. For 2FA (Both), you must enter the Password and generate/use the Key.
    1.  
     
  6. You can click Test connect to verify the credentials and test your details before saving the connection. When you're ready, click Connect to save the connection and proceed.
    Note: If you generate a new key for rotation, you must test the connection successfully to complete the rotation, or MoEngage will continue using the old Key.

After the connection between MoEngage and your SFTP server is successful, you can use it to configure various imports and exports in MoEngage.

Manage Your SFTP Key (Key Rotation)

MoEngage also supports key rotation. If your IT policy requires you to rotate the keys, you can do it by performing the following steps:

  1. Go to the App marketplace SFTP > Integrate and edit the connection.
  2. Click the Generate new key icon .
    The Generate a new key pop-up window will appear, prompting you to review the instructions.
    Note: Read the instructions carefully. After you save the connection with the newly generated key, MoEngage will no longer use the previous key. You must ensure that the new key is added to your SFTP server so the rotation works properly. If the new key is not added after saving the connection, your imports and exports might break.
  3. Click Generate new key.
    After MoEngage successfully generates the key, a confirmation message is displayed. MoEngage highly recommends that you copy this new key using the icon and attach it as an additional key to your SFTP server. You can also download the key using the  icon. After attaching the new key, you must test the connection successfully to complete the rotation.
    Note: If you generate a new key for rotation, you must test the connection successfully to complete the rotation, or MoEngage will continue using the old key.

Set Up Imports from SFTP

MoEngage allows customers to import users and events through files stored inside your SFTP folders. For more information, refer to SFTP Imports.

Set Up Exports to SFTP

info

Information

  • The export option is enabled only when you set up at least one connection.
  • MoEngage requires permissions to create folders and write files on your SFTP server. It is recommended to give full write access to a dedicated MoEngage directory on your SFTP server.
  • Exports to SFTP are part of the Streams add-on. Please reach out to your dedicated MoEngage CSM (customer success manager) to get it enabled for your account.

To enable SFTP Exports on the MoEngage App Marketplace:

  1. On your MoEngage UI, go to the App Marketplace.
  2. Search for "SFTP".
  3. Go to the Integrate tab and click + Add export.
  4. Enter the export details:

    Field Description Example
    Export name

    Give the export a name.

    SFTP Export
    SFTP connection Select an existing SFTP connection from the list of connections you created in Set Up a New SFTP Connection. SFTP Connection
    Folder path

    The folder path to which we will dump the files.

    You can see the preview of the final file path below.

     
    Export all files in one folder

    Select this option if you want MoEngate to dump all the files in a single folder. If this is disabled, we will create a new folder for each day inside the folder path provided by you.

    You can see the preview of the final file path below.

     
    User properties

    Select user properties (user properties and device properties) you want to export with your events.

    User attributes (such as user attributes, device attributes, and custom attributes) are available in Data Management for that Database/App.

     
    Select events

    Select the events you want to export to your SFTP server. The available options are:

    • All events
    • Select events manually

    You can choose to export "All events" (existing and new events coming into MoEngage in the future) or cherry-pick events manually and export only those events.

     
    Select events (drop-down)

    This drop-down list is visible only if you select Select events manually under Select events.

    The events on this drop-down list are auto-populated with all the events in Data Management for that Workspace.

     
    Frequency

    Select how often you want to export these events. We offer three frequencies:

    • Every 15 mins: We will dump files at 15-minute intervals.
    • Daily: We will dump files at the end of each day, 02:00 UTC.
    • Weekly: We will dump files on every Monday, 02:00 UTC.

    A preview of next dump is displayed in case of Daily and Weekly.

     
  5. Click Save export. Your export will be saved and when the Export status toggle is turned on, MoEngage will start exporting files to the specified folder path on your SFTP server based on the selected export frequency.
    info

    Information

    MoEngage utilizes the Paramiko (4.0.0) library to establish a native connection to your SFTP servers. This routine upgrade ensures that all integrations remain robust and comply with modern encryption standards.

Events and Attributes

With the MoEngage and SFTP integration, you can export all events coming into MoEngage to your SFTP servers. By default, MoEngage tracks some standard events and user properties through its SDKs. You can read about our standard events and attributes here. You can also export any custom user-defined event you tracked in MoEngage.

Data Export Format

Information Description 
File Format JSON
Compression Type GZip
Export Frequency Every 15 mins, Daily, or Weekly
Sample Folder Path

sftp://<host_name>/[<folder_path>/]<connection_name>/export_date={DD-MM-YYYY}/{filename=event_export}_<unique_string>[_<file_number>].json.gz

Here:

  • <folder_path> is the prefix folder path given by you.
  • <connection_name> is the connection name sluggified as entered by you.
  • File number is optional in case we split the files.

Note: The file naming convention change will be effective December 25, 2025. The file naming format for exports is being updated from an epoch timestamp to a unique string. Ensure any data pipelines are configured to handle the new format.

  • Current name (epoch timestamps): export_day=2025-10-28/event_exports_1761689701.json.gz
  • New name (unique str): export_day=2025-10-28/event_exports_50492790da7cc2a0674fb51fa5046e3c.json.gz

You can download a sample file from here. This is a GZIPPED file and you must extract it before you can view the files. 

For the full list of events and attributes exported, refer to the Data Exports Glossary.

Frequently Asked Questions

arrow_drop_down How soon will I start getting the data?

It typically takes up to 30 minutes for the automated data exports to be set up for your account and for you to start seeing data there.

arrow_drop_down Can I export additional events at a later time?

Yes, if you need to export new events at a later time, you can always edit your configuration on the App Marketplace and get the new events added to your exports.

arrow_drop_down Can I export historical data using Automated Data Exports?

As of now, you cannot export historical data using Automated Data Exports. Once configured, you will start seeing data for each event from the time you enabled your exports.

arrow_drop_down Is there any pricing involved for Automated Data Exports?

If your billing plan does not cover this already and you need to get this enabled at a later time, you would need to work with your Customer Success Manager to get this included in your billing plan. Based on the amount of data that MoEngage will place in your Data warehouse/Partner/API on a monthly basis, this could lead to additional charges.

arrow_drop_down Does Data Exports guarantee the latest user attributes?

No, Data Exports is primarily built to export your Events in near real-time and user attributes in MoEngage are updated asynchronously so it is currently not possible to guarantee the latest values of user attributes in the exports.

Previous

Next

Was this article helpful?
3 out of 5 found this helpful

How can we improve this article?