Skip to main content
POST
Register a User Analysis Query

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 Data API Key, which you can find in the MoEngage dashboard at Settings > Account > APIs.

For more information, see Authentication.

Body

application/json

Request body for registering a User Property Analysis (UPA) query.

type
enum<string>
required

The analysis type. Must be user_analysis for this endpoint.

Available options:
user_analysis
analysis_type
string
required

The user-property computation to run, such as distribution (value distribution), a count, or an aggregation.

Example:

"distribution"

user_properties
object[]
required

The user attributes to analyze. Include 1 to 5 properties. When more than one is provided, results are cross-tabulated across them.

Required array length: 1 - 5 elements
segmentation
object[]
required

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.

Maximum array length: 5
version
string

Payload schema version.

Example:

"2.0"

distribution
object

Distribution configuration. Custom distributions apply to numerical attributes only. Use type: auto for automatic bucketing.

timerange
object

The time window the analysis runs over.

granularity
enum<string>

Time bucket for the series — h (hour), d (day), w (week), m (month), or e (entire range).

Available options:
h,
d,
w,
m,
e
Example:

"e"

chart_type
string

Visual representation of the result, such as column.

Example:

"column"

count_type
string

Whether metrics are returned as absolute counts or percentages, such as number.

Example:

"number"

split_by
object[]

Attributes to break the result down by. Include up to 10.

Maximum array length: 10
chart_sort_type
enum<string>

Sort order applied to the result series.

Available options:
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.

response_id
string

A unique identifier for the response, useful for correlating logs and support requests.

Example:

"fc803857-632e-4bf0-8df1-fbc2bdeedb66"

type
string

The analysis type echoed back for the registered query.

data
object