> ## 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 应用下预设严重性规则的变更历史列表。

## 限制说明

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

## 使用说明

* 每条记录是该应用下所有规则在触发本次变更**之前**那一刻的整体快照，而非增量差异。每次真正产生变更的 create/update/enable/disable/delete/reorder/revert 调用前都会写入一条新快照（若 `update` 请求未携带任何可改字段，会直接返回成功且不写快照），因此 `version=1` 通常是首次创建规则之前捕获到的空规则集。
* `rules` 中的每一项都是完整的内部行结构（包含 `account_id`、`created_by`、`id`、`deleted_at`），比 `rules/list` 返回的结构更宽。
* `limit` 默认 20，超过 100 会被静默截断为 100，而不会报错。
* `orderby` 仅支持 `updated_at` 或 `version`，传入其他值（含缺省）会回退为 `updated_at`，不会报错。
* 结果默认按降序排列，传入 `asc=true` 可改为升序。


## OpenAPI

````yaml /api-reference/rum.openapi.zh.json post /rum/issue/preset-severity/rules/history/list
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/issue/preset-severity/rules/history/list:
    post:
      tags:
        - RUM/Issue 预设严重性规则
      summary: 查询预设严重性规则历史列表
      description: 返回指定 RUM 应用下预设严重性规则的变更历史列表。
      operationId: rum-issue-preset-severity-rules-history-list
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RumPresetSeverityRuleHistoryListRequest'
            example:
              application_id: WoyQQ3BohkdtPivubEvE8o
              p: 0
              limit: 20
      responses:
        '200':
          description: 成功
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessEnvelope'
                  - type: object
                    properties:
                      data:
                        $ref: >-
                          #/components/schemas/RumPresetSeverityRuleHistoryListResponse
              example:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                data:
                  total: 3
                  has_next_page: false
                  items:
                    - rules:
                        - account_id: 3790925372131
                          application_id: WoyQQ3BohkdtPivubEvE8o
                          rule_id: n8mZQ2VbXk4wPRs6DfC9Ay
                          rule_name: 已知浏览器插件噪声错误
                          description: 将已知浏览器插件错误降级为 Info
                          filters:
                            - - key: error.error_message
                                oper: IN
                                vals:
                                  - >-
                                    /^ResizeObserver
                                    loop.*|.*chrome-extension:\/\/.*/
                          severity: Info
                          priority: 1
                          status: enabled
                          created_by: 3790925372131
                          updated_by: 3790925372131
                          id: 4820
                          deleted_at: 0
                          created_at: 1785744052160
                          updated_at: 1785744052160
                        - account_id: 3790925372131
                          application_id: WoyQQ3BohkdtPivubEvE8o
                          rule_id: TAHUYnQmXKzgMS4TFVUKvz
                          rule_name: 生产环境崩溃升级
                          description: 将生产环境的崩溃错误升级为 Critical 严重级别
                          filters:
                            - - key: error.env
                                oper: IN
                                vals:
                                  - production
                              - key: error.is_crash
                                oper: IN
                                vals:
                                  - 'true'
                          severity: Critical
                          priority: 2
                          status: enabled
                          created_by: 3790925372131
                          updated_by: 3790925372131
                          id: 4821
                          deleted_at: 0
                          created_at: 1785830452160
                          updated_at: 1785830452160
                      version: 3
                      updated_by: 2476444212131
                      updated_by_name: Alice Chen
                      updated_at: 1785916852160
                    - rules:
                        - account_id: 3790925372131
                          application_id: WoyQQ3BohkdtPivubEvE8o
                          rule_id: n8mZQ2VbXk4wPRs6DfC9Ay
                          rule_name: 已知浏览器插件噪声错误
                          description: 将已知浏览器插件错误降级为 Info
                          filters:
                            - - key: error.error_message
                                oper: IN
                                vals:
                                  - >-
                                    /^ResizeObserver
                                    loop.*|.*chrome-extension:\/\/.*/
                          severity: Info
                          priority: 1
                          status: enabled
                          created_by: 3790925372131
                          updated_by: 3790925372131
                          id: 4820
                          deleted_at: 0
                          created_at: 1785744052160
                          updated_at: 1785744052160
                      version: 2
                      updated_by: 3790925372131
                      updated_by_name: Bob Zhang
                      updated_at: 1785830452160
                    - rules: []
                      version: 1
                      updated_by: 3790925372131
                      updated_by_name: Bob Zhang
                      updated_at: 1785744052160
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    RumPresetSeverityRuleHistoryListRequest:
      type: object
      required:
        - application_id
      description: 查询预设严重性规则变更历史的过滤参数。
      properties:
        application_id:
          type: string
          description: RUM 应用 ID，可通过 `POST /rum/application/list` 获取。
        p:
          type: integer
          minimum: 0
          default: 0
          description: 页码，从 0 开始。
        limit:
          type: integer
          default: 20
          maximum: 100
          description: 分页大小。小于等于 0 时默认取 20，超过 100 时会被截断为 100。
        orderby:
          type: string
          enum:
            - updated_at
            - version
          default: updated_at
          description: 排序字段。传入其他值（含缺省）会回退为 `updated_at`。
        asc:
          type: boolean
          default: false
          description: 为 true 时按升序排列；默认按降序排列。
    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
    RumPresetSeverityRuleHistoryListResponse:
      type: object
      required:
        - total
        - has_next_page
        - items
      description: 预设严重性规则历史快照的分页列表。
      properties:
        total:
          type: integer
          format: int64
          description: 该应用下历史快照的总数。
        has_next_page:
          type: boolean
          description: 是否还有下一页。
        items:
          type: array
          items:
            $ref: '#/components/schemas/RumPresetSeverityRuleHistoryItem'
          description: 当前页的预设严重性规则历史快照列表。
    RumPresetSeverityRuleHistoryItem:
      type: object
      description: 某次变更时，该应用下所有预设严重性规则的完整版本快照。
      required:
        - rules
        - version
        - updated_by
        - updated_by_name
        - updated_at
      properties:
        rules:
          type: array
          items:
            $ref: '#/components/schemas/RumPresetSeverityRuleHistorySnapshotRule'
          description: 本次快照对应变更**之前**的完整规则集。首条快照通常为空。
        version:
          type: integer
          description: 快照版本号，从 1 开始单调递增。
        updated_by:
          type: integer
          format: int64
          description: 触发本次快照对应变更的成员 ID。
        updated_by_name:
          type: string
          description: 变更发生时 `updated_by` 对应的显示名称。
        updated_at:
          type: integer
          format: int64
          description: 快照写入时间，Unix 毫秒时间戳。
    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
    RumPresetSeverityRuleHistorySnapshotRule:
      type: object
      description: >-
        历史快照中单条规则的完整内部行结构，并非 `rules/list`
        返回的精简结构。快照直接序列化数据库原始行，因此包含内部字段（`account_id`、`created_by`、`id`、`deleted_at`）。
      required:
        - account_id
        - application_id
        - rule_id
        - rule_name
        - description
        - filters
        - severity
        - priority
        - status
        - created_by
        - updated_by
        - id
        - deleted_at
        - created_at
        - updated_at
      properties:
        account_id:
          type: integer
          format: int64
          description: 规则所属账户 ID。
        application_id:
          type: string
          description: 规则所属的 RUM 应用 ID。
        rule_id:
          type: string
          description: 唯一规则 ID。
        rule_name:
          type: string
          description: 规则显示名称。
        description:
          type: string
          description: 规则描述，可为空。
        filters:
          type: array
          description: OR-of-ANDs 过滤结构：外层数组之间为 OR，内层数组内为 AND。当至少一个内层 AND 分组完全匹配时，该规则命中此错误。
          items:
            type: array
            items:
              $ref: '#/components/schemas/RumPresetSeverityRuleFilterCondition'
        severity:
          type: string
          enum:
            - Critical
            - Warning
            - Info
          description: 命中该规则的错误将被赋予的严重级别。
        priority:
          type: integer
          description: 快照时刻的评估顺序，`1` 优先级最高。
        status:
          type: string
          enum:
            - enabled
            - disabled
          description: 快照时刻的规则状态。
        created_by:
          type: integer
          format: int64
          description: 最初创建该规则的成员 ID。
        updated_by:
          type: integer
          format: int64
          description: 快照时刻，最后更新该规则的成员 ID。
        id:
          type: integer
          format: uint64
          description: 内部自增行 ID。历史回滚后会以新 ID 重新插入，因此该值在回滚前后并不稳定。
        deleted_at:
          type: integer
          format: int64
          description: 规则软删除时间，Unix 毫秒时间戳；`0` 表示未删除。由于快照生成前会排除已删除规则，该值实际上恒为 `0`。
        created_at:
          type: integer
          format: int64
          description: 规则创建时间，Unix 毫秒时间戳。
        updated_at:
          type: integer
          format: int64
          description: 规则最近更新时间，Unix 毫秒时间戳。
    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
    RumPresetSeverityRuleFilterCondition:
      type: object
      description: AND 分组内的单条过滤条件。
      required:
        - key
        - oper
        - vals
      properties:
        key:
          type: string
          enum:
            - error.usr_id
            - error.usr_email
            - error.view_url
            - error.view_url_path
            - error.error_type
            - error.error_message
            - error.env
            - error.service
            - error.device_type
            - error.os_name
            - error.browser_name
            - error.is_crash
          description: |-
            过滤属性键。预设严重性规则仅支持以下 Error 级别属性。

            | 值 | 含义 |
            |---|---|
            | `error.usr_id` | 用户 ID |
            | `error.usr_email` | 用户邮箱 |
            | `error.view_url` | 错误发生页面的完整 URL |
            | `error.view_url_path` | 错误发生页面的 URL 路径 |
            | `error.error_type` | 错误类型 |
            | `error.error_message` | 错误信息 |
            | `error.env` | 环境（如 production/staging） |
            | `error.service` | 服务名 |
            | `error.device_type` | 设备类型 |
            | `error.os_name` | 操作系统名称 |
            | `error.browser_name` | 浏览器名称 |
            | `error.is_crash` | 是否为崩溃错误（布尔） |
        oper:
          type: string
          enum:
            - IN
            - NOTIN
          description: 匹配语义：`IN` 表示字段值匹配 `vals` 中任意一个即命中；`NOTIN` 表示一个都不匹配才命中（字段缺失时也视为命中）。
        vals:
          type: array
          minItems: 1
          items:
            type: string
          description: >-
            待匹配的值列表。每一项支持精确字符串匹配、通配符（`*`/`?`）、正则（用 `/.../` 包裹）、面向 IP 类字段的
            CIDR（`cidr:10.0.0.0/8`），或数值比较（如 `num:gt:100`、`num:le:50`）。
    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
        时都必须携带。它等同于所属账户的身份凭证，请妥善保管。

````