Skip to main content
POST
/
v5
/
campaigns
/
test
curl --request POST \
  --url https://api-{dc}.moengage.com/v5/campaigns/test \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: <idempotency-key>' \
  --header 'X-MOE-Request-Id: <x-moe-request-id>' \
  --data '
{
  "request_id": "{{request_id}}",
  "channel": "PUSH",
  "basic_details": {
    "name": "{{campaign_name}}",
    "platforms": [
      "ANDROID"
    ]
  },
  "campaign_content": {
    "content": {
      "push": {
        "android": {
          "template_type": "BASIC",
          "basic_details": {
            "title": "{{title}}",
            "message": "{{message}}",
            "notification_channel": "{{notification_channel}}"
          }
        }
      }
    }
  },
  "test_campaign_meta": {
    "identifier": "USER_ATTRIBUTE_UNIQUE_ID",
    "identifier_values": [
      "{{identifier_value}}"
    ]
  }
}
'
{
  "response_id": "abc-701",
  "type": "campaign",
  "data": {
    "data": {
      "ANDROID_default_variation_1": {
        "status": "SENT"
      }
    },
    "message": "Test campaign processed"
  }
}
The endpoint supports two modes: Inline mode
  • Send channel and campaign_content in the request.
  • For EMAIL campaigns, also include basic_details and connector.
  • Nothing is stored on the server.
Draft mode
  • Send draft_id to 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, or variation.

Rate Limits

Rate Limit NameRate Limit
Test campaign per secondThe total number of test campaign requests per second per client allowed is 10.
Test campaign per minuteThe total number of test campaign requests per minute per client allowed is 100.
Test campaign per hourThe total number of test campaign requests per hour per client allowed is 6000.

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.

Idempotency-Key
string<uuid>
required

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

application/json

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 test request. Supports two modes:

  • Inline mode: Supply channel and campaign_content directly. Nothing is stored on the server.
  • Draft mode: Supply draft_id to load content from a saved DRAFT campaign. By default, the server sends one test per platform, locale, and variation defined in the draft. Use test_campaign_meta.platform, locale_name, or variation to 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_campaign_meta
object
required

Test audience and delivery options.

request_id
string

Optional unique identifier for this test request (UUID v4 recommended). Used for idempotency.

Example:

"{{request_id}}"

channel
enum<string>

Required for inline mode. Must be PUSH.

Available options:
PUSH
draft_id
string

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.

Example:

"{{campaign_id}}"

basic_details
object

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.

campaign_content
object

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.

personalization_details
object

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}}"
]
}
}

Response

Test send result

response_id
string
type
string
Example:

"campaign"

data
object

Result of a test send. data maps composite keys to per-send status objects. message summarizes the overall operation.