> ## Documentation Index
> Fetch the complete documentation index at: https://test-8ad8522e-feat-ai-sre.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Query RUM data

> Run one or more SQL-style RUM data queries over a bounded time range.

## Restrictions

| Aspect      | Value                                                         |
| ----------- | ------------------------------------------------------------- |
| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |
| Permissions | None — any valid `app_key` can call this operation            |

## Usage

* Send 1 to 10 queries in one request; each query `id` becomes a key in the response object.
* `start_time` and `end_time` are required Unix epoch milliseconds. The maximum time range is 31 days.
* Use `format: table` for tabular results, or `format: time_series` for bucketed time-series results.
* For `time_series`, `interval` defaults to 3600 seconds and `max_points` defaults to 1226 when omitted.
* `search_after_ctx` is returned by paginated table queries and can be sent back to continue scanning.


## OpenAPI

````yaml /api-reference/rum.openapi.en.json post /rum/data/query
openapi: 3.1.0
info:
  description: >-
    Public HTTP API for the Flashduty incident management platform — incidents,
    notification templates, channels, schedules, monitors, RUM, and platform
    administration. Every operation is authenticated with an `app_key` query
    parameter issued from the Flashduty console under Account → APP Keys.
    Responses follow a uniform envelope: `{ request_id, data }` on success, `{
    request_id, error }` on failure.
  title: Flashduty Open API
  version: 1.0.0
servers:
  - description: Flashduty Open API
    url: https://api.flashcat.cloud
security:
  - AppKeyAuth: []
tags:
  - description: Manage Real User Monitoring (RUM) applications.
    name: RUM/Applications
  - description: Run RUM analytics queries over event data.
    name: RUM/Data query
  - description: Query and manage RUM error tracking issues and preset severity rules.
    name: RUM/Issues
  - description: >-
      Query RUM facet fields and their value distributions for building
      analytics filters.
    name: RUM/Facets
  - description: >-
      Manage and query RUM sourcemap files for browser, Android, and iOS error
      symbolication.
    name: RUM/Sourcemaps
  - description: Retrieve session replay metadata and recorded segments for RUM sessions.
    name: RUM/Session replay
  - description: >-
      Configure and inspect the rules that decide which RUM errors get ingested
      and stored for an application, including their edit history.
    name: RUM/Error ingestion rules
  - description: >-
      Manage per-application rules that assign a severity to matching front-end
      errors, plus their evaluation order and change history.
    name: RUM/Issue preset severity rules
  - description: Query the RUM resource record and current usage for the account.
    name: RUM/Resources
