curl --request POST \
--url https://api-{dc}.moengage.com/v1/event/{Workspace_ID} \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "event",
"customer_id": "123",
"actions": [
{
"action": "ProductAdded",
"attributes": {
"product": "Accessories",
"color": "Black",
"Brand": "Adidas"
},
"platform": "Android",
"app_version": "1.2.3",
"user_time": "1708939453",
"current_time": "1708939453"
}
]
}
'{
"status": "success",
"message": "Your request has been accepted and will be processed soon."
}Track Event
This API tracks the actions of a user.
curl --request POST \
--url https://api-{dc}.moengage.com/v1/event/{Workspace_ID} \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "event",
"customer_id": "123",
"actions": [
{
"action": "ProductAdded",
"attributes": {
"product": "Accessories",
"color": "Black",
"Brand": "Adidas"
},
"platform": "Android",
"app_version": "1.2.3",
"user_time": "1708939453",
"current_time": "1708939453"
}
]
}
'{
"status": "success",
"message": "Your request has been accepted and will be processed soon."
}- If you have Portfolio enabled for your workspace, you need to pass project_code in the API endpoint. This identifies which project a user or event belongs to. For more information, refer to Portfolio: Data Ingestion and Management.
- MoEngage does not accept any future dated events.
Rate Limit
A single API request contains one or more events. Maintain a rate limit of 30,000 events per minute.Authorizations
Send your Workspace ID and API key as a base64-encoded username:password string.
- Username: Your MoEngage Workspace ID (also known as the App ID), from Settings > Account > API keys.
- Password: An API key generated from Settings > Account > API keys. Click + Create new key, set Authentication type to Basic Auth, select the Data APIs group and its Create Events scope. The legacy Data key (auth type Basic Auth (Legacy)) also works.
Refer to API Key Dashboard for details on creating and managing API keys.
Headers
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.
"203.0.113.195"
Path Parameters
Body
Note: You cannot use “moe_” as a prefix while naming events, event attributes, or user attributes. It is a system prefix and using it might result in periodic blacklisting without prior communication.
Unique identifier you provide for the event, used to detect and drop duplicates. Any string works, and it doesn't need to be a UUID. If MoEngage receives the same customer_id, dedup_id, and payload again, it drops the duplicate instead of ingesting it again. If omitted, MoEngage falls back to the default behavior and ingests the event again.
Deduplication is an Early Access feature. To enable it for your account, contact your MoEngage Customer Success Manager (CSM) or the Support team.
"order_12345_purchase"
Required if Identity Resolution is enabled and customer_id is not provided.
User Identity Resolution:
If the User Identity Resolution feature is enabled in your workspace, identifiers set up in the workspace must be mentioned within the user_identifiers parameter.
{ "moe_mobile": "+9198765xxxxx" }