Bulk Import

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

URL
POST https://api-0X.moengage.com/v1/transition/<APP_ID>

Each customer is hosted on a different data center, you can find your data center number (value of X), by checking the data center and API endpoint mapping page here.

 

APP_ID

The 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 API

All 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:

JSON
{
	"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
				}
			]
		}
	]
}
 
Was this article helpful?
0 out of 0 found this helpful