Skip to main content
The MoEngage Data API provides a comprehensive suite of endpoints designed to help you manage data within MoEngage. This API enables you to create and update user profiles, track user actions (events), manage device information, and handle large-scale data ingestion via bulk and file import operations.

Endpoints

The Data API is a collection of the following API endpoints:
For workspaces in MoEngage with the User Identity Resolution feature enabled, use the following Data APIs to create or update users using a specific identifier, such as a mobile number or email ID, as configured in Settings > Data > Identity Resolution:
  • Track User
  • Create Event
  • Bulk Import
For more information, refer to User Identity Resolution.You can:
  • Create users through Server-to-Server Data APIs even when they do not have an ID (but have other identifiers).
  • Create a user or track events of a user when identifiers other than ID (for example, email ID or phone number) are known.

Request Body

The request body contains the mandatory field called customer_id. It is the unique identifier set and passed on from the MoEngage SDK as USER_ATTRIBUTE_UNIQUE_ID and is visible on the dashboard as ID. customer_id is used to:
  • Identify or create a user in MoEngage.
  • Associate the events with the corresponding unique user profiles in MoEngage.
On receiving a Data API request in MoEngage, the customer_id is used to verify if the user exists in MoEngage. If the user does not exist, a new user is created with the attributes or events.
  • The maximum limit for the request body is 128 KB.
  • Any string of more than one characters is allowed for customer_id except the following values - [‘unknown’, ‘guest’, ‘null’, ‘0’, ‘1’, ‘true’, ‘false’, ‘user_attribute_unique_id’, ‘(empty)’, ‘na’, ‘n/a’, ”, ‘dummy_seller_code’, ‘user_id’, ‘id’, ‘customer_id’, ‘uid’, ‘userid’, ‘none’, ‘-2’, ‘-1’, ‘2’]
For example, a user created using the following request is visible in the dashboard user profile as displayed.

Sample Request Body

Below is a sample request body for the Create User API:
You can not use “moe_” as a prefix while naming events, event attributes, or user attributes. It is a system prefix and using it might result in periodic blacklisting without prior communication.

Supported Datetime Formats

You can pass the datetime in the following formats in the request body:
MoEngage performs the following validation on datetime formats before ingesting data into its system:
  • Future and past date values are accepted and ingested.
  • Any date values with incorrect calendar values (e.g., 2019-15-12 where 15 is not a valid month) are ingested as strings.
  • Any datetime values incompatible with the formats mentioned above are converted to strings and then ingested.

Response

Response to the Data API is a JSON object. On a successful data API request, you will receive the following response:
On a failed data API request, you will receive the following response:

Response Codes

The following status codes and associated error messages are returned when the request results in an error.

User Attributes

Dashboard User Profile

On sending data through the data API, it will be populated in the user profile as shown below: Newuserprofile

Limits

The Data API is designed to handle high volumes of data across our customer base. We enforce API limits to ensure responsible use of the API. Refer to the respective endpoint documentation for rate limits.
  • If your requirement exceeds the default limits, you can contact the MoEngage support team to increase the limits.
  • Make sure to adhere to the Fair Usage Policy (FUP) for high-frequency user data ingestion. This is mandatory to prevent disruption to data processing in your workspace. For more information, refer to the Fair Usage Policy (FUP).

FAQs

Track User

Please attempt exponential backoff of requests to ensure there is no data loss due to 5xx errors.
Getting a 200 status code as a response from MoEngage only indicates that the users in your API payload have been accepted for processing. It does not ensure that the users sent to MoEngage have been successfully ingested. 
Although, this happens very rarely and you can search for newly ingested users in:
Segment > Create Segment > Search for users using their IDs
Please use the Get User API to export the users.
Please use the Delete User API to delete existing users in MoEngage.

Get User

All available users will be found in the users key, and users not available will be found in the users_not_found key. Please refer to the sample response in this doc.
If the user_fields_to_export is not passed, then all custom attributes and exportable standard attributes will be returned. For specific fields, user_fields_to_export needs to be passed along with the list of required fields.

Merge User

