Personalized Preview (V5)
Returns a fully resolved preview of personalised campaign content for a specific user - all user attributes, event attributes, content blocks, content APIs, product sets, and custom templates are rendered exactly as they would appear to that user at send time.
Rate Limits
| Rate Limit Name | Rate Limit |
|---|---|
| Personalized preview per minute | 10,000 requests per minute |
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: On your MoEngage workspace, navigate to Settings → Account → API keys and click Create new key. The tab lists every API surface (Data, Segmentation, Push, Email, Campaigns, Templates, and more) and exposes per-resource actions. For Campaigns, ensure the View, Create & Manage, and Create, Manage & Publish checkboxes are selected.
For more information on authentication and getting your credentials, refer to Getting your credentials.
Send the value in the Authorization header as Basic followed by Base64-encoding of appkey:apisecret (workspace ID and API key).
Headers
Workspace tenant ID. Set this to the workspace (App) ID from Settings > Account > APIs > Workspace ID.
This header is optional. When omitted, the API resolves the workspace from the Basic Auth credentials in the Authorization header.
In the V1 Campaigns API, the workspace ID was passed via the MOE-APPKEY request header. In V5, this header is renamed to X-MOE-Tenant-ID.
Correlates with response_id. Supply this header or request_id in the body; if both are set, they must match.
Body
Personalization preview request. Supply the target user identification and the campaign content to resolve. All Jinja expressions and dynamic sources are evaluated against the specified user's profile.
Unique identifier for this request. Correlates with response_id.
Channel of the content to preview.
PUSH, EMAIL, SMS Identifies the target user whose attributes are used to resolve personalisation.
The campaign content to resolve. Follows the same campaign_content structure as the Create Campaign request. Only the content sent here is evaluated - no saved draft is loaded.
{
"request_id": "preview-001",
"channel": "PUSH",
"user_identification": {
"type": "USER_ATTRIBUTE_UNIQUE_ID",
"value": "user_abc123"
},
"event_attributes": {
"product_name": "Running Shoes",
"product_price": "4999"
},
"campaign_content": {
"content": {
"push": {
"android": {
"template_type": "BASIC",
"basic_details": {
"title": "Hello, {{ user.first_name }}!",
"message": "{{ event.product_name }} is waiting for you."
}
}
}
}
}
}Optional map of event attribute key-value pairs to inject into personalisation resolution. Useful for previewing event-triggered campaigns where the triggering event carries attributes.