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

# Set Up a File Import

> Automate imports of users, events, and auxiliary data from files in Amazon S3 or an SFTP server into MoEngage. Prepare files, map columns, and schedule syncs.

MoEngage automates imports of users, events, and auxiliary data from files you drop in an Amazon S3 bucket or an SFTP server. You prepare your files, configure the connection and column mapping once, and MoEngage picks up new files on a one-time or periodic schedule.

Select your source in any tabbed section below and the page stays on that source throughout.

# Types of Imports

MoEngage can import the following from your files:

* **Registered Users**: Users who are already registered on MoEngage.
* **Anonymous Users**: Users who are not yet registered on MoEngage.
* **Events** (Standard and User-Defined): Standard events such as Campaign Interaction Events, as well as your own user-defined events.
* **Auxiliary Data**: Supplementary user data ingested temporarily. Auxiliary Data has its own setup. See [Auxiliary Data](/docs/user-guide/data/imports/auxiliary-data).

# Prepare Your Files

## Supported File Types

MoEngage supports **CSV** and **NDJSON** files, in UTF-8 encoding.

| File Type     | Users | Events | Auxiliary Data |
| ------------- | :---: | :----: | :------------: |
| CSV           |   ✅   |    ✅   |        ✅       |
| JSON (NDJSON) |   ✅   |    ✅   |        ❌       |

## Naming Conventions

Name your files so that MoEngage can identify the import type and the run date:

<Info>
  Give every file a unique name. MoEngage skips any file name it has already processed, whether the previous import succeeded, partially succeeded, or failed.
</Info>

A file name has two parts: `<import type>_<date time format>.<file extension>`.

* **Registered users**: prefix `registered_user_data_`, for example, `registered_user_data_01311997.csv`.
* **Anonymous users**: prefix `anonymous_user_data_`, for example, `anonymous_user_data_jan_2022.csv`.
* **Events**: prefix `<event name>_`, for example, for the event "Purchase Summary", `Purchase_Summary_31011997.csv`.

MoEngage also supports custom file names following `<custom name>_<date time format>.<file extension>`, where the custom name uses letters, numbers, spaces, and underscores.

The `<date time format>` suffix represents the day the import runs. For example, if an import runs on 7 January 2022 and the selected format is `ddmmyyyy`, MoEngage looks for files ending in `07012022.csv` or `07012022.json`. Configure the format on the dashboard during setup. Supported formats:

| Format              | Description                                                         | Example         |
| ------------------- | ------------------------------------------------------------------- | --------------- |
| `{mm}_{yyyy}`       | `mm`: month 01–12; `yyyy`: 4-digit year                             | `01_2022`       |
| `{ddmmyyyy}`        | `dd`: day 01–31; `mm`: month 01–12; `yyyy`: 4-digit year            | `31012022`      |
| `{yyyymmdd}`        | `yyyy`: 4-digit year; `mm`: month 01–12; `dd`: day 01–31            | `20220112`      |
| `{mon_yyyy}`        | `mon`: lowercase 3-letter month (`jan`–`dec`); `yyyy`: 4-digit year | `jan_2022`      |
| `{yyyymmdd}_{hhmm}` | date as above; `hh`: hours 00–23; `mm`: minutes 00–59               | `20220131_1259` |

<Info>
  Do not use `moe_` as a prefix for events, event attributes, or user attributes. It is a reserved system prefix.
</Info>

**File extensions:**

* Without encryption: `.csv`, `.json`
* With PGP encryption: `.csv.asc`, `.json.asc`, `.csv.pgp`, `.json.pgp`

## File Structure

Structure your files according to the file type you import:

