---
title: "Personalized Preview"
method: POST
path: "/personalization/preview"
tags: ["Test Campaigns"]
---

# Personalized Preview

`POST /personalization/preview`

## Request

- Base URL: `https://api-01.moengage.com/core-services/v1`
- URL: `https://api-01.moengage.com/core-services/v1/personalization/preview`
- Auth: HTTP basic
- TypeScript: <https://skmtc.dev/moengage/apis/moengage-campaigns-api/docs/personalization/preview/post.ts> (a function with typed inputs; its response is checked against the schema)

This API shows a preview of personalized content for a specific user before sending a Push, Email, or SMS campaign. This API retrieves personalized message content with all user/event attributes resolved. Use this API to validate your personalization logic and see exactly how content will appear to specific users before launching campaigns.

## Headers

- `MOE-APPKEY` string, required
- `data-compression` boolean

## Request body

- PersonalizedPreviewRequest
  - `request_id` string, required: A unique identifier for this personalization preview request.
  - `personalization_content` object, required: The content to personalize. **Note:** Either `payload` or `custom_template_data` must be provided.
    - `payload` object: Flexible key-value pairs containing content to personalize. Can include any name and number of keys with HTML, text, or Jinja templates.
    - `custom_template_data` object: Custom template information. **Required fields when using custom templates:** - template_id - version
      - `template_id` string: The ID of the custom template.
      - `version` string: The version of the custom template.
  - `user_details` object: Information about the user to preview for. **Note:** If using user_details, both `identifier` and `identifier_value` are mandatory.
    - `identifier` string: The type of unique identifier used to specify the user. Can be ID, email, phone number, etc.
    - `identifier_value` string: The corresponding value of the selected identifier.
  - `personalization_details` object, required: **Important**: - 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 does not 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. - You can use event attributes to personalize content APIs when the same event is used for the campaign.
    - `channel` 'EMAIL' | 'PUSH' | 'SMS', required: The channel for which to preview personalized content.
    - `event_name` string: The event name for personalization. **Required** if event attributes are present in the payload.
    - `user_attributes` object: Key-value pairs representing specific user characteristics. Can contain any name and number of keys.
    - `event_attributes` object: Key-value pairs describing properties of a particular event. Can contain any name and number of keys.

## Response `200`

Successfully retrieved personalized content preview

- PersonalizedPreviewResponse: Response containing the personalized content.
  - `personalized_content` object: The personalized content with all attributes resolved.
    - `payload` object: The personalized content with all user/event attributes and personalization elements resolved. Structure mirrors the input payload with personalized values filled in.

## Other responses

- `400`: Bad Request - Missing or invalid parameters
- `401`: Authentication Failure - Invalid or missing authentication credentials
- `429`: Rate Limit Breach - Too many requests
- `500`: Internal Server Error - Unexpected system error

---

[API](https://skmtc.dev/moengage/apis/moengage-campaigns-api.md) - [All operations](https://skmtc.dev/moengage/apis/moengage-campaigns-api/llms.txt) - [OpenAPI document](https://skmtc.dev/moengage/apis/moengage-campaigns-api/revisions/7fc8a931584f?raw)
