Use the Bulk Import API to send, to MoEngage, in batch multiple user, device, and event requests using a single API request. You can send a batch request of a maximum of 100 kB in a single API call.
API Endpoint
POST https://api-0X.moengage.com/v1/transition/<APP_ID>
The 'X' in the API Endpoint URL refers to the MoEngage Data Center (DC). MoEngage hosts each customer in a different DC. You can find your DC number (value of X) and replace the value of 'X' in the URL by referring to the DC and API endpoint mapping here.
APP_IDThe APP_ID for your MoEngage account is available on the MoEngage Dashboard in Settings > App Settings > Account Settings > APP ID. |
Request Body
Request Body Fields
Key | Datatype | Required | Description |
---|---|---|---|
type | String | Yes | This is used to identify the type of request. |
element | List | Yes | List of data points (events, customers and devices) to track. |
API Validation for Bulk APIAll bulk API requests return a 200 response code. Debugging should be done on the user profile on the dashboard. |
Example Payload
A sample API request is as follows:
{
"type": "transition",
"elements": [{
"type": "customer",
"customer_id": "john@example.com",
"attributes": {
"name": "John",
"platforms": [{
"platform": "ANDROID",
"active": "true"
}]
}
},
{
"type": "device",
"customer_id": "john@example.com",
"device_id": "96bd03b6-defc-4203-83d3-dc1c73080232",
"attributes": {
"brand": "Apple",
"platform": "iOS",
"push_id": "irBMohQPf_k2QrwP8iRzK3A/0CdLEzAoVGdF65HhH_I"
}
},
{
"type": "event",
"customer_id": "john@example.com",
"device_id": "96bd03b6-defc-4203-83d3-dc1c73080232",
"actions": [{
"action": "Added to Cart",
"attributes": {
"product": "Mobile",
"color": "white",
"Brand": "Apple"
},
"platform": "iOS",
"app_version": "1.2.3",
"current_time": "2020-05-31T16:33:35Z",
"user_timezone_offset": 19800
},
{
"action": "Purchase",
"attributes": {
"product": "MacBook Air",
"Brand": "Apple"
},
"platform": "iOS",
"app_version": "1.2.3",
"current_time": 1590404615,
"user_timezone_offset": 19800
}
]
}
]
}