Skip to main content
POST
/
personalization
/
preview
curl --request POST \ --url https://api-{dc}.moengage.com/core-services/v1/personalization/preview \ --header 'Authorization: Basic <encoded-value>' \ --header 'Content-Type: application/json' \ --header 'MOE-APPKEY: <moe-appkey>' \ --data @- <<EOF { "request_id": "preview_req_12345", "personalization_details": { "channel": "EMAIL", "user_attributes": { "Gender": "Female", "First Name": "Jane" } }, "personalization_content": { "payload": { "email_html": "<!DOCTYPE html><html><body><p>Hi {{UserAttribute['First Name']}}, your gender is {{UserAttribute['Gender']}}</p></body></html>" } }, "user_details": { "identifier": "ID", "identifier_value": "USER_001" } } EOF
{ "personalized_content": { "payload": { "email_html": "<!DOCTYPE html><html><body><p>Hi Jane, your gender is Female</p></body></html>" } } }
Supported Channels
  • EMAIL - Email content preview
  • PUSH - Push notification preview
  • SMS - SMS message preview
Personalization Support
  • User attributes
  • Event attributes
  • Custom templates
  • Content blocks
  • Content APIs
  • Product sets
Rate Limit 10,000 requests per minute
Important Information
  • When you pass personalization_details, MoEngage uses those values to personalize content instead of actual user profile data
  • Attributes must exist in the MoEngage Dashboard
  • If an attribute doesn’t exist and default value is not “MOE_NOT_SEND”, it will appear empty
  • Event attributes can be used when the same event is used for the campaign
  • Either payload or custom_template_data must be provided in personalization_content
You can use event attributes to personalize content APIs when the same event is used for the campaign.
Use this API to validate your personalization logic and see exactly how content will appear to specific users before launching campaigns.

Authorizations

Authorization
string
header
required

Authentication is done via Basic Auth. The username is your Workspace ID (earlier APP ID) and the password is your API Key. The value is a base64 encoding of 'username:password'.

How to obtain credentials:

  1. Navigate to SettingsAccountAPIs in the MoEngage Dashboard
  2. Username: Copy the Workspace ID (earlier app id)
  3. Password: Copy the API key from the Campaign report/Business events/Custom templates tile

Headers

MOE-APPKEY
string
required

This is the workspace ID (earlier APP ID) of your MoEngage workspace.

You can find your MoEngage Workspace ID in the MoEngage Dashboard: SettingsAccountAPIsWorkspace ID (earlier app id)

data-compression
boolean

Whether to pass the payload in compressed format.

Set to true to send compressed payload.

Body

application/json

Personalization preview request with content and user details.

Request to preview personalized content for a specific user.

request_id
string
required

A unique identifier for this personalization preview request.

Example:

"preview_req_12345"

personalization_content
object
required

The content to personalize.

Note: Either payload or custom_template_data must be provided.

personalization_details
object
required

Override values for personalization.

user_details
object

Information about the user to preview for.

Note: If using user_details, both identifier and identifier_value are mandatory.

Response

Successfully retrieved personalized content preview

Response containing the personalized content.

personalized_content
object

The personalized content with all attributes resolved.