Skip to main content
POST
/
customers
/
export
Get User
curl --request POST \
  --url https://api-0{dc}.moengage.com/v1/customers/export \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "identifiers": [
    {
      "identifier_type": "customer_id",
      "identifier": "6416d1a318r98264512c0f89"
    }
  ],
  "user_fields_to_export": [
    "last_name",
    "customer_id",
    "name"
  ]
}
'
{ "status": "success", "type": "export_users", "data": { "users_not_found": [ { "identifier_type": "customer_id", "identifier": "john_doe" } ], "users": [ { "user_attributes": { "last_name": "Doe", "customer_id": "john_doe", "name": "John", "custom_user_attr": 12345, "id": "62e79fb15ada55x123g987bu" } } ] } }

Rate Limit

The rate limit is 20 users per payload and 1000 users per minute. Postman Collections We have made it easy for you to test the APIs. Click here to view it in Postman.

FAQs

  • How do I know which users are available to export and which users are not available in MoEngage to export?
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.
  • What if I want to get all the user data available based on the user ids without specifying the fields?
If the user_fields_to_export is not passed, then all the custom attributes and exportable standard attributes will be passed. For specific fields, user_fields_to_export needs to be passed along with the required fields.

Authorizations

Authorization
string
header
required

This authentication parameter, used for access control, must be passed along with the request. The API request will be authenticated through Basic Authentication. Basic Authentication sends a Base64-encoded string containing your username and password with every API request. It encodes a 'username:password' string in Base64 and appends the encoded string with 'Basic '. This string is included in the authorization header as shown below:

{"Authorization: Basic Base64_ENCODED_WORKSPACEID_APIKEY=="}

The username and password details can be obtained from the MoEngage Dashboard. If you're using the API for the first time, follow these steps:

  1. Navigate to Settings -> Account -> APIs.
  2. Copy the following details:
    • Username: Under Workspace ID (earlier app id), click the copy icon to copy the username.
    • Password: In the API keys section, click the copy icon in the Data tile to copy the API key.

Use these details to authenticate the API requests.

Headers

X-Forwarded-For
string

The 'X-Forwarded-For' header is used to specify the IP address of the client that made the request. This header may be added by proxy servers or load balancers. The header value must contain the IP address of the original client that initiated the request. Multiple IP addresses may be specified in the header value, separated by commas.

Example:

"203.0.113.195"

Query Parameters

app_id
string
required

This is the Workspace ID of your MoEngage account that has to be passed along with the request. You can find your Workspace ID at Settings > Account > APIs > Workspace ID.

Example:

"VJ0GSMESHMQA3L7WV1EEK3UR"

Body

application/json
identifiers
object[]

This field is used to specify the identifiers for the users for whom the data needs to be fetched. Structure:

"identifiers": [
{
"identifier_type": "customer_id",
"identifier": "<customer_id>"
},
{
"identifier_type": "id",
"identifier": "<MoEngageID>"
},
...{}
]
user_fields_to_export
string[]

This field is used to specify the fields that need to be fetched for the user specified in Identifiers. Tracked standard user attributes and custom attributes can be fetched using this API. For the list of tracked standard attributes in MoEngage, refer to User Attributes.

Example:
["last_name", "customer_id", "name"]

Response

This response is returned when the request is processed successfully.

status
string

This field contains the status of the request and specifies whether the request was successful. Supported values are : "success", "failure"

Example:

"success"

type
string

This field denotes the fetch type. Supported values are: "export_users".

Example:

"export_users"

data
object

This field contains the list of users who were not found in MoEngage and returns the data specified for the list of users who were found in MoEngage.

This is the structure:

{
    "users_not_found": [
        {
            "identifier_type": "customer_id",
            "identifier": "<customer_id>"
        }
    ],
    "users": [
        {
            "user_attributes": {
                "<list of user attributes>"
            } 
        }
    ]
}