> ## Documentation Index
> Fetch the complete documentation index at: https://moengage-docs-limits-messaging.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# S3 Imports

> Import users, events, and auxiliary data from Amazon S3 buckets into MoEngage. Configure S3 integration for registered and anonymous user profiles.

# Overview

MoEngage allows customers to import users and events through files stored inside S3 Buckets.

# Types of Imports

MoEngage can import the following from your S3 buckets:

1. **Registered Users**: These are users who are already registered on MoEngage.
2. **Anonymous Users**: These are users who are not yet registered on MoEngage.
3. **Events** (Standard and User-Defined): MoEngage can import standard events like Campaign Interaction Events as well as your own user-defined events.
4. **Auxiliary Data**: These are users added temporarily.

# Prepare the Files

Refer to the [File Imports help doc](/user-guide/data/imports/overview/overview-imports) to understand the supported file types, naming conventions, file structure, etc. Once you are ready with the files, you need to place them inside a folder on your S3 bucket.

## Folder Structure

Place all files into an Amazon S3 Folder. You can configure the folder path while setting up the import.

<img src="https://mintcdn.com/moengage-docs-limits-messaging/HVDKMwNkvyJWncJo/images/FolderStructure.png?fit=max&auto=format&n=HVDKMwNkvyJWncJo&q=85&s=9a43e14d47eda5c6e6eadf4febaff2b4" alt="Folder Structure" width="2208" height="1316" data-path="images/FolderStructure.png" />

Note that MoEngage will not look for files inside any subfolders.

# Required Access Permissions