<Tabs>
  <Tab title="CSV Files">
    * The first row must be the column names (treated as the header row).
    * No duplicate column names (names are case-sensitive) and no missing column names.
    * Only the comma (`,`) is supported as a delimiter.
    * Avoid empty rows.

    Sample files: [Registered Users](https://uploads-samples-cdn.moengage.com/registered_user_data.csv), [Anonymous Users](https://uploads-samples-cdn.moengage.com/anonymous_user_data.csv), [Events](https://uploads-samples-cdn.moengage.com/sample_event.csv), [Mapping File](https://uploads-samples-cdn.moengage.com/upload_mapping.json).
  </Tab>

  <Tab title="JSON Files">
    JSON files must be Newline-Delimited JSON (NDJSON) with a `.json` extension. Each line is a complete, self-contained JSON object separated by a newline:

    ```json wrap theme={null}
    {"user_id": "user123", "name": "John Doe", "email": "john.doe@example.com", "address": {"city": "New York", "zip": "10001"}}
    {"user_id": "user124", "name": "Jane Smith", "email": "jane.smith@example.com", "preferences": ["email_updates", "sms_alerts"]}
    ```

    Sample files: [Registered Users](https://app-cdn.moengage.com/partners-integration-ui/app-marketplace-public/helpdoc/registered_user_data.json), [Anonymous Users](https://app-cdn.moengage.com/partners-integration-ui/app-marketplace-public/helpdoc/anonymous_user_data.json), [Events](https://app-cdn.moengage.com/partners-integration-ui/app-marketplace-public/helpdoc/sample_event.json), [Mapping File](https://app-cdn.moengage.com/partners-integration-ui/app-marketplace-public/helpdoc/upload_mapping.json).

    #### File Structure and Mapping JSON Levels

    When you upload or select a JSON file, MoEngage generates a flattened, tabular preview of the data. This preview represents keys up to two levels deep (root level + one nested level) as distinct columns:

    ```json theme={null}
    {
      "item-id": 123,
      "item-type": "books",
      "item-cost": {
        "amount": {
          "cost-price": 100,
          "discount": 0
        },
        "currency": "USD"
      }
    }
    ```

    | Key                      | Level      | Mappable?                   |
    | ------------------------ | ---------- | --------------------------- |
    | `item-id`, `item-type`   | 1          | Directly to an attribute.   |
    | `item-cost`              | 1 (object) | As a whole Object.          |
    | `item-cost.amount`       | 2 (object) | As a whole Object.          |
    | `item-cost.currency`     | 2          | Directly to an attribute.   |
    | `cost-price`, `discount` | 3          | No, deeper than two levels. |

    #### Mapping Capabilities

    * **Mapping Primitive Keys**: Map any primitive key from Level 1 or Level 2 directly to a standard MoEngage attribute.
    * **Mapping Entire Objects or Arrays of Objects**: Map a complete JSON object or an array of objects to a single MoEngage attribute of type "Object" or "Array of Objects" respectively. When an entire object is mapped, its internal structure and all nested keys are preserved and imported. You cannot rename these keys within MoEngage.
    * **Cherry-Picking Fields**: To map only specific primitive fields from an object (up to Level 2) and not the entire parent object, skip the parent object attribute in the mapping table, then map its individual nested primitive keys.
    * **Mapping Files**: Use mapping files to automate your JSON key mappings. The mapping file references the flattened JSON paths (for example, `"column": "user_profile.id"`).

    #### Map Limitations

    **Level-2 Keys within an Array of Objects**: You cannot directly map individual Level 2 keys nested within an array of objects. You can map the entire array of objects to an "Array of Objects" attribute, which imports its full nested structure.

    #### Behavior During Data Ingestion

    * **Null or Blank Strings**: If a mapped key's value is null or an empty string, MoEngage skips it and does not update the corresponding data.
    * **Unmapped/Skipped Keys**: Any additional keys in your JSON file that are neither mapped nor marked as skipped are ignored and not ingested.
  </Tab>
</Tabs>

<Info>
  MoEngage does not support the `|` (pipe) character in non-array columns. Ensure String, Numeric, and Boolean columns do not contain this character.
</Info>

## Folder Structure

Place all files into a single folder and configure the folder path during setup. MoEngage does not look inside subfolders or the root folder.

## Array Support (CSV)

* Simple arrays are supported. Nested and associated arrays are not supported.
* The supported delimiter in the CSV is the pipe (`|`). For example: `[1|2|3]`.
* The supported data types are Array String and Array Double (numeric). Select the type in the **Map column to attribute** list during column mapping.
* All elements in an array must be homogeneous, either all integer/double or all string. If they are not, MoEngage attempts to typecast each element to the declared type and stores the result.
* **Array typecasting**: If an array `["1" | 2 | "abc"]` is mapped as Array Integer, MoEngage ingests `[1, 2]`, because `"abc"` cannot be cast to an integer and is dropped. For more information, see [typecasting in MoEngage](/docs/user-guide/settings/data-management/overview-data-management).

# Limits

File imports have the following limits:

| Limit              | Value                                                                                                               |
| ------------------ | ------------------------------------------------------------------------------------------------------------------- |
| File size          | Less than 500 MB per CSV/JSON file. Split larger files.                                                             |
| Rows               | A single CSV or JSON file supports up to your hourly row limit. Files exceeding your hourly row limit are rejected. |
| Columns/Attributes | 100 columns for users; 100 columns per event.                                                                       |
| File name prefix   | Maximum 100 characters.                                                                                             |
| Number of files    | Up to 250 files per import run.                                                                                     |

**Rate limits** (defaults, contact MoEngage to increase):

| Import Type | Hourly  | Daily   |
| ----------- | ------- | ------- |
| Users       | 600K/hr | 14M/day |
| Events      | 5M/hr   | 40M/day |

The hourly rate is the maximum ingested per hour; the daily rate is the total cap per day. When a rate limit is breached, you receive a *Rate limit breached* alert on the Data Imports dashboard.

<Tip>
  Avoid scheduling a very large number of files at the same time. Doing so can create a processing backlog and delay ingestion, even when each file is small. Stagger or batch your scheduled imports over time instead of queuing a large number of files together.
</Tip>

# Required Access and Connection

Grant MoEngage access to your source before you create the import:

<Tabs>
  <Tab title="Amazon S3">
    Grant MoEngage read access to your S3 bucket and set up a connection in the App Marketplace. For the IAM permissions and connection setup, see [Set Up Authentication](/docs/partner-guide/data-and-analytics/cloud-storage/amazon-s3#step-1-set-up-authentication), [Grant Permissions](/docs/partner-guide/data-and-analytics/cloud-storage/amazon-s3#step-2-grant-permissions), and [Connect Amazon S3 in the App Marketplace](/docs/partner-guide/data-and-analytics/cloud-storage/amazon-s3#step-3-connect-amazon-s3-on-the-app-marketplace).
  </Tab>

  <Tab title="SFTP">
    Set up an [SFTP connection](https://partners.moengage.com/hc/en-us/articles/26763225201172-SFTP#01H7YCB0T78V73YJSY4Y8A8X0S) in the App Marketplace with the relevant permissions. For details, see [Configure a New SFTP Connection](https://partners.moengage.com/hc/en-us/articles/26763225201172-SFTP#h_01JFHD1Q8VFS8SCBZZWCERE7Z2).
  </Tab>
</Tabs>

# Set Up the Import

Set up your import in three steps: configure the connection and file format, map your columns to MoEngage attributes, and select the import frequency.

<Info>
  Contact your MoEngage Customer Success team to enable the **Data** menu on the left navigation if it is not visible.
</Info>

On the MoEngage sidebar, go to **Data** > **Data imports**, click **+ Import**, and select **Users** or **Events**. Then select your source tile and click **Continue**.

## Step 1: Configure the Connection and File Format

Select whether to import **Registered users** or **Anonymous users** (for User imports), or select the event to import (for Event imports). Registered and anonymous imports expect different file names; see [Naming Conventions](#naming-conventions).

For events, your file names must begin with the event name of the chosen event. For example, the event "App/Site Opened" has the event name `MOE_APP_OPENED`, so file names begin with `MOE_APP_OPENED_`. To create a new event, click **+ Create event** and enter a unique name; new events appear in your app only after the first successful import.

Next, configure the connection and folder:

<Tabs>
  <Tab title="Amazon S3">
    1. In the **S3 connection** list, select your connection (or click **+ Add connection**).
    2. In the **File type** list, select **CSV** or **JSON**.
    3. In the **Folder path** box, enter your directory path. Do not include the bucket name or trailing slashes, because MoEngage resolves the bucket name from your marketplace connection.
    4. To import PGP-encrypted files, select **Is your file encrypted?** and provide your private **Decryption Key**, optional public **Signing Key**, and **Key passphrase**.

    <img src="https://mintcdn.com/moengage/Bujj_VI542sXgyk1/images/s3-imports-select-connection.png?fit=max&auto=format&n=Bujj_VI542sXgyk1&q=85&s=ed32ec949151d933380bd2080d5beaf5" alt="S3 connection, file type, folder path, and encryption options" width="410" height="380" data-path="images/s3-imports-select-connection.png" />
  </Tab>

  <Tab title="SFTP">
    1. In the **SFTP connection** list, select your connection (or click **+ Add connection**).
    2. In the **Folder URL** box, enter the full path beginning with `sftp://[host-name]/`, without a trailing slash (for example, `sftp://files.hostname.com/my_folder`). MoEngage does not support root folders or subfolders, so keep all files in a single folder.
    3. To import PGP-encrypted files, select **Is your file encrypted?** and provide your private **Decryption Key**, optional public **Signing Key**, and **Key passphrase**.

    <img src="https://mintcdn.com/moengage/jnaevUpPOwD04mEl/images/moengage_84ac18.png?fit=max&auto=format&n=jnaevUpPOwD04mEl&q=85&s=400cc82bcceb96527938a055374b5a44" alt="SFTP connection, folder URL, and encryption fields" width="864" height="1068" data-path="images/moengage_84ac18.png" />
  </Tab>
</Tabs>

Enter a unique **Import name** to identify this import on the dashboard.

<Accordion title="Set up PGP encryption">
  PGP (Pretty Good Privacy) lets you encrypt sensitive files before importing them. MoEngage supports PGP encryption for S3 and SFTP file imports.

  **Prerequisites:**

  * **PGP key pair**: A public key (to encrypt the file) and a private key (to decrypt it). Never share the private key.
  * **Signing key pair**: A public key (to sign the file, required for MoEngage SFTP integration) and a private key (used internally to verify the signature).

  The following steps use [GnuPG](https://www.gnupg.org/index.html), a free implementation of the PGP standard.

  **Step 1. Generate a key pair.** Generate a PGP key pair using a tool such as GnuPG (`gpg --full-generate-key`), selecting RSA and a 1024-bit key size.

  <Info>
    * MoEngage supports file encryption using RSA keys of up to 1024 bits in length. Larger RSA keys, such as 4096-bit, are not supported and fail during decryption. Generate your key pair with a smaller RSA key size.
    * Turn off compression during encryption.
  </Info>

  **Step 2. Encrypt the file.** Encrypt the file with your public key, then upload it to your S3 or SFTP folder. The `--sign` option signs the file while encrypting it.

  ```bash theme={null}
  gpg --encrypt --sign --armor --compress-algo none -r demo@example.com
  ```

  **Step 3. Add the keys in the MoEngage UI.** Enter your private key in the **Decryption Key** field and your passphrase in the **Key Passphrase** field during import setup.

  **Step 4. Decrypt a file.** Decryption requires your private key and its passphrase. In your PGP software, select the encrypted file and enter your passphrase to produce the unencrypted file. Python users can use the [python-gnupg](https://pypi.org/project/python-gnupg/) package:

  ```python theme={null}
  import gnupg, os
  gpg = gnupg.GPG(gnupghome=os.path.expanduser('~'))
  gpg.encoding = 'utf-8'
  import_result = gpg.import_keys(key_data)
  gpg.trust_keys(import_result.fingerprints, "TRUST_ULTIMATE")
  with open(encrypted_file_path, 'rb') as file:
      status = gpg.decrypt_file(file, passphrase="", output="/path/to/decrypted/file")
  print(status.ok)
  ```

  **Step 5. Verify the file's signature (optional).** If you signed the file, add the public signing key on the MoEngage dashboard. MoEngage verifies the signature on the file in your S3 or SFTP folder. When verifying programmatically, a matched signature populates `status.signature_id`:

  ```python theme={null}
  if status.signature_id:  # populated when the signature is verified, otherwise None
      print("signature verified")
  else:
      print("not verified")
  ```
</Accordion>

### File Configurations

Select the DateTime format present in your file name (your file name must end with `_<date time format>.csv`). Ensure at least one matching file exists in the folder, then click **Fetch file(s)**. If the connection and format are correct, MoEngage shows a preview of the top 5 rows.

If MoEngage cannot fetch the file, you may see:

<Tabs>
  <Tab title="Amazon S3">
    * **Given S3 Access Key is not valid**: Verify your S3 marketplace connection details.
    * **Please check the folder path and try again**: Verify the folder path and that compatible files exist in it.
    * **Found zero data rows in the file**: The file has no rows after the header. MoEngage expects at least 2 rows (1 header + 1 data row).
  </Tab>

  <Tab title="SFTP">
    * **Given credentials are not correct**: Enter the correct SFTP credentials and fetch again.
    * **Please check the folder path and try again**: Verify the folder path and that compatible files exist in it.
    * **Found zero data rows in the file**: The file has no rows after the header. MoEngage expects at least 2 rows (1 header + 1 data row).
  </Tab>
</Tabs>

Click **Next** to continue to mapping.

## Step 2: Map Your Columns to MoEngage Attributes

Map each file column to a MoEngage attribute. For every column you see the column name with a sample value, the **Map attribute** selector (pick the data type, and for DateTime columns the format), and a **Skip** action. To create a new attribute, click **+ Create attribute**. You can also click **+ Add Field** to enter a mapping manually.

Mandatory mappings depend on the import type:

* **User imports (Registered)**: map your identifier column to **User ID**.
* **User imports (Anonymous)**: map your identifier column to **Anonymous ID**.
* **Event imports**: map your identifier column to **User ID**, and map your timestamp column to **Event Time**.

<Tabs>
  <Tab title="Amazon S3">
    For events, map either **Event Time (UTC)** or **Event Time (App Timezone)**. If you choose Event Time (UTC), the event time is converted to the timezone configured in your MoEngage dashboard settings.
  </Tab>

  <Tab title="SFTP">
    For events, map either **Event Time (UTC)** or **Event Time (App Timezone)**. If you choose Event Time (UTC), the event time is converted to the timezone configured in your MoEngage dashboard settings.
  </Tab>
</Tabs>

Once a mandatory mapping is marked, you can no longer skip that column.

### Mapping Files

Optionally, auto-map your columns by uploading a mapping file. Click **Upload mapping file** at the top-right of the mapping table and select your file. Mappings are auto-configured; a modal lets you create any attributes referenced in the mapping file that don't yet exist. Columns in the mapping file but not in your file are ignored; columns in your file but missing from the mapping file are left blank for manual mapping.

For a fresh import, MoEngage provides a sample mapping file you can use as a reference. If you duplicate an existing import, its mapping file is pre-attached and available to download. If a mapping file maps a column to an attribute that doesn't exist in MoEngage, the mapping is left blank, create the attribute from the UI first, then map the column to it.

A mapping file contains the mappings between each source column and a MoEngage attribute, along with the data type of the column. The file must be in JSON format. Instead of mapping columns one by one on the dashboard, you can upload a mapping file to automate the mapping.

<Tabs>
  <Tab title="CSV Files">
    ```json theme={null}
    {
      "mapping": [
        { "column": "ID", "moe_attr": "uid", "type": "string", "is_skipped": false },
        { "column": "First Name", "moe_attr": "u_fn", "type": "string", "is_skipped": false },
        { "column": "First Seen", "moe_attr": "cr_t", "type": "datetime", "datetime_format": "YYYY-MM-DD hh:mm:ss", "is_skipped": false },
        { "column": "LTV", "moe_attr": "t_rev", "type": "double", "is_skipped": false },
        { "column": "Install Status", "moe_attr": "installed", "type": "bool", "is_skipped": false }
      ]
    }
    ```
  </Tab>

  <Tab title="JSON Files">
    ```json theme={null}
    {
      "mapping": [
        { "column": "customer_id", "moe_attr": "uid", "type": "string", "is_skipped": false },
        { "column": "user.first_name", "moe_attr": "u_fn", "type": "string", "is_skipped": false },
        { "column": "user.first_seen", "moe_attr": "cr_t", "type": "datetime", "datetime_format": "YYYY-MM-DD hh:mm:ss", "is_skipped": false },
        { "column": "attribution.lifetime_value", "moe_attr": "t_rev", "type": "double", "is_skipped": false },
        { "column": "attribution.device_installed", "moe_attr": "installed", "type": "bool", "is_skipped": false }
      ]
    }
    ```
  </Tab>
</Tabs>

For each column, provide the following fields:

1. **`column`** *(required)*: The column name from the source file. For Level 2 keys in a JSON file, use dot notation (`key1.key2`).
2. **`moe_attr`** *(required)*: The MoEngage attribute to map the column to. Ensure each column maps to a unique `moe_attr`.
3. **`type`** *(optional)*: The data type of the column. See the supported types below.
4. **`datetime_format`** *(optional)*: The date-time format. Mandatory for DateTime fields only.
5. **`is_skipped`** *(optional)*: A boolean field. Any column marked `true` is skipped during import.

### Standard User Attributes for Reference

Map your source columns to MoEngage standard user attributes using the keys below. For the exhaustive list, refer to your [Data Management](/docs/user-guide/settings/data-management/overview-data-management) dashboard.

| Key                | Attribute Name on Dashboard | Datatype             | Description                                                                                                            |
| :----------------- | :-------------------------- | :------------------- | :--------------------------------------------------------------------------------------------------------------------- |
| `uid`              | ID                          | String               | Unique ID that the app has set for a user.                                                                             |
| `u_n`              | Name                        | String               | Full name of the user.                                                                                                 |
| `u_fn`             | First Name                  | String               | First name of the user.                                                                                                |
| `u_ln`             | Last Name                   | String               | Last name of the user.                                                                                                 |
| `u_em`             | Email (Standard)            | String               | The email address of the user. For example, `john@example.com`.                                                        |
| `u_gd`             | Gender                      | String               | Gender of the user.                                                                                                    |
| `u_bd`             | Birthday                    | DateTime             | Birth date of the user. Use this standard attribute instead of age; data sent as age is tracked as a custom attribute. |
| `u_mb`             | Mobile Number (Standard)    | String               | Mobile number of the user. For example, `918888444411`.                                                                |
| `moe_geo_location` | Location                    | Array of `[lat,lng]` | The location of the user, in the format `{"lat": 12.11, "lon": 123.122}`.                                              |
| `source`           | Publisher Name              | String               | The publisher name of the install. For example, `Google Ads`.                                                          |
| `revenue`          | LTV                         | Numeric              | Lifetime value of the user.                                                                                            |
| `moe_unsubscribe`  | Unsubscribe                 | Boolean              | Email unsubscribe attribute. Emails are not sent to the user when set to `true`.                                       |
| `moe_hard_bounce`  | Hard Bounce                 | Boolean              | Email hard bounce attribute. Emails are not sent to the user when set to `true`.                                       |
| `moe_spam`         | Spam                        | Boolean              | Email spam attribute. Emails are not sent to the user when set to `true`.                                              |

<Warning>
  Track standard string attributes with the correct data type. For example, if **First Name** (`u_fn`) is ingested as a number or an array instead of a string, the sample users on the [Create segment](/docs/user-guide/segment/create-segments/rule-based-filter-segments) page fail to load with a 500 error ("There seems to be an error"). To fix this, pin the attribute's data type to String on the [Data Management](/docs/user-guide/settings/data-management/overview-data-management) dashboard and re-send the corrected data for the affected users.
</Warning>

### Supported Attribute Types

| **Type**  | **Description**                                                | **Value in Mapping File** |
| --------- | -------------------------------------------------------------- | ------------------------- |
| String    | Any string value. For example, `ABC`, `ABC XYZ`, `ABC123`.     | `"type": "string"`        |
| Double    | Any decimal value. For example, `3.14159`, `241.23`, `-123.1`. | `"type": "double"`        |
| Boolean   | For example, `true`, `false`.                                  | `"type": "bool"`          |
| Date Time | Any date-time value. For example, `2019/02/22 17:54:14.933`.   | `"type": "datetime"`      |

<Info>
  MoEngage does not support the `|` (pipe) character in non-array type columns. Ensure your String, Numeric, and Boolean columns do not contain this character.
</Info>

### Reserved Keywords for User Attributes

MoEngage reserves the following keys. Do not use them when you map or track user attributes.

* `USER_ATTRIBUTE_UNIQUE_ID`
* `USER_ATTRIBUTE_USER_EMAIL`
* `USER_ATTRIBUTE_USER_MOBILE`
* `USER_ATTRIBUTE_USER_NAME`
* `USER_ATTRIBUTE_USER_GENDER`
* `USER_ATTRIBUTE_USER_FIRST_NAME`
* `USER_ATTRIBUTE_USER_LAST_NAME`
* `USER_ATTRIBUTE_USER_BDAY`
* `USER_ATTRIBUTE_NOTIFICATION_PREF`
* `USER_ATTRIBUTE_OLD_ID`
* `MOE_TIME_FORMAT`
* `MOE_TIME_TIMEZONE`
* `USER_ATTRIBUTE_DND_START_TIME`
* `USER_ATTRIBUTE_DND_END_TIME`
* `MOE_GAID`
* `INSTALL`
* `UPDATE`
* `MOE_ISLAT`
* `status`
* `user_id`
* `source`

### Portfolio Support (Project-Level Routing)

You can route imported users and events to specific projects in your MoEngage portfolio workspace using column mapping. Map your identifier column (such as `brand_name` or `app_id`) to the MoEngage attribute `moe_project_name`. Values must match your MoEngage project names exactly (matching is case-sensitive).

* **Successful routing**: If the value matches a project in your portfolio, MoEngage ingests the user or event at that project level.
* **Fallback**: If the mapping is missing, blank, or does not match a project name, MoEngage ingests the data at your global portfolio level.

### Send Import Notifications

Turn on notifications and select up to **10 email recipients** to be alerted when an import is created, succeeds, or fails. When your mappings are complete, click **Next**.

## Step 3: Select the Import Frequency

Define when MoEngage retrieves your files:

* **One-Time Imports**: Run immediately or schedule for a future date and time.
* **Periodic Imports**: Run hourly, daily, weekly, or monthly, with intervals and advanced configurations.

For each run, MoEngage fetches files matching the configured DateTime format, so ensure your file names are correct. Optionally, set the import to end after a number of occurrences or on a specific date. Click **Done**.

<Info>
  Channel reachability and custom segments for imported users are available within 2 hours of import completion. Plan your campaigns accordingly.
</Info>

# Duplicate Imports

You can configure only one unique import at a time. An import is a duplicate when **all** of these match an existing active import:

<Tabs>
  <Tab title="Amazon S3">
    1. **Import type**: Users or Events.
    2. **Import sub-type**: Event name, or Registered / Anonymous.
    3. **S3 folder path**.
    4. **Bucket name**.
  </Tab>

  <Tab title="SFTP">
    1. **Import type**: Users or Events.
    2. **Import sub-type**: Event name, or Registered / Anonymous.
    3. **SFTP folder path**, the complete folder path, including hostname.
  </Tab>
</Tabs>

If any one parameter differs, the import is unique.

# Import Failure Policy

MoEngage retries a failed file automatically, up to 30 attempts, before marking it permanently FAILED. You can configure an email alert on failure during setup. A file-level failure does not stop the schedule, future scheduled runs continue independently.

# Supported Datetime Formats

Use these in the `datetime_format` field of your mapping file, or when configuring DateTime columns during mapping.

| **Datetime Format**                             | **Examples**                                                                                                                 |
| ----------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `"datetime_format": "YYYY-MM-DD"`               | 2022-01-22                                                                                                                   |
| `"datetime_format": "YYYY/MM/DD"`               | 2022/01/22                                                                                                                   |
| `"datetime_format": "DD/MM/YYYY"`               | 22/01/2022                                                                                                                   |
| `"datetime_format": "DD-MM-YYYY"`               | 22-01-2022                                                                                                                   |
| `"datetime_format": "DD-MM-YYYY hh:mm:ss"`      | 31-12-2022 12:10:33                                                                                                          |
| `"datetime_format": "DD/MM/YYYY hh:mm:ss"`      | 31/12/2022 12:10:33                                                                                                          |
| `"datetime_format": "YYYY-MM-DD hh:mm:ss"`      | 2019-02-22 17:54:14                                                                                                          |
| `"datetime_format": "YYYY/MM/DD hh:mm:ss"`      | 2019/02/22 17:54:14                                                                                                          |
| `"datetime_format": "DD-MM-YYYYThh:mm:ss.s"`    | 31-12-2022T12:10:33.882                                                                                                      |
| `"datetime_format": "DD/MM/YYYYThh:mm:ss.s"`    | 31/12/2022T12:10:33.882                                                                                                      |
| `"datetime_format": "DD-MM-YYYYThh:mm:ssTZD"`   | <ul><li>31-12-2022T12:10:33Z</li><li>31-12-2022T12:10:33+08:00</li><li>31-12-2022T12:10:33-08:00</li></ul>                   |
| `"datetime_format": "DD/MM/YYYYThh:mm:ssTZD"`   | <ul><li>31/12/2022T12:10:33Z</li><li>31/12/2022T12:10:33+08:00</li><li>31/12/2022T12:10:33-08:00</li></ul>                   |
| `"datetime_format": "YYYY-MM-DD hh:mm:ss.s"`    | 2019-02-22 17:54:14.933                                                                                                      |
| `"datetime_format": "YYYY/MM/DD hh:mm:ss.s"`    | 2019/02/22 17:54:14.933                                                                                                      |
| `"datetime_format": "YYYY-MM-DDThh:mm:ssTZD"`   | <ul><li>2019-11-14T00:01:02Z</li><li>2019-11-14T00:01:02+08:00</li><li>2019-11-14T00:01:02-08:00</li></ul>                   |
| `"datetime_format": "YYYY/MM/DDThh:mm:ssTZD"`   | <ul><li>2019/11/14T00:01:02Z</li><li>2019/11/14T00:01:02+08:00</li><li>2019/11/14T00:01:02-08:00</li></ul>                   |
| `"datetime_format": "YYYY-MM-DDThh:mm:ss.sTZD"` | <ul><li>2019-02-22T17:54:14.957Z</li><li>2019-02-22T17:54:14.957299-08:00</li><li>2019-02-22T17:54:14.957299+08:00</li></ul> |
| `"datetime_format": "YYYY/MM/DDThh:mm:ss.sTZD"` | <ul><li>2019/02/22T17:54:14.957Z</li><li>2019/02/22T17:54:14.957299-08:00</li><li>2019/02/22T17:54:14.957299+08:00</li></ul> |

# Manage Your Imports

To monitor your imports, understand import statuses, or trigger a run manually or via API, see [How Imports Work](/docs/user-guide/data/imports/overview-imports#how-imports-work) on the Imports Overview.

# Frequently Asked Questions

<Accordion title="My imports have failed. How do I check what went wrong?">
  Click the ellipsis on the right and click **View** to look up the Import details. Hover over the **Failed** Status to learn the reason.
</Accordion>

<Accordion title="What if a scheduled import adds the data into a recently archived segment?">
  In such cases, the new data will still be added to the archived segment. You can unarchive the segment as required.
</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.
</Accordion>

<Accordion title="How can I stop future runs of a scheduled import?">
  Yes, you can stop future scheduled imports from running automatically. To do this, find the import schedule and select the **Archive** option from the Actions menu on the Data Imports dashboard. This will prevent it 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, it's best to wait. The system has checks in place to handle these situations automatically and retry if necessary. Manually starting the same import again while it's still processing can cause conflicts and may prevent the original import from completing successfully.
</Accordion>

<Accordion title="What happens when there is an error in fetching the files from the folder?">
  MoEngage retries a failed file automatically, up to 30 attempts, before marking it permanently FAILED. You can also configure an email alert on 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 source 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 [Limits](/docs/user-guide/data/imports/setting-up-a-file-import#limits)).
</Accordion>

<Accordion title="How does MoEngage pick up new files in a periodic run?">
  During each scheduled run, MoEngage searches your configured folder path and selects new files based on your file-name prefix and datetime-format configuration. It uniquely identifies files by the combination of folder location and file name, so it processes each file only once.
</Accordion>

<Accordion title="Will a periodic import pick up an earlier processed file?">
  No. A file that has already been processed is not processed again while its file name and folder location stay the same. If you place the same file in a different folder, an import configured for that new folder will process it again.
</Accordion>

<Accordion title="Can a CSV file contain both User and Event data?">
  No. Set up user imports and event imports as separate tasks. Each source file must contain only user attributes or only event records.
</Accordion>

<Accordion title="What is NDJSON, and why is it required?">
  NDJSON (Newline-Delimited JSON) means each line in your `.json` file is a complete JSON object separated by a newline. This format lets MoEngage process large JSON datasets line by line for scalable, robust imports.
</Accordion>

<Accordion title="Are compressed files (for example, .gz, .zip) supported?">
  No. MoEngage does not support importing compressed files.
</Accordion>

<Accordion title="If I change the file type of an existing import, what happens to my mappings?">
  Changing the file type removes the existing preview and re-fetches the available files for the new file type. You must select the file to preview again and reconfigure your mappings based on the new file's structure.
</Accordion>
