curl --request POST \
--url https://api-{dc}.moengage.com/v5/personalizations/previews \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"request_id": "req-8841",
"personalization_content": {
"payload": {
"subject": "Hello {{UserAttribute[\"first_name\"] | default(\"there\")}}",
"body": "Welcome {{UserAttribute[\"second_name\"]}}!"
}
},
"user_details": {
"identifier": "email",
"identifier_value": "[email protected]"
},
"personalization_details": {
"channel": "EMAIL",
"event_name": "MOE_APP_OPENED",
"user_attributes": {
"first_name": "Ada"
}
}
}
'{
"personalized_content": {
"payload": {
"subject": "Hello Ada",
"body": "Welcome Ada!"
}
}
}Personalized Preview (V5)
Resolves Jinja personalization tokens (UserAttribute, EventAttribute, ContentBlock, ContentApi, and ProductSet) inside a content payload or a saved custom template, and returns the fully rendered output for the specified user — without sending a message.
curl --request POST \
--url https://api-{dc}.moengage.com/v5/personalizations/previews \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"request_id": "req-8841",
"personalization_content": {
"payload": {
"subject": "Hello {{UserAttribute[\"first_name\"] | default(\"there\")}}",
"body": "Welcome {{UserAttribute[\"second_name\"]}}!"
}
},
"user_details": {
"identifier": "email",
"identifier_value": "[email protected]"
},
"personalization_details": {
"channel": "EMAIL",
"event_name": "MOE_APP_OPENED",
"user_attributes": {
"first_name": "Ada"
}
}
}
'{
"personalized_content": {
"payload": {
"subject": "Hello Ada",
"body": "Welcome Ada!"
}
}
}Rate Limit
| Window | Max requests |
|---|---|
| 1 s | 100 |
| 10 s | 1,000 |
| 60 s | 6,000 |
Personalization Support
- User attributes
- Event attributes
- Custom templates
- Content blocks
- Content APIs
- Product sets
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). Find it in the MoEngage dashboard at Settings > Account > API keys.
- Password: Use an API key from Settings > Account > API keys.
Refer to API Key Dashboard for details on creating and managing API keys.
Headers
Your MoEngage Workspace ID (App ID). Optional — Basic Auth already carries the Workspace ID as the username, so this header is not required. Find it in the dashboard at Settings > Account > API keys.
Client-supplied trace ID. The server echoes it in the X-MOE-Request-Id response header and in response_id. If you omit it, the server generates one.
Body
Supply the target user (optional) and either an inline content payload or a reference to a saved custom template.
A unique identifier for this request. Echoed back as the top-level response_id on the response. Takes priority over the X-MOE-Request-Id header when both are supplied.
"req-8841"
Supply exactly one of payload or custom_template_data. A request with both, or with neither, fails validation.
- Inline payload
- Saved custom template
Show child attributes
Show child attributes
Channel and attribute context used while rendering.
Show child attributes
Show child attributes
Identifies the user whose attributes are used to resolve personalization tokens. Omit this object to render without resolving a specific user's stored attributes.
Show child attributes
Show child attributes
Response
This response is returned when the request is processed successfully.
Show child attributes
Show child attributes