> ## Documentation Index
> Fetch the complete documentation index at: https://moengage-analytics-query-api-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Analytics Query APIs Overview

> Run MoEngage Analytics queries — Behavior, Funnels, Retention, Session/Source, and User Property Analysis — and fetch their results programmatically.

The Analytics Query APIs let you run MoEngage's analysis queries programmatically and retrieve their results. They cover the same analyses available in the MoEngage dashboard: Behavior, Funnels, Retention, Session/Source (BFRS), and User Property Analysis (UPA).

These queries are asynchronous. A `POST` registers the query and returns a `request_id` immediately; the query runs in the background; you then poll for status and fetch the results.

## Endpoints

The Analytics Query APIs include the following endpoints:

* [Register a Behavior Query](/api/analytics-queries/register-a-behavior-query): Run a Behavior analysis.
* [Register a Funnels Query](/api/analytics-queries/register-a-funnels-query): Run a Funnels analysis.
* [Register a Retention Query](/api/analytics-queries/register-a-retention-query): Run a Retention analysis.
* [Register a Session-Source Query](/api/analytics-queries/register-a-session-source-query): Run a Session/Source analysis.
* [Register a User Analysis Query](/api/analytics-queries/register-a-user-analysis-query): Run a User Property Analysis.
* [Get Query Status](/api/analytics-queries/get-query-status): Check the execution status of a registered query.
* [Get Query Results](/api/analytics-queries/get-query-results): Fetch the resolved results of a completed query.

## Typical Workflow

Each analysis follows the same submit → poll → fetch sequence:

1. **Submit** the query by calling one of the analysis endpoints (for example, [Register a Behavior Query](/api/analytics-queries/register-a-behavior-query)). The response echoes the analysis `type` and returns a `request_id`.
2. **Poll** [Get Query Status](/api/analytics-queries/get-query-status) with that `request_id` until `status` is `SUCCESSFUL` (or `FAILED`).
3. **Fetch** [Get Query Results](/api/analytics-queries/get-query-results) with the same `request_id` to retrieve the results. The shape of the `data` array depends on the analysis type.

## Authentication

These endpoints use the same HTTP Basic authentication as MoEngage's other v5 APIs: your MoEngage App ID as the username and your DATA API key as the password. Refer to [API keys](/api/introduction#authentication) for details.

## Postman Collection
