Bulk Import

Use the Bulk Import API to send, to MoEngage, in batch multiple user 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>

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.

info

Note

The APP_ID for your MoEngage account is available on the MoEngage Dashboard. We've revamped our settings UI; you can find the APP_ID in the following navigations in the revamped and old UIs:

    • Revamped UI: Settings -> Account -> APIs -> App ID
    • Old UI: 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.

Allowed Value: transition

Example: "type": "transition"

Note: This field is case-sensitive. Follow the case as in the example when passing the value in the request.

elements List Yes

List of data points (events and customers) to track.

Note: The type field in this List denotes whether the information is for a customer or an event. This field is case-sensitive. Follow the case as in the example when passing the value in the request.

  • Allowed Values: customer, event
  • Examples: "type": "customer", "type": "event"
info

Note

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":"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?
2 out of 2 found this helpful

How can we improve this article?