Skip to main content
POST

Rate Limit

The rate limits are at the workspace level. A maximum of 5 requests per second, 10 requests per minute, and 50 requests per hour are allowed per workspace.

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). 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

application/json

Request body for registering a Retention analysis query.

version
string
required

Payload schema version.

Example:

"2.0"

type
enum<string>
required

The analysis type. Must be retention for this endpoint.

Available options:
retention
events
object[]
required

Exactly two events: the first event that places a user into a cohort, and the return event measured in later periods.

Required array length: 2 elements
segmentation
object[]
required

Segments to scope the analysis (up to 5). Segmentation and comparison_timerange are mutually exclusive — do not send 2 or more segments together with a time comparison.

Maximum array length: 5
timerange
object
required

The time window the analysis runs over.

granularity
enum<string>
required

Cohort period — h (hour), d (day), w (week), m (month), or e (entire range). Hourly is limited to a 24-hour window, daily to 90 days, and weekly to 180 days.

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

"d"

chart_type
enum<string>
required

Visual representation of the result.

Available options:
line,
area,
bar,
column,
euler,
pie
Example:

"line"

retention_type
enum<string>
required

The retention model to apply — every for N-Day retention (users who returned in that specific period), last for Unbounded retention (users who returned in that period or any later one), or first for First Occurrence retention (users whose first return fell in that period).

Available options:
every,
last,
first
split_by
object[]
required

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

Maximum array length: 10
Example:
comparison_timerange
object
required

A second time range to compare against. Mutually exclusive with sending 2 or more segments. Pass an empty object for no comparison.

Example:

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