Before MoEngage can import files, grant it read access to your S3 bucket and set up a connection in the App Marketplace. For the IAM permissions and the connection setup, see [Set Up Authentication](/partner-guide/data-and-analytics/cloud-storage/amazon-s3#step-1-set-up-authentication) and [Grant Permissions](/partner-guide/data-and-analytics/cloud-storage/amazon-s3#step-2-grant-permissions) in the Amazon S3 integration guide.

# Set Up Imports from S3

<Info>
  **Prerequisites**

  Make sure to complete all the steps mentioned in the [File Based Imports](/user-guide/data/imports/overview/overview-imports) help doc.
</Info>

To set up the S3 imports, perform the following steps:

1. On the sidebar menu in MoEngage, hover over the Data menu item <img src="https://mintcdn.com/moengage-docs-limits-messaging/i4hMAp3mNZ6jymt-/images/imports-from-s3-1-.png?fit=max&auto=format&n=i4hMAp3mNZ6jymt-&q=85&s=19d7cb8f0b23960073ef5e548946b574" alt="Data menu item" width="44" height="38" data-path="images/imports-from-s3-1-.png" />. The **Data** menu appears.
2. Click **Data imports**. <img src="https://mintcdn.com/moengage-docs-limits-messaging/i4hMAp3mNZ6jymt-/images/imports-from-s32.png?fit=max&auto=format&n=i4hMAp3mNZ6jymt-&q=85&s=42e3815f43fd8d8158c54da9ca5cca0b" alt="Data imports menu option" width="396" height="216" data-path="images/imports-from-s32.png" />
3. On the **Data imports** page, click the **Data warehouses** tab.
4. Click **+ Import** in the upper-right corner and select **Users** or **Events** to create a new import.
5. Click the **S3** tile.
6. Click **Continue**. <img src="https://mintcdn.com/moengage-docs-limits-messaging/kqeXvfqHzHyxwSSF/images/s3-imports-continue.png?fit=max&auto=format&n=kqeXvfqHzHyxwSSF&q=85&s=7457c3c13a96ffaab32ae2f616549591" alt="Continue button" width="1068" height="702" data-path="images/s3-imports-continue.png" />

## Step 1: Configure S3 Connection and File Format

#### **User Imports**

1. Select whether you want to import Registered users or Anonymous users.

<img src="https://mintcdn.com/moengage-docs-limits-messaging/kqeXvfqHzHyxwSSF/images/s3-cross-5.png?fit=max&auto=format&n=kqeXvfqHzHyxwSSF&q=85&s=52510416bd33aacb7b810eea431bbf94" alt="User import type selection" width="1539" height="770" data-path="images/s3-cross-5.png" />

2. Choose which user type you want to import. Both registered users import and anonymous users import expect different file names. Refer to the [Naming Conventions](/user-guide/data/imports/overview/overview-imports#naming-conventions) section for more information.

#### **Event Imports**

1. For Event imports, select which event you want to import from the dropdown list.

<img src="https://mintcdn.com/moengage-docs-limits-messaging/kqeXvfqHzHyxwSSF/images/s3-cross-6.png?fit=max&auto=format&n=kqeXvfqHzHyxwSSF&q=85&s=28a875a91312fcb530fefa2f02ff4f29" alt="Event import selection" width="1546" height="828" data-path="images/s3-cross-6.png" />

2. Based on the event you pick, your file names must begin with the Event Name of your chosen event. The **Select event** dropdown displays the Display Names of all the available events in your MoEngage app.

<img src="https://mintcdn.com/moengage-docs-limits-messaging/i4hMAp3mNZ6jymt-/images/import-namekkkk.png?fit=max&auto=format&n=i4hMAp3mNZ6jymt-&q=85&s=495f44baddfe22c47b43a762adf32f17" alt="Select event dropdown" width="1232" height="990" data-path="images/import-namekkkk.png" />

In the above example, "App/Site Opened" is the Display Name of the chosen event and its Event Name is `MOE_APP_OPENED`, so the file names should begin with `MOE_APP_OPENED`.

3. You can also create a new event by clicking the **+ Create new event** option at the end of the dropdown list.

<img src="https://mintcdn.com/moengage-docs-limits-messaging/ktt9rX94s2eDWglB/images/create-new-event-bin.png?fit=max&auto=format&n=ktt9rX94s2eDWglB&q=85&s=79d036bef01fa5676e0acf9dcd3885e9" alt="Create new event" width="952" height="502" data-path="images/create-new-event-bin.png" />

4. Give your event a unique name. By default, your Display Name will be the same as the Event Name. You can go to the [Data Management](/user-guide/settings/data-management/overview-data-management#event-tab) page to view or edit this event and your other MoEngage events. Note that any new events you create will only be available in your app after the first successful import.

### Select Your S3 Bucket Connection

To select your S3 bucket connection, perform the following steps:

1. In the **S3 connection** list, click your preconfigured connection. If you have not created an S3 connection, click **+ Add connection** to configure one in the App Marketplace. For more information, refer to [Connect Amazon S3 in the App Marketplace](/partner-guide/data-and-analytics/cloud-storage/amazon-s3#step-3-connect-amazon-s3-on-the-app-marketplace).
2. In the **File type** list, click your file format (for example, click **CSV**). Only CSV and JSON files are supported.
3. In the **Folder path** box, type your directory path (for example, type bq\_imports3). Do not include the bucket name or trailing slashes. MoEngage resolves your S3 bucket name automatically based on your marketplace connection.
4. Select the **Is your file encrypted?** check box if your source files are encrypted by using PGP. Paste your private **PGP Decryption Key**, attach your optional public **Signing Key**, and type your **Key passphrase**. <img src="https://mintcdn.com/moengage-docs-limits-messaging/kqeXvfqHzHyxwSSF/images/s3-imports-select-connection.png?fit=max&auto=format&n=kqeXvfqHzHyxwSSF&q=85&s=1a4b573222a8eceb138754f54338865f" alt="Select Your S3 Bucket Connection panel with connection, file type, folder path, and encryption options" width="410" height="380" data-path="images/s3-imports-select-connection.png" />

<img src="https://mintcdn.com/moengage-docs-limits-messaging/HVDKMwNkvyJWncJo/images/IMport_name.png?fit=max&auto=format&n=HVDKMwNkvyJWncJo&q=85&s=36bb588ae8d617cdc95b2d53ca4d722d" alt="Import Name field" width="572" height="174" data-path="images/IMport_name.png" />

5. Enter a unique name for this import to easily identify it on the Imports Dashboard.

### File Configurations

<img src="https://mintcdn.com/moengage-docs-limits-messaging/HVDKMwNkvyJWncJo/images/FileName_Configuration.png?fit=max&auto=format&n=HVDKMwNkvyJWncJo&q=85&s=4027b5c3b2e7ae9846457630421d7027" alt="File name suffix configurations" width="1162" height="188" data-path="images/FileName_Configuration.png" />

1. Select the DateTime format that will be in your file name. Your file name must end with `_<date time format>.csv`. Ensure you have at least one file available in the specified folder path; otherwise, you will not be able to continue. Click the "Fetch file(s)" button to fetch your latest file.

If your S3 credentials and chosen file format are correct, MoEngage displays a preview showing the top 5 rows of your file:

<img src="https://mintcdn.com/moengage-docs-limits-messaging/5XsPhWw9tJ7LnV8Y/images/moengage_5d8991.png?fit=max&auto=format&n=5XsPhWw9tJ7LnV8Y&q=85&s=8da00a461da4427962eb92e3b5bb4baf" alt="File preview success pane" width="2456" height="1372" data-path="images/moengage_5d8991.png" />

If MoEngage encounters an error while fetching the file from your S3 bucket, it displays one of the following alerts:

* **Given S3 Access Key is not valid** - Verify your S3 Marketplace connection details and try again.
* **Please check the folder path and try again** - Verify that your folder path is correct and ensure that compatible CSV files are present inside the folder.
* **Found zero data rows in the file** - The retrieved file does not contain any rows after the header row. MoEngage expects at least 2 rows (1 header row + 1 data row) in the file.

2. Once you are satisfied with the preview of the file, click **Next** to continue.

## Step 2: Map Your Columns to MoEngage Attributes

Map the columns of your CSV file to the attributes present inside MoEngage:

<img src="https://mintcdn.com/moengage-docs-limits-messaging/Ml1A2vA11CV2ejjE/images/moengage_c16e1d.png?fit=max&auto=format&n=Ml1A2vA11CV2ejjE&q=85&s=cf2382057a86ec5f6c7e5f700085a90a" alt="Step 2 column mapping panel" width="1591" height="821" data-path="images/moengage_c16e1d.png" />

1. **Column name**: The column name is mapped. Below the column name, MoEngage displays a sample value for your reference.
2. **Map attribute**: Select the target MoEngage attribute you want to map the column to. You can also click **+ Create attribute** to define a new parameter.
3. **More actions**: Click **Skip** to exclude this column from being imported.

Ensure you configure the required mandatory mappings based on your import type:

1. **User imports (Registered)**: You must map your identifier column to the MoEngage **User ID** attribute.
2. **User imports (Anonymous)**: You must map your identifier column to the MoEngage **Anonymous ID** attribute.
3. **Event imports**: You must map your identifier column to the **User ID** attribute and map your timestamp column to the **Event Time** attribute.

<img src="https://mintcdn.com/moengage-docs-limits-messaging/yCkUtmMyfDMEZ5Hw/images/moengage_caf68e.png?fit=max&auto=format&n=yCkUtmMyfDMEZ5Hw&q=85&s=2ae7dbe433f90f9fdff0e42ccc067baf" alt="Mapping identifier checkmark" width="2424" height="481" data-path="images/moengage_caf68e.png" />

To create a new attribute, click **+ Create attribute** from the dropdown list:

<img src="https://mintcdn.com/moengage-docs-limits-messaging/DdiELsn8czqpj1h6/images/moengage_3665d8.png?fit=max&auto=format&n=DdiELsn8czqpj1h6&q=85&s=d148ade5bb18e833adcc37438c3a7467" alt="Create new attribute modal" width="954" height="622" data-path="images/moengage_3665d8.png" />

### Add Fields

You can also add fields directly from the dashboard by clicking on **+Add Field** to enter your attribute mappings manually.

<img src="https://mintcdn.com/moengage-docs-limits-messaging/F9ipI4FeNCnWteI-/images/moengage_7d804b.png?fit=max&auto=format&n=F9ipI4FeNCnWteI-&q=85&s=61d66e3f004cebf1071326145c36d48e" alt="Add field action block" width="1602" height="799" data-path="images/moengage_7d804b.png" />

### Manifest Files

Optionally, you can choose to auto-map these columns by uploading a manifest file. To upload a manifest file, click the **Upload mapping file** option on the top-right of the mapping table:

<img src="https://mintcdn.com/moengage-docs-limits-messaging/Fi6nHQCAQfW0sis2/images/moengage_4a8a1a.png?fit=max&auto=format&n=Fi6nHQCAQfW0sis2&q=85&s=e623d8b6d0cbf52a93d70faa5061f7ce" alt="Upload mapping CTA" width="1602" height="468" data-path="images/moengage_4a8a1a.png" />

<img src="https://mintcdn.com/moengage-docs-limits-messaging/LdoX_y8pC8KPhmsc/images/moengage_30d3db.png?fit=max&auto=format&n=LdoX_y8pC8KPhmsc&q=85&s=9c887536944ab4e6ad99c87a24965f04" alt="Manifest upload dialog box" width="1188" height="664" data-path="images/moengage_30d3db.png" />

Upload your manifest file and click **Done**. Your mappings will be auto-configured. For any additional attributes not currently present in MoEngage, a modal lists down these attributes for you to create:

<img src="https://mintcdn.com/moengage-docs-limits-messaging/e22o1m7gKjbDolNa/images/moengage_8d0e71.png?fit=max&auto=format&n=e22o1m7gKjbDolNa&q=85&s=f221f0042278a32856efa2c79ed26c2e" alt="Create new attributes modal" width="1368" height="770" data-path="images/moengage_8d0e71.png" />

### Portfolio Support (Project-Level Routing)

<Info>
  **Portfolio Routing**

  This feature allows you to route imported events from files stored inside your Amazon S3 bucket to specific projects within your MoEngage portfolio workspace using column mapping.
</Info>

To route events to specific projects, map your S3 identifier column (such as `brand_name` or `app_id`) to the MoEngage attribute `moe_project_name` in Step 2 of the import configurations. Ensure that the source text values exactly match your MoEngage project names. Matching is case-sensitive.

* **Successful routing**: If the value matches your portfolio configuration, MoEngage ingests the user or event directly at that specific project level.
* **Fallback behavior**: If the mapping is missing, blank, or does not match a project name, MoEngage ingests the data at your global portfolio level. <img src="https://mintcdn.com/moengage-docs-limits-messaging/Nh_wdMaF4-AAdzGw/images/moengage_ffc676.png?fit=max&auto=format&n=Nh_wdMaF4-AAdzGw&q=85&s=469e0c21647f57bf90d89845a78785e3" alt="Portfolio routing fallback behavior" width="2752" height="1078" data-path="images/moengage_ffc676.png" />

### Send Import Notifications

<img src="https://mintcdn.com/moengage-docs-limits-messaging/pvqMVHdmaM8zoyr-/images/moengage_fcb3f7.png?fit=max&auto=format&n=pvqMVHdmaM8zoyr-&q=85&s=b59628e270d5f4b1ada40424e84f3497" alt="Notification setup screen" width="622" height="366" data-path="images/moengage_fcb3f7.png" />

Select up to 10 emails to receive import status alerts when your import is created, succeeds, or fails.

When you are satisfied with all mappings, click **Next**.

## Step 3: Select the Import Frequency

<img src="https://mintcdn.com/moengage-docs-limits-messaging/haZKi6WfMK0B1Yv7/images/moengage_c6057a.png?fit=max&auto=format&n=haZKi6WfMK0B1Yv7&q=85&s=6aa5507ba199c9db30a4fcf7749bd840" alt="Select import frequency slider" width="2452" height="1242" data-path="images/moengage_c6057a.png" />

Define when MoEngage should retrieve your files:

1. **One-Time Imports**: Run the import immediately or schedule it for a future date and time.
2. **Periodic Imports**: Run your imports hourly, daily, weekly, or monthly.

Click **Done** when you are ready.

## Duplicate Imports

An import is considered a duplicate when all of the following parameters are the same as an existing active import schedule:

1. **Import Type**: Users / Events
2. **Import Sub-Type**: Event Name / Registered / Anonymous
3. **S3 Folder Path**
4. **Bucket Name**

As long as any one parameter is different, the import is considered unique.

# Frequently Asked Questions

<Accordion title="My imports have failed. How do I check what went wrong?">
  Click the ellipsis icon on the right side of your import row and click **View** to review your details. Hover over the **Failed** status label to read the error details.
</Accordion>

<Accordion title="What happens when there is an error in fetching the files from the S3/SFTP folder?">
  MoEngage does not automatically retry imports when they fail. You can configure to receive an email alert upon failure by selecting the notification checkbox during setup.
</Accordion>

<Accordion title="A file failed with 'Applicable rate limit breached'. Will the periodic import reprocess it automatically?">
  No. When a file exhausts its processing retries and fails with the *Applicable rate limit breached* status, MoEngage cannot replay that file on its own, so the periodic schedule does not reprocess it automatically. This retry limit protects the ingestion pipeline from being overloaded. To reprocess the affected files, rename them and re-upload them to your S3 folder so that MoEngage treats them as new files. To reduce the chance of hitting rate limits, stagger large batches instead of scheduling many files at once (see [Best Practices](/user-guide/data/imports/overview/overview-imports#best-practices)).
</Accordion>

<Accordion title="What if a scheduled import adds the data into a recently archived segment?">
  The new data is still added to the archived segment. You can unarchive the segment as required inside your Data Management dashboard.
</Accordion>

<Accordion title="How does MoEngage pick up new files in a periodic run?">
  During each scheduled run, MoEngage searches your designated folder path and selects new files based on your file prefix and datetime format configurations. MoEngage tracks file names and directory paths to ensure it only processes new files.
</Accordion>

<Accordion title="Will a periodic Data import pick up an earlier processed file?">
  No. MoEngage does not re-process files that have already been imported as long as the file names and directories remain identical. If you place a previously processed file inside a different folder, an import task targeting that new folder will process the file again.
</Accordion>

<Accordion title="Can a CSV file contain both User and Event data?">
  No. You must set up user imports and event imports as separate, distinct tasks inside MoEngage. Therefore, ensure that each source file contains only user attributes or event records.
</Accordion>

<Accordion title="Can an import be stopped while it's running?">
  Once an import process starts, it can't be stopped midway. This is because the data goes through several steps, and interrupting it could lead to incomplete or inconsistent results. It's best to let the current import finish processing.
</Accordion>

<Accordion title="How can I stop future runs of a scheduled import?">
  You can stop future scheduled imports from running automatically. To do this, find the import schedule on the Data Imports dashboard, click the ellipsis icon, and select the **Archive** option. This prevents the import from running on its next scheduled time.
</Accordion>

<Accordion title="What should I do if an import seems stuck or is taking a long time?">
  If an import appears to be stuck or is taking longer than usual, wait for the system to process the files. The system has checks in place to handle these situations automatically and will retry if necessary. Manually starting the same import again while it is still processing can cause conflicts and may prevent the original import from completing successfully.
</Accordion>
