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

# 获取告警规则详情 V2

> 通过 ID 返回告警规则的完整 V2 配置，包含 lifecycle v2 的恢复与结束模式设置。

## 限制说明

| 项目   | 说明                             |
| ---- | ------------------------------ |
| 速率限制 | 每个账户 **1,000 次/分钟**；**50 次/秒** |
| 权限要求 | **告警规则查看**（`monit`）            |

## 使用说明

* `id` 必填且不能为 `0`，否则返回 `InvalidParameter`。
* 规则不存在时返回 `InvalidParameter`（`alert rule not found`）。


## OpenAPI

````yaml /api-reference/monitors.openapi.zh.json post /monit/rule/v2/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: Monitors/告警规则
    description: 创建、管理和导出监控告警规则，查询规则统计和审计历史。
  - name: Monitors/告警数据源
    description: 管理监控告警规则用于查询指标的数据源。
  - name: Monitors/诊断分析
    description: Flashduty AI SRE 使用的诊断与查询接口——数据源即席查询、日志/指标诊断,以及监控对象侧的工具调用。
  - name: Monitors/通用工具
    description: 监控服务开通及数据预览工具。
paths:
  /monit/rule/v2/info:
    post:
      tags:
        - Monitors/告警规则
      summary: 获取告警规则详情 V2
      description: 通过 ID 返回告警规则的完整 V2 配置，包含 lifecycle v2 的恢复与结束模式设置。
      operationId: monit-rule-read-info-v2
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RuleIDRequest'
            example:
              id: 50001
      responses:
        '200':
          description: 成功
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessEnvelope'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/AlertRuleV2'
              example:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                data:
                  id: 50001
                  account_id: 888
                  folder_id: 100
                  name: CPU High
                  labels: {}
                  ds_type: prometheus
                  ds_list:
                    - prometheus*
                  ds_ids: []
                  enabled: true
                  debug_log_enabled: false
                  rule_configs:
                    queries:
                      - name: A
                        expr: 100 - avg(cpu_usage_idle)
                    check_threshold:
                      enabled: true
                      alerting_check_times: 3
                      alerting_window_size: 5
                      recovery_check_times: 2
                      critical: $A > 90
                      warning: $A > 80
                      recovery_mode: condition_clear
                  cron_pattern: 0 * * * * *
                  timezone: Asia/Shanghai
                  delay_seconds: 0
                  enabled_times:
                    - days:
                        - 1
                        - 2
                        - 3
                        - 4
                        - 5
                        - 6
                        - 0
                      stime: '00:00'
                      etime: '23:59'
                  annotations: {}
                  description_type: text
                  description: ''
                  channel_ids:
                    - 20001
                  repeat_interval: 3600
                  repeat_total: 3
                  investigation_targets: []
                  creator_id: 66
                  creator_name: zhangsan
                  updater_id: 66
                  updater_name: zhangsan
                  created_at: 1712000000
                  updated_at: 1712000000
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    RuleIDRequest:
      type: object
      required:
        - id
      properties:
        id:
          type: integer
          format: uint64
          description: 告警规则 ID，可通过 `POST /monit/rule/list/basic` 按文件夹查询获取。
    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
    AlertRuleV2:
      type: object
      description: >-
        完整的 V2 告警规则配置。与 V1 的核心差异在 `rule_configs`：三个检查器使用 lifecycle v2 的
        `recovery_mode`/`end_mode` 枚举描述恢复与结束语义。
      properties:
        id:
          type: integer
          format: uint64
          description: 规则 ID。更新时必填，创建时省略（服务端自动分配）。
        account_id:
          type: integer
          format: uint64
          description: 账户 ID，由服务端按认证信息自动填充，客户端传入将被忽略。
        folder_id:
          type: integer
          format: uint64
          description: >-
            规则所属文件夹 ID，可通过 `POST /monit/folder/list` 获取。创建后不可通过更新接口修改，调整文件夹请使用
            `/monit/rule/move`。
        name:
          type: string
          description: 规则名称，同一文件夹内必须唯一，最长 128 个字符。
        labels:
          type: object
          additionalProperties:
            type: string
          description: 自定义标签。
        ds_type:
          type: string
          description: 数据源类型标识（如 `prometheus`、`elasticsearch`）。
        ds_list:
          type: array
          items:
            type: string
          description: 数据源名称匹配模式（支持通配符）。`ds_list` / `ds_ids` 至少一个非空，两者合并共同决定规则监控哪些数据源。
        ds_ids:
          type: array
          items:
            type: integer
            format: uint64
          description: >-
            数据源 ID 列表，与 `ds_list` 合并后共同决定规则监控的数据源，使用 ID 可避免数据源改名后失效。`ds_list` 与
            `ds_ids` 至少提供一个。
        enabled:
          type: boolean
          description: 是否启用规则。必填，服务端解码时强制要求显式传入（包括 `false`）。更新为 `false` 时服务端会清理该规则的活跃告警。
        debug_log_enabled:
          type: boolean
          description: 是否开启调试日志，开启后 edge 评估该规则时输出详细日志，用于排查规则未按预期触发等问题。
        rule_configs:
          $ref: '#/components/schemas/AlertRuleConfigsV2'
          description: 检测配置，包含查询列表与触发/恢复条件，结构见 `AlertRuleConfigsV2`。
        cron_pattern:
          type: string
          description: >-
            调度表达式：6 段（含秒）cron 表达式或 `@every 30s` 间隔描述。不允许以 `CRON_TZ=` 或 `TZ=`
            开头，时区请填写到 `timezone` 字段。
        timezone:
          type: string
          description: >-
            告警规则执行时区，决定 cron 调度与生效时间窗口的解释方式。仅接受 IANA 时区名（如
            `Asia/Shanghai`、`UTC`、`Europe/London`）；不接受 `Local`、`UTC+8`、`CST`
            等简写或偏移量。留空时按 `Asia/Shanghai` 处理。
          default: Asia/Shanghai
        delay_seconds:
          type: integer
          description: 评估时查询窗口向前偏移的秒数，用于补偿数据摄入延迟。
        enabled_times:
          type: array
          description: 规则生效的时间窗口。省略或传空数组时，默认每天 00:00–23:59 生效。
          default:
            - days:
                - 1
                - 2
                - 3
                - 4
                - 5
                - 6
                - 0
              stime: '00:00'
              etime: '23:59'
          items:
            type: object
            properties:
              days:
                type: array
                items:
                  type: integer
                description: 星期几（0=周日）。
              stime:
                type: string
                description: 开始时间，如 `09:00`。
              etime:
                type: string
                description: 结束时间，如 `18:00`。
        annotations:
          type: object
          additionalProperties:
            type: string
          description: 附加注解键值对，随告警事件下发；键不允许以 `$` 开头（该前缀保留给查询字段）。
        description_type:
          type: string
          enum:
            - text
            - markdown
          default: text
          description: >-
            描述内容的格式。省略或为空时默认使用 `text`。`text` = 纯文本；`markdown` = Markdown
            格式，告警详情中按 Markdown 渲染。
        description:
          type: string
          description: 规则描述，Markdown 格式。
        channel_ids:
          type: array
          items:
            type: integer
            format: uint64
          description: 告警发送到的协作空间 ID 列表。可为空，告警将通过全局集成路由。
        repeat_interval:
          type: integer
          format: int64
          description: 通知重复间隔（秒）。小于 1 时按默认值 3600 处理。
        repeat_total:
          type: integer
          format: int64
          description: 最大重复通知次数。小于 1 时按默认值 3 处理。
        investigation_targets:
          type: array
          items:
            $ref: '#/components/schemas/InvestigationTarget'
          description: >-
            告警事件详情页关联的排障入口列表，最多 20 项，不允许重复。更新接口中该字段按 presence 处理：省略时保留原配置，传 `[]`
            清空。
          x-flashduty-preserve-absence: true
        creator_id:
          type: integer
          format: uint64
          description: 创建人 ID，由服务端按当前用户自动填充，客户端传入将被忽略。
        creator_name:
          type: string
          description: 创建人名称，由服务端自动填充，客户端传入将被忽略。
        updater_id:
          type: integer
          format: uint64
          description: 最近更新人 ID，由服务端自动填充，客户端传入将被忽略。
        updater_name:
          type: string
          description: 最近更新人名称，由服务端自动填充，客户端传入将被忽略。
        created_at:
          type: integer
          format: int64
          description: 创建时间，Unix 秒级时间戳，由服务端生成，客户端传入将被忽略。
        updated_at:
          type: integer
          format: int64
          description: 最近更新时间，Unix 秒级时间戳，由服务端生成，客户端传入将被忽略。
      required:
        - folder_id
        - name
        - ds_type
        - enabled
        - cron_pattern
        - rule_configs
    AlertRuleConfigsV2:
      type: object
      description: V2 规则评估配置。
      properties:
        queries:
          type: array
          description: 查询列表，至少一条；每条需唯一的 `name`（`R`、`__all__` 为保留名）与非空且不重复的 `expr`。
          items:
            type: object
            properties:
              name:
                type: string
                description: >-
                  查询标识符（如 `A`），须匹配 `[A-Za-z][A-Za-z0-9_]*`；`R`、`__all__`
                  为保留名称，不可使用。
              expr:
                type: string
                description: 查询表达式。
              label_fields:
                type: array
                items:
                  type: string
                description: >-
                  作为告警事件标签的结果字段列表，相同标签组合归为同一告警；不可与 `value_fields`
                  重复，适用于表型结果（SQL/ES 等数据源）。
              value_fields:
                type: array
                items:
                  type: string
                description: >-
                  参与阈值评估的数值结果字段列表（以 `$A.<field>` 形式被阈值表达式引用）；对阈值检查且数据源非
                  `prometheus`/`loki`/`victorialogs` 时必填，字段名不允许含 `.`。
              args:
                type: object
                additionalProperties:
                  type: string
                description: >-
                  数据源相关的查询附加参数，键采用 `<数据源>.<参数>` 约定（如
                  `es.type`、`tencent_cls.limit`）；大多数数据源无需配置。
        relate_queries:
          type: array
          description: 可选的辅助查询，其结果作为上下文附加到告警事件中。每项须有唯一的 `name`（不与任何 query 名称重复）且 `expr` 非空。
          items:
            type: object
            properties:
              name:
                type: string
                description: 辅助查询标识符。
              expr:
                type: string
                description: 查询表达式。
              args:
                type: object
                additionalProperties:
                  type: string
                description: 辅助查询的数据源相关附加参数，约定同 `queries[].args`。
        check_threshold:
          $ref: '#/components/schemas/AlertRuleThresholdV2'
          description: 阈值检查配置，结构见 `AlertRuleThresholdV2`。
        check_anydata:
          $ref: '#/components/schemas/AlertRuleAnyDataV2'
          description: 有数据检查配置：查询返回任意数据行时触发告警，结构见 `AlertRuleAnyDataV2`。
        check_nodata:
          $ref: '#/components/schemas/AlertRuleNoDataV2'
          description: 无数据检查配置，结构见 `AlertRuleNoDataV2`。
      required:
        - queries
    InvestigationTarget:
      type: object
      description: 告警事件的关联排障入口，为封闭的 tagged union：新增类型需服务端显式支持。
      properties:
        kind:
          type: string
          enum:
            - dashboard
          description: 排障入口类型，目前仅支持 `dashboard`。
        dashboard:
          $ref: '#/components/schemas/DashboardInvestigationTarget'
          description: '`dashboard` 类型的入口配置；`kind` 为 `dashboard` 时必填。'
      required:
        - kind
    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
    AlertRuleThresholdV2:
      type: object
      description: 阈值检查配置（lifecycle v2）。
      properties:
        enabled:
          type: boolean
          description: 是否启用阈值检查。
        alerting_check_times:
          type: integer
          description: >-
            满足告警条件的次数达到该值后触发告警；启用时最小为 1、最大 10000。与 `alerting_window_size`
            配合时表示最近 M 次评估中至少命中 N 次。
        alerting_window_size:
          type: integer
          description: >-
            可选的滑动窗口大小 M：最近 M 次评估中至少满足条件 `alerting_check_times` 次才触发。省略时为连续模式（连续
            N 次命中）。取值须满足 `alerting_check_times` <= M <= 10000。
        recovery_check_times:
          type: integer
          description: 满足恢复条件的次数达到该值后判定恢复，启用时最小为 1。
        critical:
          type: string
          description: >-
            Critical 级别阈值表达式，用 `$<查询名>` 或 `$<查询名>.<value_field>` 引用查询结果，如 `$A >
            90`；启用时三个级别至少配置一个。
        warning:
          type: string
          description: Warning 级别阈值表达式，语法同 `critical`。
        info:
          type: string
          description: Info 级别阈值表达式，语法同 `critical`。
        recovery_mode:
          type: string
          enum:
            - condition_clear
            - expression_match
            - recovery_query_match
            - manual
          description: >-
            恢复判定方式（lifecycle v2），启用时必填。`condition_clear` = 告警表达式不再成立即恢复，不允许配置
            `recovery`；`expression_match` = `recovery.expr`
            阈值表达式成立时恢复；`recovery_query_match` = `recovery.expr`
            查询表达式为真时恢复；`manual` = 不自动判定恢复，告警需人工处理，不推送恢复事件，不允许配置 `recovery`。
        recovery:
          $ref: '#/components/schemas/AlertRuleRecoveryQueryV2'
          description: >-
            恢复判定配置。仅 `recovery_mode` 为 `expression_match` 或
            `recovery_query_match` 时必填（`recovery.expr` 非空），其余模式不允许传入。
    AlertRuleAnyDataV2:
      type: object
      description: 有数据检查配置（lifecycle v2）。查询返回任意数据行时触发告警。
      properties:
        enabled:
          type: boolean
          description: 是否启用有数据检查：查询返回任意数据行即触发告警。
        alerting_check_times:
          type: integer
          description: >-
            满足告警条件的次数达到该值后触发告警；启用时最小为 1、最大 10000。与 `alerting_window_size`
            配合时表示最近 M 次评估中至少命中 N 次。
        alerting_window_size:
          type: integer
          description: >-
            可选的滑动窗口大小 M：最近 M 次评估中至少满足条件 `alerting_check_times`
            次才触发。省略时为连续模式。取值须满足 `alerting_check_times` <= M <= 10000。
        recovery_check_times:
          type: integer
          description: 满足恢复条件的次数达到该值后判定恢复，启用时最小为 1。
        severity:
          type: string
          enum:
            - Critical
            - Warning
            - Info
          description: 有数据告警的事件级别，大小写敏感；启用时必填。
        recovery_mode:
          type: string
          enum:
            - data_absent
            - recovery_query_match
            - manual
          description: >-
            恢复判定方式（lifecycle v2），启用时必填。`data_absent` = 查询无数据时恢复，不允许配置
            `recovery`；`recovery_query_match` = `recovery.expr`
            查询表达式为真时恢复，仅允许单个查询（`name=A`）；`manual` =
            不自动判定恢复，告警需人工处理，不推送恢复事件，不允许配置 `recovery`。
        recovery:
          $ref: '#/components/schemas/AlertRuleRecoveryQueryV2'
          description: >-
            恢复判定配置。仅 `recovery_mode` 为 `recovery_query_match`
            时必填（`recovery.expr` 非空），其余模式不允许传入。
    AlertRuleNoDataV2:
      type: object
      description: 无数据检查配置（lifecycle v2）。
      properties:
        enabled:
          type: boolean
          description: 是否启用按序列的无数据检查：历史上有数据的序列查不到数据时触发告警。
        severity:
          type: string
          enum:
            - Critical
            - Warning
            - Info
          description: 无数据告警的事件级别，大小写敏感；启用按序列检查时必填。
        alert_on_empty_result:
          type: boolean
          description: 所有查询都返回空结果时是否触发告警（全局空结果检查）。
        alert_on_empty_result_severity:
          type: string
          enum:
            - Critical
            - Warning
            - Info
          description: 空结果告警的事件级别，大小写敏感；仅在 `alert_on_empty_result` 开启时生效且必填。
        alerting_check_times:
          type: integer
          description: >-
            满足告警条件的次数达到该值后触发告警；启用时最小为 1、最大 10000。与 `alerting_window_size`
            配合时表示最近 M 次评估中至少命中 N 次。
        alerting_window_size:
          type: integer
          description: >-
            可选的滑动窗口大小 M：最近 M 次评估中至少满足条件 `alerting_check_times`
            次才触发。省略时为连续模式。取值须满足 `alerting_check_times` <= M <= 10000。
        recovery_check_times:
          type: integer
          description: 满足恢复条件的次数达到该值后判定恢复，启用时最小为 1。
        end_mode:
          type: string
          enum:
            - data_reappears
            - data_reappears_or_timeout
            - manual
          description: >-
            无数据告警的结束方式（lifecycle v2），启用时必填。`data_reappears` =
            数据重新出现时恢复；`data_reappears_or_timeout` = 数据重现或超过
            `auto_close_after_seconds` 秒后自动关闭，要求启用按序列无数据检查且
            `auto_close_after_seconds` 为正数；`manual` =
            不自动结束，告警需人工处理，不推送恢复事件。`data_reappears` 和 `manual` 模式下
            `auto_close_after_seconds` 必须为 0。
        auto_close_after_seconds:
          type: integer
          format: int64
          description: >-
            自动关闭等待时间（秒）。仅 `end_mode` 为 `data_reappears_or_timeout`
            时允许且必须为正数，其余模式必须为 0。
    DashboardInvestigationTarget:
      type: object
      description: dashboard 类型的排障入口配置。
      properties:
        dashboard_id:
          type: string
          description: 目标仪表盘 ID，须为规范的 UUIDv7。
        target_id:
          type: string
          description: 仪表盘内目标面板 ID，须为规范的 UUIDv7；可选。
        variable_bindings:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/InvestigationVariableBinding'
          description: 仪表盘变量绑定，键为仪表盘变量名。
      required:
        - dashboard_id
    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.
        reason:
          description: 可选的机器可读拒绝原因，包含数据源工具错误；结合 HTTP 状态及 code 判断。
          type: string
          x-flashduty-preserve-absence: true
      required:
        - code
        - message
    AlertRuleRecoveryQueryV2:
      type: object
      description: lifecycle v2 的恢复判定配置。
      properties:
        expr:
          type: string
          description: >-
            恢复条件表达式：`expression_match` 模式下为阈值表达式（如 `$A <
            90`），`recovery_query_match` 模式下为查询表达式。启用对应模式时必填且非空。
        value_fields:
          type: array
          items:
            type: string
          description: 恢复表达式以 `$A.<field>` 形式引用的数值结果字段，语义同查询的 `value_fields`。为空时不返回。
        args:
          type: object
          additionalProperties:
            type: string
          description: 恢复查询的数据源附加参数，键约定同查询的 `args`（`<数据源>.<参数>`）。为空时不返回。
    InvestigationVariableBinding:
      type: object
      description: 仪表盘变量与告警事件数据的绑定。
      properties:
        source:
          type: string
          enum:
            - event_label
          description: 绑定值来源，目前仅支持 `event_label`（取告警事件的标签值）。
        key:
          type: string
          description: 告警事件标签名，须符合 Prometheus 标签命名规则，且不能使用保留标签。
      required:
        - source
        - key
    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
        时都必须携带。它等同于所属账户的身份凭证，请妥善保管。

````