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

# 查看会话回放元数据

> 返回可回放会话记录的应用、设备、会话时间范围及全部视图信息。

## 限制说明

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

## 使用说明

* 若会话不存在，或该会话没有录制回放数据（`session_has_replay` 为 false），返回 `InvalidParameter`。
* 若该会话时间窗口内未查询到任何视图，返回 `InvalidParameter`。
* 当 `session_id` 在不同时间窗口内被复用时，可传入 `ts` 加以区分。


## OpenAPI

````yaml /api-reference/rum.openapi.zh.json post /rum/session-replay/metadata
openapi: 3.1.0
info:
  description: >-
    Flashduty 事件管理平台的公开 HTTP API —— 覆盖故障、通知模板、协作空间、值班排班、监控、RUM、以及平台管理。每次调用都需在
    query 中携带 `app_key`，该 key 在 Flashduty 控制台 账户 → APP Key 中签发。所有响应使用统一结构：成功时为
    `{ request_id, data }`，失败时为 `{ request_id, error }`。
  title: Flashduty 开放 API
  version: 1.0.0
servers:
  - description: Flashduty Open API
    url: https://api.flashcat.cloud
security:
  - AppKeyAuth: []
tags:
  - description: 管理前端性能监控（RUM）应用。
    name: RUM/应用管理
  - description: 对 RUM 事件数据执行分析查询。
    name: RUM/RUM 数据查询
  - description: 查询和管理 RUM 异常追踪 Issue 及预设严重性规则。
    name: RUM/RUM 问题跟踪
  - description: 查询 RUM 自定义字段及其值分布，用于构建分析过滤条件。
    name: RUM/RUM 自定义字段
  - description: 管理和查询用于 Browser、Android、iOS 错误符号化的 RUM Sourcemap 文件。
    name: RUM/RUM Sourcemap
  - description: 查询 RUM 会话的回放元数据与录制分段。
    name: RUM/RUM 会话回放
  - description: 配置和查看决定 RUM 应用采集哪些错误的规则，并可查看其编辑历史。
    name: RUM/错误采集规则
  - description: 管理按应用配置的预设严重性规则，用于为匹配的前端错误指定严重级别，并管理其评估顺序与变更历史。
    name: RUM/Issue 预设严重性规则
  - description: 查询账户的 RUM 资源记录及当前用量。
    name: RUM/资源
