Skip to main content
POST
/
v5
/
personalization
/
preview
curl --request POST \
  --url https://api-{dc}.moengage.com/v5/personalization/preview \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --header 'X-MOE-Request-Id: <x-moe-request-id>' \
  --data '
{
  "request_id": "{{request_id}}",
  "channel": "PUSH",
  "user_identification": {
    "type": "USER_ATTRIBUTE_UNIQUE_ID",
    "value": "{{user_id}}"
  },
  "campaign_content": {
    "content": {
      "push": {
        "android": {
          "template_type": "BASIC",
          "basic_details": {
            "title": "Hello, {{ user.first_name }}!",
            "message": "{{ event.product_name }} is waiting for you."
          }
        }
      }
    }
  },
  "event_attributes": {
    "product_name": "{{product_name}}"
  }
}
'
{
  "response_id": "<string>",
  "type": "personalization",
  "data": {
    "personalized_content": {
      "response_id": "preview-001",
      "type": "personalization",
      "data": {
        "personalized_content": {
          "content": {
            "push": {
              "android": {
                "template_type": "BASIC",
                "basic_details": {
                  "title": "Hello, Jane!",
                  "message": "Running Shoes is waiting for you."
                }
              }
            }
          }
        }
      }
    }
  }
}

Rate Limits

Rate Limit NameRate Limit
Personalized preview per minute10,000 requests per minute

Authorizations

Authorization
string
header
required

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 SettingsAccountAPI 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

X-MOE-Tenant-ID
string

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.

X-MOE-Request-Id
string
required

Correlates with response_id. Supply this header or request_id in the body; if both are set, they must match.

Body

application/json

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.

request_id
string
required

Unique identifier for this request. Correlates with response_id.

channel
enum<string>
required

Channel of the content to preview.

Available options:
PUSH,
EMAIL,
SMS
user_identification
object
required

Identifies the target user whose attributes are used to resolve personalisation.

campaign_content
object
required

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.

Example:
{
"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."
}
}
}
}
}
}
event_attributes
object

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.

Response

Preview resolved successfully. Returns the fully rendered content for the specified user.

response_id
string
type
string
Example:

"personalization"

data
object