Overview
User API helps add or update users and user properties in MoEngage. You can do the following:
- Create a new user
- Create new user property
- Update existing user properties of users
EndPoints
Data Center Name | User Data Endpoint |
---|---|
Data Center 1 (DC-01) | https://api-01.moengage.com/v1/customer/ |
Data Center 2 (DC-02) | https://api-02.moengage.com/v1/customer/ |
Data Center 3 (DC-03) | https://api-03.moengage.com/v1/customer/ |
For more information about MoEngage data centers, refer to Data Centers in MoEngage.
Syntax
POST https://api-01.moengage.com/v1/customer/<APP ID>
POST https://api-02.moengage.com/v1/customer/<APP ID>
POST https://api-03.moengage.com/v1/customer/<APP ID>
APP_IDThe APP_ID for your MoEngage account is available on the MoEngage Dashboard in Settings > App Settings > Account Settings > APP ID. |
Request Body
A sample request body is described for the user with unique id john@example.com, where the following is set:
- Name
- John
- Active Platform
- Android
{
"type" : "customer",
"customer_id": "john@example.com",
"attributes": {
"name":"John",
"platforms" : [{"platform":"ANDROID", "active":"true"}]
}
}
Request Body Fields
Key | Datatype | Mandatory Field | Description |
---|---|---|---|
type | String | Yes | This is used to identify the type of request. |
customer_id | String | Yes | The unique identifier used to identify / create a user in MoEngage. Please refer this section for more information on customer_id. |
attributes | JSON Object | No | A dictionary containing user attributes to add / update in the user profile. |
platforms | List | No | List of dictionaries with the associated platforms out of ANDROID, iOS, and web and their status. |
Standard User Attributes
The following standard user attributes are tracked for User API in MoEngage.
Key | Attribute Name on Dashboard | Datatype | Description |
---|---|---|---|
name | Name | String | Full name of the user. |
first_name | First Name | String | First name of the user. |
last_name | Last Name | String | Last name of the user. |
String | Email Address of the user. For example, john@example.com | ||
age | Age | Numeric | Age of the user |
gender | Gender | String | Gender of the user |
mobile | Mobile Number | String | Mobile Number of the user. For example, 918888444411 |
moe_geo_location | Location | Array of [lat,lng] in double in the format {'lat': 12.11, 'lon': 123.122} | A sample value would be the location of the user. For example: {'lat': 12.11, 'lon': 123.122} |
source | Publisher Name | String | This is the Publisher Name of Install. For example, Google Ads |
created_time | First Seen | Date | The time when the user was created. Information in ISO 8601 format. For example: 2019-05-21T03:47:35Z |
last_seen | Last Seen | Date | Last Seen Time of the user. Information in ISO 8601 format. For example 2020-05-01T03:52:35Z |
transactions | Number of Conversions | Numeric | A total number of conversions made by the user in a lifetime. |
revenue | LTV | Numeric | Life Time Value of the user. |
moe_unsubscribe | Unsubscribe | Boolean | Email Unsubscribe Attribute. Emails are not sent to the user when the set value is true. |
platforms | Not visible on the dashboard. | List | Value is based on the active platforms of the user. For example: [{"platform":"ANDROID", "active":"true"},{"platform":"IOS", "active":"true"}] |
For other attributes that are not part of the list, use the key-value pairs that you intend to use.
For example, to track custom attributes of different data types like string, numeric, boolean, and date, pass the following payload where points are a number, expiry_date is a date type attribute and super_user is a boolean attribute.
{
"type" : "customer",
"customer_id": "john@example.com",
"attributes": {
"points":20,
"expiry_date":"2020-05-31T03:47:35Z",
"super_user":true,
"user_persona":"browsers",
"platforms" : [{"platform":"ANDROID", "active":"true"}]
}
}
Reserved keywords for the user attribute nameThe APP_ID for your moengage account is available here: (Settings > App Settings > Account Settings > APP ID). |
Different filters are available during the creation of campaigns and segments after an attribute is tracked in the required data type.
Reserved keywords for the user attribute name"id", "_id", and "" keywords are blocked and do not use as user attribute names. |
Examples
When an attribute is tracked in numeric data type, the following filters are displayed:
When an attribute is tracked as a string, the following filters are displayed:
When an attribute is tracked as a date attribute, the following filters are displayed:
For example, when an attribute is tracked as a boolean attribute, the following filters are displayed: