curl --request POST \
--url https://api-{dc}.moengage.com/v5/analytics/behavior \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"version": "2.0",
"type": "behavior",
"analysis_type": "events",
"events": [
{
"id": "A",
"actions": [
{
"c_at_trigger_seg_v2": {
"included_filters": {
"filter_operator": "and",
"filters": [
{
"filter_type": "actions",
"action_name": "USER ENTERED FLOW",
"execution": {
"type": "atleast",
"count": 3
},
"executed": true,
"attributes": {
"filter_operator": "and",
"filters": []
}
}
]
}
},
"c_at_act_seg_v2": {
"included_filters": {
"filter_operator": "and",
"filters": []
}
}
}
],
"split_by": [],
"aggregation": {}
}
],
"segmentation": [
{
"filters": {
"included_filters": {
"filter_operator": "and",
"filters": [
{
"id": "moe_all_users",
"name": "All Users",
"filter_type": "custom_segments"
}
]
}
}
}
],
"user_attr_grouped_by": [],
"distribution": {},
"timerange": {
"start": "2026-06-01 00:00:00",
"end": "2026-06-30 23:59:59",
"label": "Last Month",
"dt_label": "last_m",
"value": 29
},
"granularity": "d",
"chart_type": "line",
"count_type": "number",
"chart_plot_type": "linear",
"rolling_value": -1,
"user_aggregation_type": "",
"user_aggregation_percentile": -1,
"comparison_timerange": {},
"chart_sort_type": "descending"
}
'{
"response_id": "fc803857-632e-4bf0-8df1-fbc2bdeedb66",
"type": "behavior",
"data": {
"request_id": "REQUEST_ID"
}
}{
"error": {
"code": "VALIDATION_FAILED",
"message": "analysis_type - Enum doesnt allow value: eventsdfg, allowed values: [events, users, session, aggregation, aggregation_distribution, total_events_per_user, attribute_aggregation_per_user] : 'eventsdfg'",
"doc_url": "https://www.moengage.com/docs/api/analytics-queries/"
},
"response_id": "01306019-419a-4728-ad82-9d522464f33a"
}{
"code": "ER001",
"target": "Authentication Invalid",
"message": "Auth validation failed."
}{
"code": "ER007",
"target": "Authentication Invalid",
"message": "Auth validation failed."
}{
"error": {
"code": "QUOTA_EXCEEDED",
"message": "Your workspace has reached its monthly Fair Usage Policy limit for analytics usage. Please contact your Customer Success Manager to expand your quota.",
"doc_url": "https://www.moengage.com/docs/api/analytics-queries/"
},
"response_id": "714b4690eba1deb53b065d92277e2910"
}{
"error": {
"code": "INTERNAL_ERROR",
"message": "An unexpected error occurred while processing the request.",
"doc_url": "https://www.moengage.com/docs/api/analytics-queries/"
},
"response_id": "dcc4fd00-2980-41a5-94b3-ad4844ae3d72"
}Registers an asynchronous Behavior analysis query and returns a request_id. Behavior analysis measures how many users perform one or more events over a time range, broken down by the dimensions you choose.
Use the request_id with Get Query Status to poll for completion, then Get Query Results to fetch the resolved series.
curl --request POST \
--url https://api-{dc}.moengage.com/v5/analytics/behavior \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"version": "2.0",
"type": "behavior",
"analysis_type": "events",
"events": [
{
"id": "A",
"actions": [
{
"c_at_trigger_seg_v2": {
"included_filters": {
"filter_operator": "and",
"filters": [
{
"filter_type": "actions",
"action_name": "USER ENTERED FLOW",
"execution": {
"type": "atleast",
"count": 3
},
"executed": true,
"attributes": {
"filter_operator": "and",
"filters": []
}
}
]
}
},
"c_at_act_seg_v2": {
"included_filters": {
"filter_operator": "and",
"filters": []
}
}
}
],
"split_by": [],
"aggregation": {}
}
],
"segmentation": [
{
"filters": {
"included_filters": {
"filter_operator": "and",
"filters": [
{
"id": "moe_all_users",
"name": "All Users",
"filter_type": "custom_segments"
}
]
}
}
}
],
"user_attr_grouped_by": [],
"distribution": {},
"timerange": {
"start": "2026-06-01 00:00:00",
"end": "2026-06-30 23:59:59",
"label": "Last Month",
"dt_label": "last_m",
"value": 29
},
"granularity": "d",
"chart_type": "line",
"count_type": "number",
"chart_plot_type": "linear",
"rolling_value": -1,
"user_aggregation_type": "",
"user_aggregation_percentile": -1,
"comparison_timerange": {},
"chart_sort_type": "descending"
}
'{
"response_id": "fc803857-632e-4bf0-8df1-fbc2bdeedb66",
"type": "behavior",
"data": {
"request_id": "REQUEST_ID"
}
}{
"error": {
"code": "VALIDATION_FAILED",
"message": "analysis_type - Enum doesnt allow value: eventsdfg, allowed values: [events, users, session, aggregation, aggregation_distribution, total_events_per_user, attribute_aggregation_per_user] : 'eventsdfg'",
"doc_url": "https://www.moengage.com/docs/api/analytics-queries/"
},
"response_id": "01306019-419a-4728-ad82-9d522464f33a"
}{
"code": "ER001",
"target": "Authentication Invalid",
"message": "Auth validation failed."
}{
"code": "ER007",
"target": "Authentication Invalid",
"message": "Auth validation failed."
}{
"error": {
"code": "QUOTA_EXCEEDED",
"message": "Your workspace has reached its monthly Fair Usage Policy limit for analytics usage. Please contact your Customer Success Manager to expand your quota.",
"doc_url": "https://www.moengage.com/docs/api/analytics-queries/"
},
"response_id": "714b4690eba1deb53b065d92277e2910"
}{
"error": {
"code": "INTERNAL_ERROR",
"message": "An unexpected error occurred while processing the request.",
"doc_url": "https://www.moengage.com/docs/api/analytics-queries/"
},
"response_id": "dcc4fd00-2980-41a5-94b3-ad4844ae3d72"
}Rate Limit
The rate limits are at the workspace level. A maximum of 5 requests per second, 20 requests per minute, and 350 requests per hour are allowed per workspace.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.
Body
Request body for registering a Behavior analysis query.
Payload schema version.
"2.0"
The analysis type. Must be behavior for this endpoint.
behavior The behavior metric to compute — for example, events (event counts), users (users who performed the event), or a per-user aggregation.
events, users, session, aggregation, aggregation_distribution, total_events_per_user, attribute_aggregation_per_user The events to analyze. Include 1 to 10 events. Each event has an id, one or more actions (event + attribute filters), an optional split_by, and an optional aggregation.
1 - 10 elementsShow child attributes
Show child attributes
Segments used to scope the analysis to a subset of users. Include up to 5 segments. To analyze all users, pass a single segment with the All Users custom segment.
5Show child attributes
Show child attributes
User attributes to group the results by. Include up to 10; the combined total with all split_by entries must not exceed 10.
10Show child attributes
Show child attributes
[
{
"attr_type": "user",
"column_name": "t_rev",
"data_types": ["double"],
"encrypted": false,
"pii": false,
"readable_name": "LTV",
"type": "_f"
}
]
Custom distribution configuration. When using custom buckets, include at most 10 buckets. Pass an empty object for no custom distribution.
Show child attributes
Show child attributes
{
"type": "custom",
"from": 0,
"to": 10,
"interval": 1
}
The time window the analysis runs over.
Show child attributes
Show child attributes
Time bucket for the series — h (hour), d (day), w (week), m (month), or e (entire range). When hourly, the time range must not exceed 31 days.
h, d, w, m, e "d"
Visual representation of the result.
line, area, bar, column, euler, pie "line"
A second time range to compare against. Time comparison is supported only on line, bar, and column charts, and cannot be combined with custom-segment comparison (2 or more segments). Pass an empty object for no comparison.
Show child attributes
Show child attributes
{
"start": "2026-08-19 00:00:00",
"end": "2026-08-26 23:59:59",
"label": "Previous day",
"dt_label": "prev_d",
"value": 7
}
Whether metrics are returned as absolute counts (number) or as percentages (percentage).
number, percentage "number"
Plot scale applied to the chart.
linear, logarithmic, cumulative, rolling_sum, rolling_avg, rolling_window "linear"
Rolling-window size for the metric, or -1 when not used.
-1
The per-user aggregation to apply. Empty when not using an aggregation.
""
Percentile to compute when user_aggregation_type is a percentile aggregation. A value from 1 to 100, or -1 when not used.
-1
Sort order applied to the result series.
ascending, descending Response
Query registered. Poll status and fetch results with data.request_id.
Acknowledgement that a query was registered. Use data.request_id to poll status and fetch results.