curl --request POST \
--url https://api-{dc}.moengage.com/v5/content-apis/{id}/test \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"request_id": "4c8e1f26-7b93-4d5a-9e08-3a1b6d7c2f45",
"dynamic_values": {
"UserAttribute": {
"city": "Delhi",
"units": "metric"
},
"EventAttribute": {
"name": "added_to_cart",
"id": "id-123"
}
}
}
'{
"response_id": "4c8e1f26-7b93-4d5a-9e08-3a1b6d7c2f45",
"type": "content-apis",
"data": {
"api_response_code": 200,
"api_response_body": {
"weather": [
{
"main": "Clouds",
"description": "overcast clouds"
}
],
"main": {
"temp": 307.22,
"humidity": 50
},
"name": "Delhi",
"cod": 200
}
}
}Test Content API
Loads the saved content API identified by id and executes it against the upstream endpoint, returning the response. The full definition — URL, method, parameters, headers, body, and authentication — comes from the saved configuration.
The optional request body supplies sample values for the personalization tokens ({{UserAttribute['city']}}) in that configuration, which are resolved before the call. Omit the body if the configuration has no tokens.
Send Content-Type: application/json only when you include a request body. When the saved configuration has no tokens and you send no body, omit the header as well.
The upstream response is passed through in data.api_response_body — parsed JSON when the upstream returns JSON, and the raw body as a string otherwise. See the response examples for both cases.
The URL is validated against server-side request forgery (SSRF): internal and private ranges are rejected with 400.
A well-formed id that matches no saved configuration returns 404. An id that is not a valid ObjectId returns 400 with VALIDATION_FAILED.
curl --request POST \
--url https://api-{dc}.moengage.com/v5/content-apis/{id}/test \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"request_id": "4c8e1f26-7b93-4d5a-9e08-3a1b6d7c2f45",
"dynamic_values": {
"UserAttribute": {
"city": "Delhi",
"units": "metric"
},
"EventAttribute": {
"name": "added_to_cart",
"id": "id-123"
}
}
}
'{
"response_id": "4c8e1f26-7b93-4d5a-9e08-3a1b6d7c2f45",
"type": "content-apis",
"data": {
"api_response_code": 200,
"api_response_body": {
"weather": [
{
"main": "Clouds",
"description": "overcast clouds"
}
],
"main": {
"temp": 307.22,
"humidity": 50
},
"name": "Delhi",
"cod": 200
}
}
}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). Find it in the MoEngage dashboard at Settings > Account > API keys.
- Password: Use an API key from Settings > Account > API keys.
Refer to API Key Dashboard for details on creating and managing API keys.
Headers
Client-supplied trace ID (UUID v4). Echoed back in the X-MOE-Request-Id response header and returned unchanged as response_id in the body. When you omit this header, MoEngage generates a 12-character hexadecimal identifier instead. Quote it when contacting MoEngage Support.
On Test Content API, the body field request_id takes precedence: when you send both, response_id echoes request_id and this header is echoed only in the X-MOE-Request-Id response header.
Path Parameters
Content API ID of the saved config to test — a bare 24-character hexadecimal ObjectId, with no resource prefix. Pass it exactly as returned in data[].id from List Content APIs.
Body
Sample values for the personalization tokens in the saved Content API. Omit the body entirely if the config has no tokens.
A config may reference tokens from more than one namespace. Worked example: a config whose URL is https://api.example.com/v1/weather?q={{UserAttribute['city']}}&units={{UserAttribute['units']}}&event={{EventAttribute['name']}}&event_id={{EventAttribute['id']}} has four tokens across the UserAttribute and EventAttribute namespaces, so the body carries a dynamic_values entry for each — grouped under the namespace each token belongs to.
Client-generated ID for tracing. Returned unchanged as response_id in the response. This field takes precedence over the X-MOE-Request-Id header — when you send both, response_id echoes this value, and the header value is returned only in the X-MOE-Request-Id response header.
"4c8e1f26-7b93-4d5a-9e08-3a1b6d7c2f45"
Sample values for the personalization tokens in the saved config, keyed by token namespace.
| Token in the saved config | Body path |
|---|---|
{{UserAttribute['city']}} | dynamic_values.UserAttribute.city |
{{EventAttribute['product_id']}} | dynamic_values.EventAttribute.product_id |
- The namespace is the part before the square brackets. The attribute name is the quoted string inside them.
- The object is exactly two levels deep, and every value is a string.
- The namespaces are not mutually exclusive. Include every namespace the config references.
- Send one entry per token in the config under test, and nothing else. Tokens may appear in the saved url, params, headers, or body.
Show child attributes
Show child attributes
{
"UserAttribute": { "city": "Delhi", "units": "metric" },
"EventAttribute": { "name": "added_to_cart", "id": "id-123" }
}
Response
Test execution result (returned for both passing and failing upstream calls)
Unique identifier for this response. Echoes the request_id you sent in the body, returned unchanged. When you omit request_id, it echoes the X-MOE-Request-Id header instead; when you send neither, MoEngage generates a 12-character hexadecimal identifier. Quote it when contacting MoEngage Support.
"4c8e1f26-7b93-4d5a-9e08-3a1b6d7c2f45"
The resource type contained in data. Always content-apis for this endpoint.
content-apis The outcome of the call MoEngage made to the upstream endpoint.
Show child attributes
Show child attributes