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

# Get Query Results

> Returns the resolved results of a completed query. The shape of the `data` array
varies per analysis type (behavior, funnels, retention, session-source, user-analysis).

The example below is a Session/Source (`session_count`) result.




## OpenAPI

````yaml /api/analytics-query/analytics-query.yaml get /v5/analytics/query/{request_id}/results
openapi: 3.0.3
info:
  title: MoEngage Analytics Query API
  version: '5.0'
  description: >
    Asynchronous REST APIs to run MoEngage Analytics queries — Behavior,
    Funnels, Retention,

    Session/Source (BFRS) and User Property Analysis (UPA) — and retrieve their
    results.


    These queries are asynchronous. A `POST` registers the query and immediately
    returns a

    `request_id`; a worker executes the query; you then poll the status and
    fetch the results:


    1. **Submit** — `POST` one of the analysis endpoints. The response echoes
    the analysis `type` and returns a `request_id`.

    2. **Poll** — `GET /v5/analytics/query/{request_id}/status` until `status`
    is `SUCCESSFUL` (or `FAILED`).

    3. **Fetch** — `GET /v5/analytics/query/{request_id}/results` to retrieve
    the resolved series.
servers:
  - url: https://api-{dc}.moengage.com
    description: MoEngage API Server
    variables:
      dc:
        default: '01'
        description: >-
          The 'dc' in the API Endpoint URL refers to the MoEngage Data Center
          (DC). MoEngage hosts each customer in a different DC. You can find
          your DC number and replace the value of 'dc' in the URL by referring
          to the DC and API endpoint mapping
          [here](/api/introduction#data-centers). Your MoEngage Data Center (DC)
          can be 01, 02, 03, 04, 05, 06, or 101.
security:
  - basicAuth: []
tags:
  - name: Analytics Queries
    description: >-
      Register asynchronous BFRS and UPA analytics queries, then poll status and
      fetch results.
paths:
  /v5/analytics/query/{request_id}/results:
    get:
      tags:
        - Analytics Queries
      summary: Get Query Results
      description: >
        Returns the resolved results of a completed query. The shape of the
        `data` array

        varies per analysis type (behavior, funnels, retention, session-source,
        user-analysis).


        The example below is a Session/Source (`session_count`) result.
      operationId: getQueryResults
      parameters:
        - name: request_id
          in: path
          required: true
          description: The `request_id` returned when the query was registered.
          schema:
            type: string
            example: 6a56220b9f22da29f1ec05ef
      responses:
        '200':
          description: Resolved query results.
          content:
            application/json:
              example:
                response_id: 92aace7b-404a-4e61-9035-2f88dec6ec73
                type: query_result
                data:
                  - analysis_type: session_count
                    splitby: []
                    granularity: 2026/07/14
                    metric: 15
                    fseq: 0
                    event_name: MOE_SESSION
                    tseq: 0
                    cseq: 0
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  responses:
    Unauthorized:
      description: Missing or invalid credentials.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: UNAUTHORIZED
              message: Authentication required.
              doc_url: /api/analytics-query/analytics-query-overview
            response_id: a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d
    NotFound:
      description: The query `request_id` does not exist, or is not in this workspace.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: NOT_FOUND
              message: The query request you are looking for does not exist.
              doc_url: /api/analytics-query/analytics-query-overview
            response_id: 0998efae-b324-4559-afb0-756961d2e11a
    InternalError:
      description: An unexpected server error occurred.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: INTERNAL_ERROR
              message: An unexpected error occurred while processing the request.
              doc_url: /api/analytics-query/analytics-query-overview
            response_id: dcc4fd00-2980-41a5-94b3-ad4844ae3d72
  schemas:
    ErrorResponse:
      type: object
      required:
        - error
        - response_id
      description: Standard MoEngage error envelope.
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: A machine-readable error code.
              enum:
                - VALIDATION_FAILED
                - BAD_REQUEST
                - UNAUTHORIZED
                - FORBIDDEN
                - NOT_FOUND
                - QUOTA_EXCEEDED
                - INTERNAL_ERROR
            message:
              type: string
              description: A human-readable description of the error.
            doc_url:
              type: string
              description: A link to documentation about this error, when available.
        response_id:
          $ref: '#/components/schemas/ResponseId'
    ResponseId:
      type: string
      description: >-
        A unique identifier for the response, useful for correlating logs and
        support requests.
      example: fc803857-632e-4bf0-8df1-fbc2bdeedb66
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: >
        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](/api/introduction#authentication).

````