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

# 查看 RUM 资源信息

> 返回账户的 RUM 资源记录及当前会话用量。

## 限制说明

| 项目   | 说明                             |
| ---- | ------------------------------ |
| 速率限制 | 每个账户 **1,000 次/分钟**；**50 次/秒** |
| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用      |

## 使用说明

* 账户尚未开通 RUM 资源，或资源状态为 `deleted`/`destroyed` 时，返回 `ResourceNotFound`。
* `no_cache=true` 跳过的是资源记录本身（套餐版本、配额、状态）的短时缓存；`used_cnt` 系列用量来自另一份小时级缓存，不受该参数影响，无论是否传该参数都可能有延迟。
* 已用量字段反映当前 30 天计费窗口（`window_start_time` 至 `window_end_time`）内的用量，而非历史累计总量。
* `expired_at` 仅私有化部署会返回，取自 License 到期时间；SaaS 账户该字段不会出现在响应中。
* 对于 `version=free` 的账户，用量超过所有应用的免费额度合计（单应用免费额度 × 应用数）时 `session_limit_reached` 为 `true`；账户尚无任何应用时始终为 `false`。


## OpenAPI

````yaml /api-reference/rum.openapi.zh.json post /rum/resource/info
openapi: 3.1.0
info:
  title: Flashduty 开放 API
  description: >-
    Flashduty 事件管理平台的公开 HTTP API —— 覆盖故障、通知模板、协作空间、值班排班、监控、RUM、以及平台管理。每次调用都需在
    query 中携带 `app_key`，该 key 在 Flashduty 控制台 账户 → APP Key 中签发。所有响应使用统一结构：成功时为
    `{ request_id, data }`，失败时为 `{ request_id, error }`。
  version: 1.0.0
servers:
  - url: https://api.flashcat.cloud
    description: Flashduty Open API
security:
  - AppKeyAuth: []
tags:
  - name: RUM/应用管理
    description: 管理前端性能监控（RUM）应用。
  - name: RUM/RUM 数据查询
    description: 对 RUM 事件数据执行分析查询。
  - name: RUM/RUM 问题跟踪
    description: 查询和管理 RUM 异常追踪 Issue 及预设严重性规则。
  - name: RUM/RUM 自定义字段
    description: 查询 RUM 自定义字段及其值分布，用于构建分析过滤条件。
  - name: RUM/RUM Sourcemap
    description: 管理和查询用于 Browser、Android、iOS 错误符号化的 RUM Sourcemap 文件。
  - name: RUM/Session replay
    description: 查询 RUM 会话的回放元数据与录制分段。
  - name: RUM/错误采集规则
    description: 配置和查看决定 RUM 应用采集哪些错误的规则，并可查看其编辑历史。
  - name: RUM/Issue 预设严重性规则
    description: 管理按应用配置的预设严重性规则，用于为匹配的前端错误指定严重级别，并管理其评估顺序与变更历史。
  - name: RUM/资源
    description: 查询账户的 RUM 资源记录及当前用量。
