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.

承認

Authorization
string
header
必須

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.

ボディ

application/json

Request body for registering a Retention analysis query.

version
string
必須

Payload schema version.

例:

"2.0"

type
enum<string>
必須

The analysis type. Must be retention for this endpoint.

利用可能なオプション:
retention
events
object[]
必須

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[]
必須

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
必須

The time window the analysis runs over.

granularity
enum<string>
必須

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.

利用可能なオプション:
h,
d,
w,
m,
e
例:

"d"

chart_type
enum<string>
必須

Visual representation of the result.

利用可能なオプション:
line,
area,
bar,
column,
euler,
pie
例:

"line"

retention_type
enum<string>
必須

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

利用可能なオプション:
every,
last,
first
split_by
object[]
必須

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

Maximum array length: 10
例:
comparison_timerange
object
必須

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

例:

レスポンス

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.

例:

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

type
string

The analysis type echoed back for the registered query.

data
object