test_campaign
Send a test email or push notification to specified recipients to validate campaign content and delivery before full deployment.
Instructions
Send a test Email or Push campaign to specific recipients.
channel: EMAIL or PUSH. campaign_name: Name for the test campaign. user_attributes: List of dicts identifying recipients. Each dict has one key-value pair. EMAIL examples: [{"email_id": "alice@example.com"}, {"email_id": "bob@example.com"}] PUSH examples: [{"customer_id": "uid-123"}, {"push_token": "tok-abc"}] Maximum 10 recipients for EMAIL test campaigns.
Required for EMAIL: from_address, and either html_content or template_id. subject is required unless template_id is provided. Required for PUSH: platforms (list of ANDROID/IOS/WEB), push_title, push_message.
Only campaigns created via the MoEngage API can be tested (dashboard-created campaigns will be rejected by MoEngage with an appropriate error).
--- EMAIL PARAMS --- subject: Email subject line (required unless template_id is provided). sender_name: Display name for the sender (defaults to campaign_name). from_address: Sending email address (required). reply_to_address: Reply-to address (defaults to from_address). connector_type: Email connector type (defaults to "AMAZON_SES"). connector_name: Connector config name (defaults to "default"). email_content_type: PROMOTIONAL or TRANSACTIONAL (default: PROMOTIONAL). html_content: Raw HTML body (mutually exclusive with template_id). template_id: Saved template ID (mutually exclusive with html_content). subscription_category: Required for PROMOTIONAL emails. preview_text: Preheader text shown in inbox previews. utm_params: UTM tracking parameters dict (injected at payload top level). cc_ids: CC email addresses list. bcc_ids: BCC email addresses list. custom_template_version: Template version number override. attachments: List of attachment dicts.
--- PUSH PARAMS --- platforms: Target platforms — list of ANDROID, IOS, WEB (required). push_title: Notification title (required). push_message: Notification body (required). android_notification_channel: Android channel ID (default: "default"). android_default_click_action: Android click action (default: "DEEPLINKING"). android_default_click_action_value: Deep link URL for DEEPLINKING. android_image_url: Android notification image URL. android_input_gif_url: Android notification GIF URL. android_key_value_pairs: Custom key-value pairs for Android. android_buttons: Android push action buttons list. android_advanced: Android advanced options dict. android_push_content_override: Replaces auto-built Android content block entirely. Flat android_* params are ignored when this is provided. android_summary: Android notification summary text. android_push_amp_plus_enabled: Enable Push Amplification Plus for Android (default: False). android_template_type: Android template type — BASIC, STYLIZED_BASIC, SIMPLE_IMAGE_CAROUSEL, IMAGE_BANNER_WITH_TEXT, TIMER, TIMER_WITH_PROGRESS_BAR, or Custom (default: "BASIC"). android_custom_template_id: Custom template ID (used with Custom template_type). android_custom_template_version: Custom template version. android_timer: Timer configuration dict for countdown notifications. android_template_backup: Fallback template dict for custom templates. android_carousel_content: Carousel content dict for carousel notifications. android_background_color_code: Hex color for notification background (STYLIZED_BASIC, SIMPLE_IMAGE_CAROUSEL, IMAGE_BANNER_WITH_TEXT). android_app_name_color_code: Hex color for app name text (STYLIZED_BASIC, SIMPLE_IMAGE_CAROUSEL, IMAGE_BANNER_WITH_TEXT). android_notification_control_color: LIGHT or DARK control color (STYLIZED_BASIC, SIMPLE_IMAGE_CAROUSEL, IMAGE_BANNER_WITH_TEXT). android_include_app_name_and_time: Show app name and time (IMAGE_BANNER_WITH_TEXT). android_include_title_and_message: Show title and message (IMAGE_BANNER_WITH_TEXT). android_apply_background_color_in_text_editor: Apply background color in text editor (STYLIZED_BASIC, SIMPLE_IMAGE_CAROUSEL, IMAGE_BANNER_WITH_TEXT). android_image_scaling: FIT_INSIDE_IMAGE_CONTAINER or FILL_IMAGE_CONTAINER (SIMPLE_IMAGE_CAROUSEL, IMAGE_BANNER_WITH_TEXT). android_banner_image_url: Banner image URL (required for IMAGE_BANNER_WITH_TEXT). android_collapsed_push_notification: Collapsed push style e.g. "SAME_AS_TEMPLATE_BACKUP" (IMAGE_BANNER_WITH_TEXT). ios_title: iOS title (falls back to push_title if not set). ios_message: iOS message body (falls back to push_message if not set). ios_default_click_action: iOS click action type. ios_default_click_action_value: iOS click action URL/value. ios_subtitle: iOS notification subtitle. ios_allow_bg_refresh: Allow background refresh for iOS push. ios_rich_media_type: iOS rich media type — IMAGE, VIDEO, AUDIO, GIF. ios_rich_media_value: iOS rich media URL value. ios_image_url: iOS notification image URL. ios_input_gif_url: iOS notification GIF URL. ios_key_value_pairs: Custom key-value pairs for iOS push. ios_background_color_code: Hex color for notification background (STYLIZED_BASIC, SIMPLE_IMAGE_CAROUSEL). ios_apply_background_color_in_text_editor: Apply background color in text editor (STYLIZED_BASIC, SIMPLE_IMAGE_CAROUSEL). ios_template_type: iOS template type — BASIC, STYLIZED_BASIC, SIMPLE_IMAGE_CAROUSEL, or Custom (default: "BASIC"). ios_custom_template_id: Custom template ID (used with Custom template_type). ios_custom_template_version: Custom template version. ios_template_backup: Fallback template dict for custom templates. ios_carousel_content: Carousel content dict for carousel notifications. ios_send_to_all_eligible_device: Send to all eligible iOS devices (default True). ios_exclude_provisional: Exclude provisional push devices (mutually exclusive with ios_send_to_only_provisional). ios_send_to_only_provisional: Send only to provisional push devices (mutually exclusive with ios_exclude_provisional). ios_buttons: iOS push action buttons list. ios_advanced: iOS advanced options dict. ios_push_content_override: Replaces auto-built iOS content block entirely. Flat ios_* content params are ignored when this is provided. web_redirect_url: Web push redirect URL (required by MoEngage for WEB platform). web_image_url: Web push notification image URL. web_auto_dismiss_notification: Auto-dismiss web push notification after display. web_buttons: Web push action buttons list. web_advanced: Web advanced options dict. web_icon_image_type: DEFAULT or ICON_URL — web notification icon source. web_icon_url: Custom icon URL for web push (used when icon_image_type is ICON_URL). web_push_content_override: Replaces auto-built Web content block entirely. Flat web_* params are ignored when this is provided.
--- SHARED PARAMS --- tags: Campaign tags list (injected into basic_details). team: Team name (injected into basic_details). business_event: Business event name (injected into basic_details). send_to_triggered_platform_only: Send only to the platform that triggered the event (PUSH only). broadcast_live_activity_id: Live Activity broadcast ID (PUSH iOS only). geofences: Geofence configuration dict (PUSH LOCATION_TRIGGERED only). locales: List of locale codes for multi-locale content. For locale-keyed content structure, use campaign_content_override instead. variation_details: Variation metadata dict for A/B test content. personalization_details: Flat dict of attribute overrides for test rendering. Format: {"UserAttribute[First Name]": "Alice", "EventAttribute[App_Version]": "2.0"} identifier_type: Override auto-detected MoEngage identifier type (e.g. "PUSH_ID", "MOE_GAID", "ADVERTISING_IDENTIFIER", "CUSTOM_SEGMENT"). When set, bypasses key-based auto-detection from user_attributes keys entirely. locale_name: Locale name to inject into test_campaign_meta (e.g. "en", "ar"). variation: Variation name to inject into test_campaign_meta (e.g. "A", "B"). campaign_content_override: Replaces the entire auto-built campaign_content section. Highest-precedence override — all channel-specific content params are ignored.
Rate limit: 5/min, 25/hr, 100/day.
Returns: {success: true, recipients_requested, total_success_count, total_failed_count, batches: [{platforms, locale, variation, success_count, failed_count, succeeded: [[...]], failed}], note?: str} on success. When recipients_requested > total_success_count + total_failed_count, a note explains that MoEngage silently skipped recipients without eligible devices for the targeted platform(s). {success: false, error, status_code, api_response} on API error. {success: false, error: ""} on input validation failure.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| channel | Yes | ||
| campaign_name | Yes | ||
| user_attributes | Yes | ||
| subject | No | ||
| sender_name | No | ||
| from_address | No | ||
| reply_to_address | No | ||
| connector_type | No | ||
| connector_name | No | ||
| email_content_type | No | ||
| html_content | No | ||
| template_id | No | ||
| subscription_category | No | ||
| preview_text | No | ||
| utm_params | No | ||
| cc_ids | No | ||
| bcc_ids | No | ||
| custom_template_version | No | ||
| attachments | No | ||
| platforms | No | ||
| push_title | No | ||
| push_message | No | ||
| android_notification_channel | No | ||
| android_default_click_action | No | ||
| android_default_click_action_value | No | ||
| android_image_url | No | ||
| android_input_gif_url | No | ||
| android_key_value_pairs | No | ||
| android_buttons | No | ||
| android_advanced | No | ||
| android_push_content_override | No | ||
| android_summary | No | ||
| android_push_amp_plus_enabled | No | ||
| android_template_type | No | ||
| android_custom_template_id | No | ||
| android_custom_template_version | No | ||
| android_timer | No | ||
| android_template_backup | No | ||
| android_carousel_content | No | ||
| android_background_color_code | No | ||
| android_app_name_color_code | No | ||
| android_notification_control_color | No | ||
| android_include_app_name_and_time | No | ||
| android_include_title_and_message | No | ||
| android_apply_background_color_in_text_editor | No | ||
| android_image_scaling | No | ||
| android_banner_image_url | No | ||
| android_collapsed_push_notification | No | ||
| ios_title | No | ||
| ios_message | No | ||
| ios_default_click_action | No | ||
| ios_default_click_action_value | No | ||
| ios_subtitle | No | ||
| ios_allow_bg_refresh | No | ||
| ios_rich_media_type | No | ||
| ios_rich_media_value | No | ||
| ios_image_url | No | ||
| ios_input_gif_url | No | ||
| ios_key_value_pairs | No | ||
| ios_background_color_code | No | ||
| ios_apply_background_color_in_text_editor | No | ||
| ios_template_type | No | ||
| ios_custom_template_id | No | ||
| ios_custom_template_version | No | ||
| ios_template_backup | No | ||
| ios_carousel_content | No | ||
| ios_send_to_all_eligible_device | No | ||
| ios_exclude_provisional | No | ||
| ios_send_to_only_provisional | No | ||
| ios_buttons | No | ||
| ios_advanced | No | ||
| ios_push_content_override | No | ||
| web_redirect_url | No | ||
| web_image_url | No | ||
| web_auto_dismiss_notification | No | ||
| web_buttons | No | ||
| web_advanced | No | ||
| web_icon_image_type | No | ||
| web_icon_url | No | ||
| web_push_content_override | No | ||
| tags | No | ||
| team | No | ||
| business_event | No | ||
| send_to_triggered_platform_only | No | ||
| broadcast_live_activity_id | No | ||
| geofences | No | ||
| locales | No | ||
| variation_details | No | ||
| personalization_details | No | ||
| identifier_type | No | ||
| locale_name | No | ||
| variation | No | ||
| campaign_content_override | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||