# Import Via API

### Overview

MangoApps allows administrators to bulk import users via API by configuring the endpoint and mapping API fields to user fields in MangoApps. Follow the steps below to successfully import users.

<figure><img src="/files/d76iGZB6NbfURah3MiPB" alt="" width="563"><figcaption></figcaption></figure>

***

### Configure Synchronization Settings

Navigate to **Synchronize Settings** and select when to synchronize users from the API.

Choose one of the following options:

* **One Time Import (All Users)**: Imports and syncs users only once.
* **On User Login**:
  * **On First Login**: Syncs users when they log in for the first time.
  * **On Every Login**: Syncs users every time they log in.

{% hint style="info" %}
Users imported via **Admin Portal > Users > Add Users > Import via API** are automatically assigned the "Network User" role, regardless of their email domain.
{% endhint %}

***

### Configure Advanced Sync Settings

This section will only appear if **One Time Import (All users)** is selected in the above **Synchronization Settings**.

In **When Fetched Users Already Exist in MangoApps**, choose an option:

* **Skip Existing Users**: Avoids overwriting existing user data.
* **Update Existing Users**: Overwrites existing user data.

In **Email Invites for Newly Added Users**, check the box to send login credentials via email to new users.

***

### Configure API Endpoint and Parameters

A request will be sent to the listed URL to sync all users.

In **Import API URL**, select the preferred method from the dropdown menu (e.g., "GET") and enter the API URL.

<figure><img src="/files/FNTN1Fx1H9v7lK9G344c" alt="" width="563"><figcaption></figcaption></figure>

**Request Parameters -&#x20;**<mark style="color:red;">**On User Login Synchronize Option Only**</mark>

* Enter the API field name in **API Field**.
* Enter the corresponding MangoApps field name in **MangoApps Field**.
* Click **+ Add** to add more parameters or **Remove** to delete parameters.

**Response Parameters -&#x20;**<mark style="color:red;">**Required for Either Synchronize Option**</mark>

* Enter the API field name in **API Field**.
* Enter the corresponding MangoApps field name in **MangoApps Field**.
* Check **User Identifier** for the field that uniquely identifies users. Only **one field** can be marked as the user identifier.
* Click **+ Add** to add more parameters or **Remove** to delete parameters.

{% hint style="danger" %}
The API field names in request and response parameters **must** match the third-party API field names.
{% endhint %}

***

### Configure Authentication Options

When connecting to the HCM/HRIS system to retrieve user profile data, select the method that best suits your system's security and integration requirements.

<figure><img src="/files/ukRAZI3agAvH7mwG6uvf" alt="" width="563"><figcaption></figcaption></figure>

Enter the necessary authentication details:

* **OAuth Token URL**
* **Authorization URL**
* **Username**
* **Password**

Click **Save Settings & Test Connection** to verify the configuration.

***

### Preview & Synchronize

Click **Preview & Synchronize** to review the user data before importing. If everything is correct, click **Synchronize** to complete the process. Once the import is successful, a confirmation message appears, and the system sends an email notification to the network admin.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://guides.mangoapps.com/admin-guide/user-provisioning-and-management/add-users/import-via-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
