Test Campaign (V5)
Sends a test Push or Email message to specific users or device identifiers before publishing the campaign.
- Send
channelandcampaign_contentin the request. - For EMAIL campaigns, also include
basic_detailsandconnector. - Nothing is stored on the server.
- Send
draft_idto load content from a saved DRAFT. - By default, the server sends one test per platform, locale, and variation.
- To narrow the send, use
test_campaign_meta.platform,locale_name, orvariation.
Rate Limits
| Rate Limit Name | Rate Limit |
|---|---|
| Test campaign per second | The total number of test campaign requests per second per client allowed is 10. |
| Test campaign per minute | The total number of test campaign requests per minute per client allowed is 100. |
| Test campaign per hour | The total number of test campaign requests per hour per client allowed is 6000. |
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.
UUID v4. Required on all POST and PATCH requests except POST /v5/campaigns/{campaign_id}/validate. Repeating the same key returns the same response body.
Body
Test campaign configuration including content and target test users. Note: Use the tabs below to select your campaign type. The schema will adapt based on the selected channel.
- Push
- Email
Push test request. Supports two modes:
- Inline mode: Supply
channelandcampaign_contentdirectly. Nothing is stored on the server. - Draft mode: Supply
draft_idto load content from a saved DRAFT campaign. By default, the server sends one test per platform, locale, and variation defined in the draft. Usetest_campaign_meta.platform,locale_name, orvariationto narrow the send.
Conditional required fields: test_campaign_meta is always required. Inline mode additionally requires channel and campaign_content. Draft mode additionally requires draft_id. These per-mode requirements are enforced by the API but cannot be expressed in the required array, which lists only the always-required test_campaign_meta.
Test audience and delivery options.
Optional unique identifier for this test request (UUID v4 recommended). Used for idempotency.
"{{request_id}}"
Required for inline mode. Must be PUSH.
PUSH Required for draft mode. Raw 24-character ObjectId of the saved DRAFT campaign to test. Obtain this value from the id returned when the draft was created. Mutually exclusive with channel and campaign_content.
"{{campaign_id}}"
Identifying metadata for the Push campaign, including name, team, tags, and platform targeting.
For field-by-field rules, conditional requirements, and platform-specific delivery flags (Android push_amp_plus_enabled, iOS provisional-push audience flags), refer to Push campaign metadata.
Push message content, locales, and A/B variations.
For full POST /v5/campaigns request examples that include campaign_content, refer to campaign_delivery_type on PushCampaignCreateV5Request, VariationDetails, and the Create Campaign Draft code samples.
For per-template-type runnable payloads, refer to Android push content, iOS push content, or Web push content.
Overrides user and event attribute values used to render personalised content during the test send. When supplied, these values replace what would normally be fetched from the stored user profile, useful for testing personalised content without needing a matching user record in MoEngage.
Test with personalization overrides
{
"draft_id": "{{campaign_id}}",
"personalization_details": {
"user_attributes": {
"First Name": "{{first_name}}",
"City": "{{city}}"
},
"event_attributes": {
"product_name": "{{product_name}}",
"price": 79.99
}
},
"test_campaign_meta": {
"identifier": "USER_ATTRIBUTE_UNIQUE_ID",
"identifier_values": [
"{{user_unique_id}}"
]
}
}