paths:
  /rum/data/query:
    post:
      tags:
        - RUM/Data query
      summary: Query RUM data
      description: Run one or more SQL-style RUM data queries over a bounded time range.
      operationId: rum-read-data-query
      requestBody:
        content:
          application/json:
            example:
              end_time: 1712707200000
              queries:
                - format: table
                  id: errors_by_type
                  sql: >-
                    SELECT error.type, count(*) AS errors FROM error GROUP BY
                    error.type ORDER BY errors DESC LIMIT 10
                  time_zone: Asia/Shanghai
              start_time: 1712620800000
            schema:
              $ref: '#/components/schemas/RumDataQueryRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              example:
                data:
                  errors_by_type:
                    data:
                      fields:
                        - name: error.type
                          nullable: false
                          type: String
                        - name: errors
                          nullable: false
                          type: UInt64
                      values:
                        - - TypeError
                          - 1523
                        - - ReferenceError
                          - 342
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessEnvelope'
                  - properties:
                      data:
                        $ref: '#/components/schemas/RumDataQueryResponse'
                    type: object
          description: Success
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    RumDataQueryRequest:
      description: Batch of RUM data queries over a bounded time range.
      properties:
        end_time:
          description: >-
            End of the query window, Unix epoch milliseconds. Maximum 31-day
            span.
          example: 1712707200000
          format: int64
          type: integer
        queries:
          description: Queries to execute concurrently. 1 to 10 queries are allowed.
          items:
            $ref: '#/components/schemas/RumDataQueryDefinition'
          maxItems: 10
          minItems: 1
          type: array
        start_time:
          description: Start of the query window, Unix epoch milliseconds.
          example: 1712620800000
          format: int64
          type: integer
      required:
        - start_time
        - end_time
        - queries
      type: object
    SuccessEnvelope:
      description: >-
        Success response envelope. On every 2xx response, `request_id`
        identifies the call (also mirrored in the `Flashcat-Request-Id` header)
        and `data` holds the endpoint-specific payload. Failure responses use a
        different shape — see `ErrorResponse`.
      properties:
        data:
          description: Endpoint-specific payload. See each operation's 200 response schema.
        request_id:
          description: >-
            Unique ID for this request. Mirrored in the Flashcat-Request-Id
            response header. Include it when reporting issues.
          example: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
          type: string
      required:
        - request_id
        - data
      type: object
    RumDataQueryResponse:
      additionalProperties:
        $ref: '#/components/schemas/RumDataQueryOutput'
      description: Map from request query ID to that query's result or error.
      type: object
    RumDataQueryDefinition:
      description: One RUM data query definition.
      properties:
        disable_sampling:
          description: When true, asks the query engine to avoid sampling when possible.
          type: boolean
        dql:
          description: >-
            Optional RUM DQL filter expression used together with SQL
            validation.
          type: string
        format:
          description: >-
            Output format. `table` returns rows; `time_series` returns bucketed
            time-series rows.
          enum:
            - time_series
            - table
          type: string
        id:
          description: >-
            Client-supplied query ID. The same value is used as the key in the
            response object.
          maxLength: 64
          type: string
        interval:
          default: 3600
          description: Time bucket interval in seconds for `time_series` queries.
          exclusiveMinimum: 0
          format: int64
          type: integer
        max_points:
          default: 1226
          description: Maximum number of points for `time_series` queries.
          exclusiveMinimum: 0
          format: int64
          type: integer
        search_after_ctx:
          description: >-
            Opaque cursor returned by a previous table query for continuing
            pagination.
          type: string
        sql:
          description: RUM SQL query to execute.
          type: string
        time_zone:
          description: >-
            IANA time zone name used when evaluating time functions, such as
            `Asia/Shanghai`.
          type: string
      required:
        - id
        - sql
        - format
      type: object
    RumDataQueryOutput:
      description: >-
        Result for one query. Failed subqueries populate `error`; successful
        ones populate `data`.
      properties:
        data:
          $ref: '#/components/schemas/RumDataQueryResult'
          description: Query result. Omitted when the query failed.
        error:
          $ref: '#/components/schemas/DutyError'
          description: Subquery failure details. Omitted when the query succeeded.
      type: object
    ErrorResponse:
      description: Response envelope for errors. `error` is required; `data` is absent.
      properties:
        error:
          $ref: '#/components/schemas/DutyError'
        request_id:
          description: >-
            Unique trace ID of this request; include it when reporting issues so
            logs can be located.
          example: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
          type: string
      required:
        - request_id
        - error
      type: object
    RumDataQueryResult:
      description: Rows and metadata returned by one RUM data query.
      properties:
        fields:
          description: Column metadata for the values matrix.
          items:
            $ref: '#/components/schemas/RumDataFieldMeta'
          type: array
        interval:
          description: >-
            Effective time bucket interval in seconds. Omitted for
            `table`-format queries.
          format: int64
          type: integer
        sampling:
          $ref: '#/components/schemas/RumDataSamplingDecision'
          description: Sampling metadata. Omitted when the query did not use sampling.
        search_after_ctx:
          description: >-
            Opaque cursor for continuing paginated table queries. Omitted when
            the query is not a cursor-paginated table query or no further pages
            exist.
          type: string
        values:
          description: Rows returned by the query. Each row aligns with `fields` by index.
          items:
            items: {}
            type: array
          type: array
      required:
        - fields
        - values
      type: object
    DutyError:
      description: >-
        Error payload inside the response envelope. Present only on non-2xx
        responses.
      properties:
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          description: >-
            Human-readable error message, localized by the caller's
            Accept-Language. May contain field names, IDs, or other context from
            the failing request.
          example: The specified parameter template_id is not valid.
          type: string
      required:
        - code
        - message
      type: object
    RumDataFieldMeta:
      description: Metadata for one returned column.
      properties:
        name:
          description: Column name.
          type: string
        nullable:
          description: Whether values in this column may be null.
          type: boolean
        type:
          description: Backend database type name for this column.
          type: string
      required:
        - name
        - type
        - nullable
      type: object
    RumDataSamplingDecision:
      description: Sampling metadata returned when the query engine used sampled data.
      properties:
        enabled:
          description: >-
            Whether sampling was applied. Always `true` here — the `sampling`
            object is omitted entirely when sampling was not used.
          type: boolean
        scale_factor:
          description: >-
            Multiplier used to scale sampled counts back to estimated full
            counts.
          type: number
      required:
        - enabled
        - scale_factor
      type: object
    ErrorCode:
      description: >-
        Flashduty error code enum. Every failed API response sets `error.code`
        to one of these stable wire strings. HTTP status is informational — the
        authoritative signal is the enum value.


        | Code | HTTP | Meaning |

        |---|---|---|

        | `OK` | 200 | Reserved — not returned on real errors. |

        | `InvalidParameter` | 400 | A required parameter is missing or failed
        validation. |

        | `BadRequest` | 400 | Generic 400 used when no more specific code fits.
        |

        | `InvalidContentType` | 400 | The `Content-Type` header is not
        `application/json`. |

        | `ResourceNotFound` | 400 | The referenced resource does not exist.
        Note: returned as HTTP 400, not 404 (historical choice). |

        | `NoLicense` | 400 | The feature is license-gated and no active license
        was found. |

        | `ReferenceExist` | 400 | Deletion blocked — other entities still
        reference this resource. |

        | `Unauthorized` | 401 | `app_key` is missing, invalid, or expired. |

        | `BalanceNotEnough` | 402 | Billing-gated operation with insufficient
        account balance. |

        | `AccessDenied` | 403 | Authenticated but lacking the permission
        required for this operation. |

        | `RouteNotFound` | 404 | The request URL path is not a known route. |

        | `MethodNotAllowed` | 405 | The HTTP method is not allowed on this
        otherwise-known path. |

        | `UndonedOrderExist` | 409 | An outstanding billing order blocks this
        new one. Wait and retry. |

        | `RequestLocked` | 423 | Operation temporarily locked due to repeated
        failures. |

        | `EntityTooLarge` | 413 | Request body exceeds the configured max size.
        |

        | `RequestTooFrequently` | 429 | Rate limit hit — API-global,
        per-account, or per-integration. |

        | `RequestVerifyRequired` | 428 | Second-factor verification required
        but not supplied. |

        | `DangerousOperation` | 428 | High-risk operation requires MFA
        verification. |

        | `InternalError` | 500 | Unhandled server-side error. Include
        `request_id` in the bug report. |

        | `ServiceUnavailable` | 503 | A backend dependency is unavailable. Try
        again later. |
      enum:
        - OK
        - InvalidParameter
        - BadRequest
        - InvalidContentType
        - ResourceNotFound
        - NoLicense
        - ReferenceExist
        - Unauthorized
        - BalanceNotEnough
        - AccessDenied
        - RouteNotFound
        - MethodNotAllowed
        - UndonedOrderExist
        - RequestLocked
        - EntityTooLarge
        - RequestTooFrequently
        - RequestVerifyRequired
        - DangerousOperation
        - InternalError
        - ServiceUnavailable
      example: InvalidParameter
      type: string
      x-enumDescriptions:
        AccessDenied: Authenticated but lacking the permission required for this operation.
        BadRequest: Generic 400 used when no more specific code fits.
        BalanceNotEnough: Billing-gated operation with insufficient account balance.
        DangerousOperation: High-risk operation requires MFA verification.
        EntityTooLarge: Request body exceeds the configured max size.
        InternalError: Unhandled server-side error. Include `request_id` in the bug report.
        InvalidContentType: The `Content-Type` header is not `application/json`.
        InvalidParameter: A required parameter is missing or failed validation.
        MethodNotAllowed: The HTTP method is not allowed on this otherwise-known path.
        NoLicense: The feature is license-gated and no active license was found.
        OK: Reserved — not returned on real errors.
        ReferenceExist: Deletion blocked — other entities still reference this resource.
        RequestLocked: Operation temporarily locked due to repeated failures.
        RequestTooFrequently: Rate limit hit — API-global, per-account, or per-integration.
        RequestVerifyRequired: Second-factor verification required but not supplied.
        ResourceNotFound: >-
          The referenced resource does not exist. Note: returned as HTTP 400,
          not 404 (historical choice).
        RouteNotFound: The request URL path is not a known route.
        ServiceUnavailable: A backend dependency is unavailable. Try again later.
        Unauthorized: '`app_key` is missing, invalid, or expired.'
        UndonedOrderExist: An outstanding billing order blocks this new one. Wait and retry.
  responses:
    BadRequest:
      content:
        application/json:
          examples:
            missingParameter:
              value:
                error:
                  code: InvalidParameter
                  message: The specified parameter is not valid.
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
          schema:
            $ref: '#/components/schemas/ErrorResponse'
      description: Invalid request — usually a missing or malformed parameter.
    Unauthorized:
      content:
        application/json:
          examples:
            missingAppKey:
              value:
                error:
                  code: Unauthorized
                  message: You are unauthorized.
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
          schema:
            $ref: '#/components/schemas/ErrorResponse'
      description: Missing or invalid app_key.
    TooManyRequests:
      content:
        application/json:
          examples:
            rateLimited:
              value:
                error:
                  code: RequestTooFrequently
                  message: Request too frequently.
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
          schema:
            $ref: '#/components/schemas/ErrorResponse'
      description: >-
        Rate limit hit. Either the global API limit, a per-account limit, or a
        per-integration limit.
    ServerError:
      content:
        application/json:
          examples:
            internal:
              value:
                error:
                  code: InternalError
                  message: >-
                    We encountered an internal error, and it has been reported.
                    Please try again later.
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
          schema:
            $ref: '#/components/schemas/ErrorResponse'
      description: Unexpected server-side error. Include the request_id when reporting.
  securitySchemes:
    AppKeyAuth:
      description: >-
        App key issued from the Flashduty console under Account → APP Keys.
        Required on every public API call. Keep it secret — it grants the same
        access as the owning account.
      in: query
      name: app_key
      type: apiKey

````