No, the merged user will get deleted after calling this API. All the user attributes and devices of the merged user will be transferred to the retained user.
The reachability status of the user will be recalculated based on the devices present after merging the user.
Any registered user present in the MoEngage system can be merged with another registered user irrespective of the source of creation.
Not necessarily; we allow the merging of users with or without devices.
No.
No.
This user will get deleted, and if any devices are attached to this user, they will be associated with the retained_user. All events and user details of the merged_user will reflect on the retained_user. A merge event MOE_USER_MERGE_EVENT will be added to the merged_user (who will only have the MoEngage ID now).
The retained_user will now have all the user, device, and event details of the merged_user along with its own existing details. A MOE_USER_MERGED event will be added to the retained_user.
We will create a new user with that ID, but the MoEngage ID of this user will be different compared to the deleted user.
The user will not be reachable.
The maximum SLA is 30 minutes.
In the user profile, all events of the last 30 days are moved from the merged user to the retained user.

Delete User

There are no rollback mechanisms for undoing the delete action. Once the delete request is processed, the user is deleted from MoEngage.
No, the events corresponding to a user are not specifically deleted; only the user and the user attributes are deleted when the delete API request is processed.However, once the user is deleted from MoEngage, the events corresponding to the user will not be accessible. For example, if an event is used in a segmentation query, the deleted user who executed that event will not be added to the calculated segment or campaign.
Navigate to Segment -> Create Segment on the MoEngage dashboard. Type the unique identifier for the deleted user (ID, MoEngage ID, phone number, email, or any unique identifier you have configured). If the user has been deleted (hard delete), you will not see any search results. For more information about searching users, refer to [Search User in Segmentation].

Create Event

Events in the payload need to be mapped to a given user who has executed the event. You must use the Customer ID to identify the events mapped to a customer.
No, anonymous users can be tracked using MoEngage SDKs.
Events in MoEngage are immutable, meaning events can only be created; they cannot be updated or deleted.

Track Device

No, you can pass only the device attributes mentioned above. Any additional custom attributes passed in the API payload are dropped during processing.
The device will be created based on the Android platform, and the IDFV value passed in the API will be dropped. If the platform is iOS and a GAID value is passed, the device will be created with iOS, but the GAID attribute will be dropped.
You can create a maximum of 1000 devices for a user. The user will be blocked if a 1001st device is created for the user.
In such cases, the existing device will be deleted, and the new device will be added.

MoEngage Streams

The throughput and average volume of each API request depends on the volume of selected events captured into MoEngage. The default batch size (number of events for each API request) is 100.
The retrial mechanism allows MoEngage to hit your provided endpoints in multiple attempts. In case a batch of events fails (anything other than a “2XX” response from the endpoint is considered failed), the entire batch is retried. MoEngage makes a total of three retry attempts with the following intervals:
  • First Retry: 30 seconds
  • Second Retry: 60 seconds
  • Third Retry: 120 seconds
If you pause Streams, data is not collected for exports and hence cannot be replayed at a later date.
No. Streams is primarily built to export your events in near real-time. Since user attributes in MoEngage are updated asynchronously, it is currently not possible to guarantee the latest values of user attributes in the exports.
As of now, you cannot export data that occurred before configuring Streams. Once configured, you will start seeing data for each event from the moment you enable your exports.

Bulk Import

Yes, Track User API validations apply to the Customer payload type, and Create Event API validations apply to the Event payload type within the Bulk API request.
Please implement an exponential backoff strategy for your requests. This ensures that your system gradually reduces request frequency during high-load periods, preventing data loss due to server-side errors.
Receiving a 200 OK status code only indicates that the users in your API payload have been successfully accepted for processing. It does not guarantee that the ingestion process is complete.While failures are rare, you can verify ingestion by searching for the users in the MoEngage Dashboard: Navigate to Segment > Create Segment > Search for users using their unique IDs.

Trigger File Imports

No, the schedule still remains the same as originally set up in the MoEngage Dashboard.

Postman Collection

We have made it easy for you to test the APIs. Click here to view the collection in Postman.