Register a User Analysis Query
Registers an asynchronous User Property Analysis (UPA) query and returns a request_id. User Property Analysis computes counts, distinct-value counts, distributions, and aggregations over user attributes for a cohort of users.
Use the request_id with Get Query Status to poll for completion, then Get Query Results to fetch the resolved series.
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: Use your Data API Key, which you can find in the MoEngage dashboard at Settings > Account > APIs.
For more information, see Authentication.
Body
Request body for registering a User Property Analysis (UPA) query.
The analysis type. Must be user_analysis for this endpoint.
user_analysis The user-property computation to run, such as distribution (value distribution), a count, or an aggregation.
"distribution"
The user attributes to analyze. Include 1 to 5 properties. When more than one is provided, results are cross-tabulated across them.
1 - 5 elementsSegments 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.
5Payload schema version.
"2.0"
Distribution configuration. Custom distributions apply to numerical attributes only. Use type: auto for automatic bucketing.
The time window the analysis runs over.
Time bucket for the series — h (hour), d (day), w (week), m (month), or e (entire range).
h, d, w, m, e "e"
Visual representation of the result, such as column.
"column"
Whether metrics are returned as absolute counts or percentages, such as number.
"number"
Attributes to break the result down by. Include up to 10.
10Sort 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.