curl --location --request POST 'https://sdk-0X.moengage.com/v1/experiences/events' \
--header 'Accept: */*' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic <Authorisation>' \
--header 'MOE-APPKEY: <Your APP Key>' \
--data-raw '{
"elements": [
{
"customer_id": "<unique user identifier like email or phone number. Eg: john@example.com>",
"user_timezone_offset": 19800,
"actions": [
{
"action": "MOE_PERSONALIZATION_MESSAGE_SHOWN",
"moe_event_uuid": "aa886712-4537-47c1-b126-2686efda2e26",
"event_time": 1725258666,
"platform": "web",
"attributes": {
"cid": "66d55ae445921e4d35ae4368_F_T_WP_AB_2_P_0_AU_5A",
"experience": "Test Server side experience",
"moe_locale_id": "0",
"moe_variation_id": "2",
"audience_name": "All Users",
"audience_id": "5A",
"type": "Web Personalization"
}
}
]
}
]
}'Track Experience Events
This API tracks impressions (shown) and user interactions (clicked) for accurate experience reporting. To report an impression or click for your experience via API, use the following endpoint.
curl --location --request POST 'https://sdk-0X.moengage.com/v1/experiences/events' \
--header 'Accept: */*' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic <Authorisation>' \
--header 'MOE-APPKEY: <Your APP Key>' \
--data-raw '{
"elements": [
{
"customer_id": "<unique user identifier like email or phone number. Eg: john@example.com>",
"user_timezone_offset": 19800,
"actions": [
{
"action": "MOE_PERSONALIZATION_MESSAGE_SHOWN",
"moe_event_uuid": "aa886712-4537-47c1-b126-2686efda2e26",
"event_time": 1725258666,
"platform": "web",
"attributes": {
"cid": "66d55ae445921e4d35ae4368_F_T_WP_AB_2_P_0_AU_5A",
"experience": "Test Server side experience",
"moe_locale_id": "0",
"moe_variation_id": "2",
"audience_name": "All Users",
"audience_id": "5A",
"type": "Web Personalization"
}
}
]
}
]
}'Authorizations
Authentication is done via Basic Auth. This requires a base64-encoded string of your credentials in the format 'username:password'.
- Username: Use your MoEngage workspace ID (also known as the App ID). You can find it in the MoEngage dashboard at Settings > Account > APIs > Workspace ID (earlier app id).
- Password: Use your API Key, which you can find within the Personalize tile.
Note: After you generate and save the Personalize API Key (SECRET KEY), DO NOT generate a new key unless there is a security breach. After you generate a different key and save it, API calls using the older key won't work.
For more information on authentication and getting your credentials, refer here.
Headers
This is the Workspace ID of your MoEngage account that must be passed with the request. You can find it in the MoEngage dashboard at Settings > Account > APIs > Workspace ID (earlier app id).
"Workspace ID"
Body
Show child attributes
Show child attributes
Response
Success. The event was successfully submitted.
Was this page helpful?