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:
{
"type": "customer",
"customer_id": "USERID1234",
"attributes": {
   "first_name":"John",
   "name":"John Smith",
   "plan_expiry_date":"2020-05-31T00:00:00Z",
   "super_user":true,
   "user_persona":"browsers",
   "platforms" : [{"platform":"ANDROID", "active":"true"}]
   }
}
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:
Datetime FormatExample
“datetime_format”:YYYY-MM-DD[T]HH:mm:ss[Z]2019-03-12T17:36:05Z
“datetime_format”: "YYYY-MM-DD"2022-01-22
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:
{
  "status": "success",
  "message": "Your request has been accepted and will be processed soon.",
  "request_id": "kXwpDESb"
}
On a failed data API request, you will receive the following response:
{
  "status": "fail",
  "error": {
    "type": "TypeError",
    "message": "expected string",
    "request_id": "kXwpDESb"
  }
}

Response Codes

The following status codes and associated error messages are returned when the request results in an error.
Error CodeTypeMessageDescription
400Missing header valueThe Content-Type Header is requiredThe header value for content type is missing
400Empty request bodyA valid JSON document is requiredThe request body is empty
400Malformed JSONCould not decode the request body. The JSON was incorrect or not encoded as UTF-8.The request JSON is not formed correctly
400BlacklistedYour account is blacklisted, Please contact MoEngage.Your App is blacklisted in MoEngage
400InvalidParamsGiven app_id is invalid.The App ID is invalid.
400ParamsRequiredapp_id is required in path/query params.App ID is missing in the path or query params.
400Empty request bodyA valid JSON document is requiredThe request body is empty.
400Body type is not JSONA valid JSON document is required.String Payload.
400MissingAttributeErrorkey is expected to be datatypeThe specified attributes are invalid
401Authentication RequiredAuthentication Header RequiredAuthentication header is missing from the request.
401Authentication requiredNo identity information foundAuthentication header is empty.
401Authentication requiredInvalid identity information foundFailure to decode app_key and app_secret.
401Authentication requiredAPP_KEY missing in the authentication headerApp_key is not present in the authentication header.
401Authentication requiredAPP_SECRET missing in the authentication headerApp_secret is not present in the authentication header.
401Authentication requiredApp Secret key mismatch. Please login to the dashboard to verify keyApp secret key is wrong.
401Authentication requiredInvalid APP_ID used in Authentication HeaderYou have used an invalid APP ID in the authentication header.
403Account SuspendedAccount SuspendedYour account is suspended.
403Account Temporarily SuspendedAccount Temporarily SuspendedYour account is suspended temporarily.
409Authentication MismatchApp key mismatch in params and authenticationApp_key in parameters and authentication does not match.
409Authentication requiredApp Secret key is not set. Please login to the dashboard to set a keyApp Secret not set.
413Payload too largeThe payload can not exceed 128KBRequest payload size is too large.
415Unsupported Media TypeUnsupported Media TypeUnsupported media type.
429Rate Limit ExceededRate Limits for User / Event exceededYou have exceeded the rate limits (number of users or events per minute) defined for your MoEngage account.
5xxServer ErrorAny other exceptionThis response is returned when the system runs into an unexpected error. We recommend that you retry every 2 seconds for a maximum of 5 times in such cases.

User Attributes

Key nameDisplay nameFetch through Get User APIUpdate through Track User APICreate through Track User API
publisher_namePublisher Nameyesnoyes
campaign_nameCampaign Nameyesnoyes
t_revLTVyesnono
t_transNo of Conversionsyesnono
moe_ip_cityLast Known Cityyesnono
moe_ip_pinLast Known Pincodeyesnono
moe_ip_subdivisionLast Known Stateyesnono
moe_ip_countryLast Known Countryyesnono
moe_dtzoUser Timezone Offset (Mins)yesnono
u_s_cNo. of Sessionsyesnono
u_l_aLast Seenyesnoyes
cr_tFirst Seenyesnoyes
u_mbMobile Number (Standard)yesyesyes
uidIDyesyesyes
u_bdBirthdayyesyesyes
u_emEmail (Standard)yesyesyes
locale_language_displayLocal Languageyesnono
locale_country_displayLocal Countryyesnono
uninstall_timeUninstall timeyesnono
installedInstall Statusyesnono
moe_cr_fromUser Creation Sourceyesnono
u_nNameyesyesyes
u_lnLast Nameyesyesyes
u_gdGenderyesyesyes
u_fnFirst Nameyesyesyes
geoGeolocationyesnono
moe_wa_subscriptionWhatsApp Subscription Statusyesyesyes
moe_em_unsub_categoriesEmail Unsubscribed Categoriesyesyesyes
moe_gaidGoogle Advertising ID (Android)yesnoyes
advertising_identifierAdvertising Identifier (iOS &Windows)yesnoyes
web subscription urlWeb Push Subscription Page URL---
moe_sub_wWeb Push Subscription Statusyesyesyes
moe_w_dsBrowser Detailsyesnono
moe_mwebMobile Useryesnoyes
moe_i_ovOS Version iOS---
moe_itCreation Sourcenonono
moe_spamSpamyesyesyes
moe_unsubscribeUnsubscribeyesyesyes
moe_hard_bounceHard Bounceyesyesyes
moe_rsp_androidReachability Push Androidyesnono
moe_rsp_iosReachability Push iOSyesnono
moe_rsp_webReachability Push Webyesnono
moe_rsuReachability Pushyesnono
moe_sms_subscriptionSMS Subscription Statusyesyesyes
moe_ds_bts_push_hourBest time to send Pushyesnono
moe_ds_bts_email_hourBest time to Emailyesnono
moe_ds_bts_sms_hourBest time to send SMSyesnono
moe_ds_mpc_best_channelMost Preferred Channelyesnono

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.