Skip to main content
POST
/
campaigns
/
test
curl --request POST \
  --url https://api-{dc}.moengage.com/core-services/v1/campaigns/test \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --header 'MOE-APPKEY: <moe-appkey>' \
  --data '
{
  "request_id": "test_push_123",
  "channel": "PUSH",
  "basic_details": {
    "name": "Flash Sale Push Test",
    "platforms": [
      "ANDROID",
      "IOS"
    ],
    "platform_specific_details": {
      "android": {
        "push_amp_plus_enabled": true
      },
      "ios": {
        "send_to_all_eligible_device": true,
        "exclude_provisional_push_devices": false,
        "send_to_only_provisional_push_enabled_devices": false
      }
    }
  },
  "campaign_content": {
    "content": {
      "push": {
        "android": {
          "template_type": "BASIC",
          "basic_details": {
            "notification_channel": "general",
            "title": "Test: Flash Sale!",
            "message": "Testing message content",
            "default_click_action": "DEEPLINKING",
            "default_click_action_value": "https://example.com/sale"
          }
        },
        "ios": {
          "template_type": "BASIC",
          "basic_details": {
            "title": "Test: Flash Sale!",
            "message": "Testing message content",
            "default_click_action": "DEEPLINKING",
            "default_click_action_value": "https://example.com/sale"
          }
        }
      }
    }
  },
  "test_campaign_meta": {
    "identifier": "USER_ATTRIBUTE_UNIQUE_ID",
    "identifier_values": [
      "user_12345"
    ]
  }
}
'
{
"data": {
"user_12345": {
"status": "success"
}
},
"message": "Test campaign created successfully"
}

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: Use your API Key, which you can find within the Campaign report/Business events/Custom templates/Catalog API/Inform Report tile.

For more information on authentication and getting your credentials, refer here.

Headers

MOE-APPKEY
string
required

This is the Workspace ID of your MoEngage account that must be passed with the request. You can find it in the MoEngage dashboard at Settings > Account > APIs > Workspace ID (earlier app id).

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.

request_id
string
required

A unique identifier for this test request.

Example:

"test_push_12345"

channel
enum<string>
required

The communication channel (automatically set to PUSH for this tab).

Available options:
PUSH
basic_details
object
required

Contains the basic information about the Push campaign.

campaign_content
object
required

Contains the content and variations for the Push campaign.

test_campaign_meta
object
required

Metadata for specifying test recipients for Push campaigns.

personalization_details
object

Override values for personalizing campaign content during testing.

Important:

  • When you pass personalization details in the personalization_details object of this API, MoEngage uses those details to personalize the user attributes or event attributes present in the content instead of the attributes present in the user profile.
  • You can use this API only for 10 users at a time.
  • The same personalization details are used across all users. For example, you pass the first name as Dave in personalization details, you have used the first name in the content, and there are 10 users. In this case, all 10 users will get the same first name (Dave).

Response

Test campaign sent successfully

Response after successfully sending a test campaign.

data
object

Object containing test results for each identifier.

Each key is an identifier value with its delivery status.

Example:
{
"user_12345": { "status": "success" },
"user_67890": {
"status": "failed",
"failure_reason": "User not found"
}
}
message
string

A success message.

Example:

"Test campaign created successfully"