> ## Documentation Index
> Fetch the complete documentation index at: https://beta.docs.replo.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Run a read-only analytics query for a project



## OpenAPI

````yaml /api-reference/openapi.json post /analytics/query
openapi: 3.1.0
info:
  title: Replo Public API
  version: '2026-07-11'
servers:
  - url: https://public-api.replo.app/api/v1/public
security: []
paths:
  /analytics/query:
    post:
      tags:
        - Analytics
      summary: Run a read-only analytics query for a project
      operationId: analytics.query
      parameters:
        - name: Replo-Api-Version
          in: header
          required: true
          schema:
            type: string
            enum:
              - '2026-07-11'
          description: The public API version to use for this request.
        - schema:
            type: string
            format: uuid
          required: true
          name: projectId
          in: query
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                query:
                  type: string
                  minLength: 1
                  description: >-
                    Run a read-only analytics query for a project.


                    Rules:

                    - Use SELECT or WITH queries only.

                    - Do not add project or namespace filters; project scoping
                    is enforced server-side.

                    - Prefer daily rollup tables for date-range summaries and
                    use events_computed for ad-hoc session-level questions.

                    - Maximum execution time: 60 seconds.

                    - Maximum result rows: 100000.


                    Queryable tables:

                    Session-level computed analytics. Primary table for ad-hoc
                    queries. Project scoped: yes.

                    ```sql

                    events_computed (
                      subject UUID,
                      date DateTime64(3),
                      name LowCardinality(String),
                      path String,
                      domain String,
                      currencyCode String,
                      subjectPurchaseSum Float64,
                      subjectPurchaseCount Float64,
                      subjectPurchaseFraction Float64,
                      subjectPurchaseFractionalSum Float64,
                      title String
                    )

                    ```


                    Currency exchange rates for multi-currency reporting.
                    Project scoped: no.

                    ```sql

                    currency_exchange_rates (
                      date Date,
                      code String,
                      rate Float32
                    )

                    ```


                    Pre-aggregated daily page metrics by day, domain, path, and
                    UTM source. Project scoped: yes.

                    ```sql

                    daily_page_rollups (
                      day Date,
                      domain String,
                      path String,
                      utm_source String,
                      views_state AggregateFunction(count),
                      unique_sessions_state AggregateFunction(uniq, UUID),
                      converting_sessions_state AggregateFunction(uniq, UUID),
                      fractional_conversions_state AggregateFunction(sum, Float64),
                      fractional_revenue_usd_state AggregateFunction(sum, Float64),
                      session_conversions_state AggregateFunction(sum, UInt64),
                      session_revenue_usd_state AggregateFunction(sum, Float64)
                    )

                    ```


                    Pre-aggregated daily project traffic metrics by day and UTM
                    source. Project scoped: yes.

                    ```sql

                    daily_namespace_rollups (
                      day Date,
                      utm_source String,
                      views_state AggregateFunction(count),
                      unique_sessions_state AggregateFunction(uniq, UUID),
                      converting_sessions_state AggregateFunction(uniq, UUID)
                    )

                    ```


                    Pre-aggregated daily purchase metrics by day and UTM source.
                    Project scoped: yes.

                    ```sql

                    daily_namespace_purchase_rollups (
                      day Date,
                      utm_source String,
                      purchase_count_state AggregateFunction(count),
                      total_revenue_usd_state AggregateFunction(sum, Float64),
                      unique_purchasing_sessions_state AggregateFunction(uniq, UUID)
                    )

                    ```
              required:
                - query
              additionalProperties: false
      responses:
        '200':
          description: Run a read-only analytics query for a project
          content:
            application/json:
              schema:
                type: object
                properties:
                  rowCount:
                    type: integer
                  data:
                    type: array
                    items:
                      type: object
                      additionalProperties: {}
                required:
                  - rowCount
                  - data
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
        '401':
          description: Missing or invalid Replo Public API token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
        '403':
          description: You are not authorized to access this resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
        '429':
          description: >-
            Too many requests. Please retry after the time indicated by the
            Retry-After header.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
        '500':
          description: An internal error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
        '503':
          description: Service temporarily unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
      security:
        - bearerAuth: []
components:
  schemas:
    PublicApiError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            doc_url:
              type: string
          required:
            - code
            - message
            - doc_url
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````