paths:
  /rum/resource/info:
    post:
      tags:
        - RUM/资源
      summary: 查看 RUM 资源信息
      description: 返回账户的 RUM 资源记录及当前会话用量。
      operationId: rum-resource-read-info
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RumResourceInfoRequest'
            example:
              no_cache: false
      responses:
        '200':
          description: 成功
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessEnvelope'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/RumResourceItem'
              example:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                data:
                  account_id: 2451002751131
                  product: rum
                  resource_id: rum_2451002751131
                  resource_name: rum_2451002751131
                  order_id: fd_order_20250615_8f3a1c2b
                  version: professional
                  offering_id: 11
                  session_measure.used_cnt: 128400
                  session_investigate.used_cnt: 5230
                  session_replay.used_cnt: 812
                  session_measure.free_cnt: 0
                  session_investigate.free_cnt: 0
                  session_replay.free_cnt: 0
                  session.days: 30
                  view.days: 30
                  error.days: 30
                  action.days: 30
                  resource.days: 15
                  long_task.days: 15
                  status: enabled
                  created_at: 1750000000
                  updated_at: 1752000000
                  window_start_time: 1750000000
                  window_end_time: 1752592000
                  session_limit_reached: false
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    RumResourceInfoRequest:
      type: object
      description: 查询账户 RUM 资源记录的参数。
      properties:
        no_cache:
          type: boolean
          description: 跳过资源记录（套餐版本、配额、状态）的短时缓存，从源头读取；不会刷新已用量数据。默认 `false`。
          default: false
    SuccessEnvelope:
      type: object
      description: >-
        成功响应结构。2xx 响应中 `request_id` 标识本次调用（同时出现在 `Flashcat-Request-Id`
        响应头中），`data` 为接口业务 payload。失败响应使用不同结构，参见 `ErrorResponse`。
      properties:
        request_id:
          type: string
          description: 本次请求的唯一 ID，也会在 Flashcat-Request-Id 响应头中返回。反馈问题时请一并附上。
          example: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
        data:
          description: 每个接口自己的业务 payload，详见各接口的 200 响应 schema。
      required:
        - request_id
        - data
    RumResourceItem:
      type: object
      description: 账户的 RUM 资源记录，包含计费窗口及当前会话用量。
      required:
        - account_id
        - product
        - resource_id
        - resource_name
        - order_id
        - version
        - offering_id
        - session_measure.used_cnt
        - session_investigate.used_cnt
        - session_replay.used_cnt
        - session_measure.free_cnt
        - session_investigate.free_cnt
        - session_replay.free_cnt
        - session.days
        - view.days
        - error.days
        - action.days
        - resource.days
        - long_task.days
        - status
        - created_at
        - updated_at
        - window_start_time
        - window_end_time
        - session_limit_reached
      properties:
        account_id:
          type: integer
          format: int64
          description: 该资源所属的账户 ID。
        product:
          type: string
          enum:
            - rum
          description: 该资源的产品代码，本接口下恒为 `rum`。
        resource_id:
          type: string
          description: 账户 RUM 资源的唯一标识。
        resource_name:
          type: string
          description: 资源的展示名称。
        order_id:
          type: string
          description: 开通该资源所对应的订单 ID；通过订单流程之外方式开通的资源（如私有化部署）该字段为空。
        version:
          type: string
          enum:
            - free
            - professional
          description: 该资源的套餐版本。取值：`free`（免费版）、`professional`（专业版）。
        offering_id:
          type: integer
          format: int64
          description: 开通该资源所对应的商品（SKU）ID。
        session_measure.used_cnt:
          type: integer
          format: int64
          description: 当前计费窗口内已使用的性能监控（measure）会话数。
        session_investigate.used_cnt:
          type: integer
          format: int64
          description: 当前计费窗口内已使用的异常追踪（investigate）会话数。
        session_replay.used_cnt:
          type: integer
          format: int64
          description: 当前计费窗口内已使用的会话重放（replay）会话数。
        session_measure.free_cnt:
          type: integer
          format: int64
          description: 每个应用、每个计费窗口的性能监控会话免费额度。
        session_investigate.free_cnt:
          type: integer
          format: int64
          description: 每个应用、每个计费窗口的异常追踪会话免费额度。
        session_replay.free_cnt:
          type: integer
          format: int64
          description: 每个应用、每个计费窗口的会话重放免费额度。
        session.days:
          type: integer
          format: int64
          description: 会话数据的保留天数。
        view.days:
          type: integer
          format: int64
          description: 页面/屏幕（view）数据的保留天数。
        error.days:
          type: integer
          format: int64
          description: 异常（error）数据的保留天数。
        action.days:
          type: integer
          format: int64
          description: 用户交互（action）数据的保留天数。
        resource.days:
          type: integer
          format: int64
          description: 网络请求（resource）数据的保留天数。
        long_task.days:
          type: integer
          format: int64
          description: 长任务（long task）数据的保留天数。
        status:
          type: string
          enum:
            - enabled
            - disabled
          description: >-
            资源状态。状态为 `deleted` 或 `destroyed` 的资源不会出现在该字段——接口会直接返回
            `ResourceNotFound`。
        created_at:
          type: integer
          format: int64
          description: 资源创建时间，Unix 秒级时间戳；同时也是首个计费窗口的起点。
        updated_at:
          type: integer
          format: int64
          description: 资源最近更新时间，Unix 秒级时间戳。
        window_start_time:
          type: integer
          format: int64
          description: 当前 30 天计费窗口起始时间，Unix 秒级时间戳。
        window_end_time:
          type: integer
          format: int64
          description: 当前 30 天计费窗口结束时间，Unix 秒级时间戳。
        session_limit_reached:
          type: boolean
          description: '`version=free` 的账户在所有应用的免费会话额度合计用尽后为 `true`；非免费套餐恒为 `false`。'
        expired_at:
          type: integer
          format: int64
          description: 私有化部署 License 到期时间，Unix 秒级时间戳。仅私有化部署会返回该字段，SaaS 账户不会出现该字段。
    ErrorResponse:
      type: object
      description: 错误响应结构。`error` 必填，`data` 不存在。
      properties:
        request_id:
          type: string
          example: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
          description: 本次请求的唯一追踪 ID（trace ID），反馈问题时请提供该值以便检索日志。
        error:
          $ref: '#/components/schemas/DutyError'
      required:
        - request_id
        - error
    DutyError:
      type: object
      description: 响应结构中的错误 payload，仅在非 2xx 响应时出现。
      properties:
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
          description: 用户可读的错误描述，语言会跟随调用方的 Accept-Language。可能包含字段名、ID 等请求上下文。
          example: The specified parameter template_id is not valid.
      required:
        - code
        - message
    ErrorCode:
      type: string
      description: >-
        Flashduty 错误码枚举。每个失败响应的 `error.code` 都是下列稳定值之一，HTTP 状态码仅作参考。


        | 错误码 | HTTP | 含义 |

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

        | `OK` | 200 | 保留值，正常错误响应不会返回。 |

        | `InvalidParameter` | 400 | 必填参数缺失或未通过校验。 |

        | `BadRequest` | 400 | 通用的 400 错误，通常是请求本身不合法。 |

        | `InvalidContentType` | 400 | 请求头 `Content-Type` 不是 `application/json`。
        |

        | `ResourceNotFound` | 400 | 目标资源不存在。注意 HTTP 状态码是 400 而非 404（历史设计）。 |

        | `NoLicense` | 400 | 功能需要有效授权，但未找到可用的 license。 |

        | `ReferenceExist` | 400 | 该资源仍被其他实体引用，无法删除。 |

        | `Unauthorized` | 401 | `app_key` 缺失、无效或已过期。 |

        | `BalanceNotEnough` | 402 | 账户余额不足，无法执行需要计费的操作。 |

        | `AccessDenied` | 403 | 身份认证通过，但 RBAC 权限不足以执行该操作。 |

        | `RouteNotFound` | 404 | 请求的 URL 路径不是已知路由。 |

        | `MethodNotAllowed` | 405 | 当前路径不接受所使用的 HTTP 方法。 |

        | `UndonedOrderExist` | 409 | 账户存在未完成的订单，请稍后重试。 |

        | `RequestLocked` | 423 | 因连续失败被临时锁定。 |

        | `EntityTooLarge` | 413 | 请求体超过允许的最大长度。 |

        | `RequestTooFrequently` | 429 | 命中限流（全局、账户级或集成级）。 |

        | `RequestVerifyRequired` | 428 | 操作需要二次验证码，但未提供。 |

        | `DangerousOperation` | 428 | 危险操作，需要进行 MFA 验证。 |

        | `InternalError` | 500 | 服务端未预期错误。反馈问题请附上 `request_id`。 |

        | `ServiceUnavailable` | 503 | 后端依赖不可用，请稍后重试。 |
      enum:
        - OK
        - InvalidParameter
        - BadRequest
        - InvalidContentType
        - ResourceNotFound
        - NoLicense
        - ReferenceExist
        - Unauthorized
        - BalanceNotEnough
        - AccessDenied
        - RouteNotFound
        - MethodNotAllowed
        - UndonedOrderExist
        - RequestLocked
        - EntityTooLarge
        - RequestTooFrequently
        - RequestVerifyRequired
        - DangerousOperation
        - InternalError
        - ServiceUnavailable
      x-enumDescriptions:
        OK: 保留值，正常错误响应不会返回。
        InvalidParameter: 必填参数缺失或未通过校验。
        BadRequest: 通用的 400 错误，通常是请求本身不合法。
        InvalidContentType: 请求头 `Content-Type` 不是 `application/json`。
        ResourceNotFound: 目标资源不存在。注意 HTTP 状态码是 400 而非 404（历史设计）。
        NoLicense: 功能需要有效授权，但未找到可用的 license。
        ReferenceExist: 该资源仍被其他实体引用，无法删除。
        Unauthorized: '`app_key` 缺失、无效或已过期。'
        BalanceNotEnough: 账户余额不足，无法执行需要计费的操作。
        AccessDenied: 身份认证通过，但 RBAC 权限不足以执行该操作。
        RouteNotFound: 请求的 URL 路径不是已知路由。
        MethodNotAllowed: 当前路径不接受所使用的 HTTP 方法。
        UndonedOrderExist: 账户存在未完成的订单，请稍后重试。
        RequestLocked: 因连续失败被临时锁定。
        EntityTooLarge: 请求体超过允许的最大长度。
        RequestTooFrequently: 命中限流（全局、账户级或集成级）。
        RequestVerifyRequired: 操作需要二次验证码，但未提供。
        DangerousOperation: 危险操作，需要进行 MFA 验证。
        InternalError: 服务端未预期错误。反馈问题请附上 `request_id`。
        ServiceUnavailable: 后端依赖不可用，请稍后重试。
      example: InvalidParameter
  responses:
    BadRequest:
      description: 请求非法 — 通常是参数缺失或格式不正确。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            missingParameter:
              value:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                error:
                  code: InvalidParameter
                  message: The specified parameter is not valid.
    Unauthorized:
      description: app_key 缺失或无效。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            missingAppKey:
              value:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                error:
                  code: Unauthorized
                  message: You are unauthorized.
    TooManyRequests:
      description: 命中限流。可能是全局 API 限流、账户级限流或集成级限流。限流按账户聚合。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            rateLimited:
              value:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                error:
                  code: RequestTooFrequently
                  message: Request too frequently.
    ServerError:
      description: 服务端未预期错误。反馈问题时请携带 request_id。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            internal:
              value:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                error:
                  code: InternalError
                  message: >-
                    We encountered an internal error, and it has been reported.
                    Please try again later.
  securitySchemes:
    AppKeyAuth:
      type: apiKey
      in: query
      name: app_key
      description: >-
        在 Flashduty 控制台 账户 → APP Key 中签发的 app_key。调用任何公开 API
        时都必须携带。它等同于所属账户的身份凭证，请妥善保管。

````