paths:
  /rum/session-replay/metadata:
    post:
      tags:
        - RUM/RUM 会话回放
      summary: 查看会话回放元数据
      description: 返回可回放会话记录的应用、设备、会话时间范围及全部视图信息。
      operationId: rum-session-replay-read-metadata
      requestBody:
        content:
          application/json:
            example:
              session_id: 0a4a2e64-8a4f-4b9a-9c1e-3a2f9e6d7c81
            schema:
              $ref: '#/components/schemas/RumSessionReplayMetaRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              example:
                data:
                  application:
                    id: WoyQQ3BohkdtPivubEvE8o
                  device:
                    type: desktop
                  foreground_periods: []
                  session:
                    end: 1752480600000
                    is_active: false
                    server_time_delta: 0
                    source: browser
                    start: 1752480000000
                  views:
                    - container_source: ''
                      container_view_id: ''
                      end: 1752480600000
                      is_active: false
                      loading_type: initial_load
                      name: /dashboard
                      server_time_delta: 0
                      source: browser
                      start: 1752480000000
                      url: https://app.example.com/dashboard
                      view_id: 6f2b6b1a-8f7e-4e3a-9c2b-1a2b3c4d5e6f
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessEnvelope'
                  - properties:
                      data:
                        $ref: '#/components/schemas/RumSessionReplayMetaItem'
                    type: object
          description: 成功
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    RumSessionReplayMetaRequest:
      description: 查询单个 RUM 会话的回放元数据。
      properties:
        session_id:
          description: RUM 会话 ID（RUM 事件中的 `session.id`）。
          type: string
        ts:
          description: 会话起始时间的 Unix 毫秒时间戳。可选；当 `session_id` 在不同时间窗口内被复用时用于区分。
          exclusiveMinimum: 0
          format: int64
          type: integer
      required:
        - session_id
      type: object
    SuccessEnvelope:
      description: >-
        成功响应结构。2xx 响应中 `request_id` 标识本次调用（同时出现在 `Flashcat-Request-Id`
        响应头中），`data` 为接口业务 payload。失败响应使用不同结构，参见 `ErrorResponse`。
      properties:
        data:
          description: 每个接口自己的业务 payload，详见各接口的 200 响应 schema。
        request_id:
          description: 本次请求的唯一 ID，也会在 Flashcat-Request-Id 响应头中返回。反馈问题时请一并附上。
          example: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
          type: string
      required:
        - request_id
        - data
      type: object
    RumSessionReplayMetaItem:
      description: 会话的回放元数据：所属应用、设备、会话时间范围及全部录制视图。
      properties:
        application:
          $ref: '#/components/schemas/RumReplayApplication'
          description: 会话所属的应用。
        device:
          $ref: '#/components/schemas/RumReplayDevice'
          description: 录制该会话的设备。
        foreground_periods:
          description: 会话内的前台时间区间（仅移动端会话；Web 端为空）。
          items:
            $ref: '#/components/schemas/RumReplayForegroundPeriod'
          type: array
        session:
          $ref: '#/components/schemas/RumReplaySession'
          description: 会话的起止时间与状态。
        views:
          description: 会话内录制的全部视图，按时间顺序排列。
          items:
            $ref: '#/components/schemas/RumReplayView'
          type: array
      type: object
    RumReplayApplication:
      properties:
        id:
          description: 会话所属的 RUM 应用 ID。
          type: string
      type: object
    RumReplayDevice:
      properties:
        type:
          description: 会话记录的设备类型，如 `desktop`、`mobile`、`tablet`。
          type: string
      type: object
    RumReplayForegroundPeriod:
      description: App 处于前台的一段时间区间（移动端会话）。
      properties:
        end:
          description: 前台区间结束的 Unix 毫秒时间戳。
          format: int64
          type: integer
        start:
          description: 前台区间开始的 Unix 毫秒时间戳。
          format: int64
          type: integer
        view_id:
          description: 该前台区间内活跃的视图 ID。
          type: string
      type: object
    RumReplaySession:
      properties:
        end:
          description: 会话结束（或活跃会话最后更新）的 Unix 毫秒时间戳。
          format: int64
          type: integer
        is_active:
          description: 截至最后一条记录事件时，会话是否仍处于活跃状态。
          type: boolean
        server_time_delta:
          description: 客户端与 Flashduty 服务端之间的时钟偏移（毫秒），用于校正客户端时间戳。
          format: int64
          type: integer
        source:
          description: |-
            录制该会话的 SDK 平台。平台标识：

            | 值 | 含义 |
            |---|---|
            | `browser` | 浏览器 Web 应用（JavaScript SDK） |
            | `ios` | 苹果 iOS 应用 |
            | `android` | Android 应用 |
            | `react-native` | React Native 应用 |
            | `flutter` | Flutter 应用 |
            | `kotlin-multiplatform` | Kotlin Multiplatform 应用 |
            | `roku` | Roku 频道应用 |
            | `unity` | Unity 应用 |
            | `miniprogram` | 微信小程序 |
            | `harmony` | 鸿蒙 HarmonyOS 应用 |
            | `electron` | Electron 桌面应用 |
          enum:
            - browser
            - ios
            - android
            - react-native
            - flutter
            - kotlin-multiplatform
            - roku
            - unity
            - miniprogram
            - harmony
            - electron
          type: string
        start:
          description: 会话开始的 Unix 毫秒时间戳。
          format: int64
          type: integer
      type: object
    RumReplayView:
      properties:
        container_source:
          description: 该视图嵌套展示时，容器应用的 SDK 平台（如原生应用内的 WebView）；未嵌套时省略。
          type: string
        container_view_id:
          description: 该视图嵌套展示时，容器视图的 View ID；未嵌套时省略。
          type: string
        end:
          description: 视图结束的 Unix 毫秒时间戳。
          format: int64
          type: integer
        is_active:
          description: 截至最后一条记录事件时，视图是否仍处于活跃状态。
          type: boolean
        loading_type:
          description: 进入该视图的方式，如 `initial_load`、`route_change`。
          type: string
        name:
          description: 视图名称，通常为路由或页面名。
          type: string
        server_time_delta:
          description: 客户端与 Flashduty 服务端之间的时钟偏移（毫秒），用于校正客户端时间戳。
          format: int64
          type: integer
        source:
          description: |-
            录制该视图的 SDK 平台。平台标识：

            | 值 | 含义 |
            |---|---|
            | `browser` | 浏览器 Web 应用（JavaScript SDK） |
            | `ios` | 苹果 iOS 应用 |
            | `android` | Android 应用 |
            | `react-native` | React Native 应用 |
            | `flutter` | Flutter 应用 |
            | `kotlin-multiplatform` | Kotlin Multiplatform 应用 |
            | `roku` | Roku 频道应用 |
            | `unity` | Unity 应用 |
            | `miniprogram` | 微信小程序 |
            | `harmony` | 鸿蒙 HarmonyOS 应用 |
            | `electron` | Electron 桌面应用 |
          enum:
            - browser
            - ios
            - android
            - react-native
            - flutter
            - kotlin-multiplatform
            - roku
            - unity
            - miniprogram
            - harmony
            - electron
          type: string
        start:
          description: 视图开始的 Unix 毫秒时间戳。
          format: int64
          type: integer
        url:
          description: 视图对应的 URL（Web）或屏幕标识（移动端）。
          type: string
        view_id:
          description: 会话内该视图的唯一 ID。
          type: string
      type: object
    ErrorResponse:
      description: 错误响应结构。`error` 必填，`data` 不存在。
      properties:
        error:
          $ref: '#/components/schemas/DutyError'
        request_id:
          description: 本次请求的唯一追踪 ID（trace ID），反馈问题时请提供该值以便检索日志。
          example: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
          type: string
      required:
        - request_id
        - error
      type: object
    DutyError:
      description: 响应结构中的错误 payload，仅在非 2xx 响应时出现。
      properties:
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          description: 用户可读的错误描述，语言会跟随调用方的 Accept-Language。可能包含字段名、ID 等请求上下文。
          example: The specified parameter template_id is not valid.
          type: string
      required:
        - code
        - message
      type: object
    ErrorCode:
      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
      example: InvalidParameter
      type: string
      x-enumDescriptions:
        AccessDenied: 身份认证通过，但 RBAC 权限不足以执行该操作。
        BadRequest: 通用的 400 错误，通常是请求本身不合法。
        BalanceNotEnough: 账户余额不足，无法执行需要计费的操作。
        DangerousOperation: 危险操作，需要进行 MFA 验证。
        EntityTooLarge: 请求体超过允许的最大长度。
        InternalError: 服务端未预期错误。反馈问题请附上 `request_id`。
        InvalidContentType: 请求头 `Content-Type` 不是 `application/json`。
        InvalidParameter: 必填参数缺失或未通过校验。
        MethodNotAllowed: 当前路径不接受所使用的 HTTP 方法。
        NoLicense: 功能需要有效授权，但未找到可用的 license。
        OK: 保留值，正常错误响应不会返回。
        ReferenceExist: 该资源仍被其他实体引用，无法删除。
        RequestLocked: 因连续失败被临时锁定。
        RequestTooFrequently: 命中限流（全局、账户级或集成级）。
        RequestVerifyRequired: 操作需要二次验证码，但未提供。
        ResourceNotFound: 目标资源不存在。注意 HTTP 状态码是 400 而非 404（历史设计）。
        RouteNotFound: 请求的 URL 路径不是已知路由。
        ServiceUnavailable: 后端依赖不可用，请稍后重试。
        Unauthorized: '`app_key` 缺失、无效或已过期。'
        UndonedOrderExist: 账户存在未完成的订单，请稍后重试。
  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: 请求非法 — 通常是参数缺失或格式不正确。
    Unauthorized:
      content:
        application/json:
          examples:
            missingAppKey:
              value:
                error:
                  code: Unauthorized
                  message: You are unauthorized.
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
          schema:
            $ref: '#/components/schemas/ErrorResponse'
      description: 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: 命中限流。可能是全局 API 限流、账户级限流或集成级限流。限流按账户聚合。
    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: 服务端未预期错误。反馈问题时请携带 request_id。
  securitySchemes:
    AppKeyAuth:
      description: >-
        在 Flashduty 控制台 账户 → APP Key 中签发的 app_key。调用任何公开 API
        时都必须携带。它等同于所属账户的身份凭证，请妥善保管。
      in: query
      name: app_key
      type: apiKey

````