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

# 运行仪表盘面板

> 执行已存仪表盘的单个面板并返回数据源结果。



## OpenAPI

````yaml /api-reference/monitors.openapi.zh.json post /monit/dashboard/panel/run
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: 监控服务开通及数据预览工具。
  - name: Monitors/仪表盘
    description: 创建、搜索、版本化与运行 Monitors 仪表盘，并解析其变量与查询。
  - name: Monitors/规则分组
    description: 列出仪表盘与告警规则所在的监控节点树。
paths:
  /monit/dashboard/panel/run:
    post:
      tags:
        - Monitors/仪表盘
      summary: 运行仪表盘面板
      description: 执行已存仪表盘的单个面板并返回数据源结果。
      operationId: monit-dashboard-panel-read-run
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DashboardPanelRunRequest'
            example:
              dashboard_id: 01990d7a-9c5b-7ab0-9c18-33e38f6f2101
              panel_id: 01990d7a-9c5b-7ab0-9c18-33e38f6f2404
              revision: 7
              time:
                from_ms: 1791100800000
                to_ms: 1791104400000
              variables:
                env:
                  kind: values
                  values:
                    - prod
              max_data_points: 100
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessEnvelope'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/DashboardPanelRunResponse'
              example:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                data:
                  dashboard_id: 01990d7a-9c5b-7ab0-9c18-33e38f6f2101
                  panel_id: 01990d7a-9c5b-7ab0-9c18-33e38f6f2404
                  revision: 7
                  run_state: success
                  time:
                    from_ms: 1791100800000
                    to_ms: 1791104400000
                  variables:
                    env:
                      kind: values
                      values:
                        - prod
                  refs:
                    - ref_id: A
                      state: success
                      child_request_id: 01HK8XQH7B4N0PQR2S6TVW9X3M
                      execution:
                        status: success
                        frames:
                          - schema:
                              fields:
                                - name: time
                                  type: time
                                - name: value
                                  type: number
                            data:
                              values:
                                - - 1791100800000
                                  - 812.4
                                - - 1791100860000
                                  - 846.1
                  display:
                    kind: time_series
                    options: {}
                    unit: count_per_second
                    decimals: 2
                    threshold:
                      mode: higher_is_worse
                      warning: 1000
                      critical: 2000
                  budget:
                    max_concurrency: 6
                    execution_count: 1
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    DashboardPanelRunRequest:
      type: object
      description: 对已存仪表盘执行某个面板。省略 `revision` 表示按当前版本运行；传入它可拒绝过期响应。
      properties:
        dashboard_id:
          type: string
          pattern: >-
            ^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
          description: 仪表盘的 canonical UUIDv7。
        panel_id:
          type: string
          pattern: >-
            ^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
          description: 要执行的面板。
        revision:
          type: integer
          format: uint64
          minimum: 1
          description: 版本护栏；设置时必须等于当前版本号。
        time:
          $ref: '#/components/schemas/DashboardAbsoluteTimeRange'
        variables:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/DashboardSelection'
          description: 按变量名索引的选择，最多 20 项。
        max_data_points:
          type:
            - integer
            - 'null'
          minimum: 2
          maximum: 5000
          description: 降采样目标，2～5000 个点；省略或传 null 时服务端默认 100。
      required:
        - dashboard_id
        - panel_id
        - time
        - variables
    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
    DashboardPanelRunResponse:
      type: object
      description: >-
        面板执行结果。`run_state` 汇总各查询状态：全部成功为 `success`，部分成功为 `partial`，否则为
        `incompatible`、`cancelled` 或 `error`。整个响应上限 8 MiB。
      properties:
        dashboard_id:
          type: string
          pattern: >-
            ^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
          description: 仪表盘 ID。
        panel_id:
          type: string
          pattern: >-
            ^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
          description: 面板 ID。
        revision:
          type: integer
          format: uint64
          minimum: 1
          description: 本次执行所依据的版本号。
        run_state:
          type: string
          enum:
            - success
            - partial
            - incompatible
            - cancelled
            - error
          description: >-
            本次运行的整体状态：`success` = 全部查询成功；`partial` = 部分成功；`incompatible` =
            至少一条查询与其数据源类型不兼容；`cancelled` = 运行被取消；`error` = 全部查询失败。
        time:
          $ref: '#/components/schemas/DashboardAbsoluteTimeRange'
        variables:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/DashboardSelection'
          description: 解析成功的变量选择。
        refs:
          type: array
          items:
            $ref: '#/components/schemas/DashboardPanelRunRef'
          description: 面板中每条查询对应一个条目。
        display:
          $ref: '#/components/schemas/DashboardVizConfig'
        budget:
          $ref: '#/components/schemas/DashboardPanelRunBudget'
      required:
        - dashboard_id
        - panel_id
        - revision
        - run_state
        - time
        - variables
        - refs
        - display
        - budget
    DashboardAbsoluteTimeRange:
      type: object
      description: >-
        绝对求值窗口。两个边界都是 Unix 毫秒时间戳，`from_ms` 必须小于 `to_ms`，且都不得超过 JavaScript
        安全整数上限。
      properties:
        from_ms:
          type: integer
          format: int64
          minimum: 0
          description: Unix 时间戳（毫秒）。
        to_ms:
          type: integer
          format: int64
          minimum: 1
          description: Unix 时间戳（毫秒）。
      required:
        - from_ms
        - to_ms
    DashboardSelection:
      type: object
      description: 变量取值的具体选择。空的 `values` 数组是合法输入，表示未解析——服务端不会为其回退到默认值。
      properties:
        kind:
          type: string
          enum:
            - values
            - all
          description: '`values` 选择列出的项，`all` 表示全选（仅当 `include_all` 为 true 时可用）。'
        values:
          type: array
          items:
            type: string
            minLength: 1
            maxLength: 1024
          maxItems: 1000
          description: 已选值，需唯一且不得为 `$__all`。`kind` 为 `all` 时必须为空。
      required:
        - kind
    DashboardPanelRunRef:
      type: object
      description: 面板运行中单条查询的结果。原始执行载荷随数据源类型而异且原样透传，因此此处不做 schema 约束。
      properties:
        ref_id:
          type: string
          pattern: ^[A-Z]$
          description: 面板内的查询引用名。
        state:
          type: string
          enum:
            - success
            - error
            - incompatible
          description: >-
            单条查询的执行状态：`success` = 查询执行成功；`error` = 查询执行失败；`incompatible` =
            数据源接受了调用，但查询模式或字段选择与该数据源类型不匹配。
        child_request_id:
          type: string
          description: 底层数据源执行的请求 ID；排查单条查询时可用。
        execution:
          type: object
          additionalProperties: true
          description: 数据源专属的执行载荷，原样透传。
        error:
          $ref: '#/components/schemas/DashboardRuntimeError'
      required:
        - ref_id
        - state
    DashboardVizConfig:
      description: 可视化配置。`kind` 决定使用哪个分支以及哪个同级的配置对象必需；`time_series` 还携带通用的数值配置。
      oneOf:
        - $ref: '#/components/schemas/DashboardTimeSeriesViz'
        - $ref: '#/components/schemas/DashboardTableViz'
        - $ref: '#/components/schemas/DashboardStatViz'
        - $ref: '#/components/schemas/DashboardBarViz'
        - $ref: '#/components/schemas/DashboardGaugeViz'
        - $ref: '#/components/schemas/DashboardLogsViz'
        - $ref: '#/components/schemas/DashboardTextViz'
      discriminator:
        propertyName: kind
        mapping:
          time_series: '#/components/schemas/DashboardTimeSeriesViz'
          table: '#/components/schemas/DashboardTableViz'
          stat: '#/components/schemas/DashboardStatViz'
          bar: '#/components/schemas/DashboardBarViz'
          gauge: '#/components/schemas/DashboardGaugeViz'
          logs: '#/components/schemas/DashboardLogsViz'
          text: '#/components/schemas/DashboardTextViz'
    DashboardPanelRunBudget:
      type: object
      description: 面板运行的执行统计。
      properties:
        max_concurrency:
          type: integer
          minimum: 1
          description: 该面板查询的并发上限。
        execution_count:
          type: integer
          minimum: 0
          description: 发起的查询数量。
      required:
        - max_concurrency
        - execution_count
    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
    DashboardRuntimeError:
      type: object
      description: 变量级或查询级的失败。单个分支失败不会导致整个调用失败。
      properties:
        reason:
          type: string
          description: >-
            机器可读的失败原因。已观察到的取值包括
            `invalid_request`、`variable_invalid`、`panel_missing`、`field_missing`、`datasource_permission_denied`、`timeout`、`panel_deadline`、`panel_canceled`、`canceled`、`overloaded`、`source_too_large`、`edge_unavailable`、`edge_upgrade_required`、`edge_version_unknown`、`mixed_edge_versions`、`internal`。
        message:
          type: string
          description: 失败的可读详情。
      required:
        - reason
        - message
    DashboardTimeSeriesViz:
      type: object
      description: 时序图可视化。
      properties:
        kind:
          type: string
          enum:
            - time_series
          description: 可视化类型判别字段，固定为 `time_series`。
        options:
          type: object
          additionalProperties: true
          description: 所选可视化类型的开放配置对象；也是定义中唯一无损 round-trip 的部分。缺失或 null 时规范化为 `{}`。
        unit:
          type: string
          enum:
            - unitless
            - ratio
            - percent
            - milliseconds
            - seconds
            - bytes
            - bits
            - count_per_second
            - bytes_per_second
            - bits_per_second
          description: >-
            面板数值的展示单位：`unitless` = 原始数值；`ratio` = 占比（0–1 的小数）；`percent` =
            百分比；`milliseconds` = 毫秒；`seconds` = 秒；`bytes` = 字节；`bits` =
            比特；`count_per_second` = 每秒计数；`bytes_per_second` =
            每秒字节数；`bits_per_second` = 每秒比特数。
        decimals:
          type:
            - integer
            - 'null'
          minimum: 0
          description: 固定小数位；省略或传 null 由前端决定。
        threshold:
          $ref: '#/components/schemas/DashboardThreshold'
      required:
        - kind
        - options
    DashboardTableViz:
      type: object
      description: 表格可视化。
      properties:
        kind:
          type: string
          enum:
            - table
          description: 可视化类型判别字段，固定为 `table`。
        options:
          type: object
          additionalProperties: true
          description: 所选可视化类型的开放配置对象；也是定义中唯一无损 round-trip 的部分。缺失或 null 时规范化为 `{}`。
        column_options:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/DashboardColumnOption'
          description: 按字段名索引的列展示覆盖配置，最多 100 项。
        sort:
          type: array
          items:
            $ref: '#/components/schemas/DashboardFieldSort'
          maxItems: 2
          description: 初始排序键；字段需唯一。
        link_columns:
          type: array
          items:
            $ref: '#/components/schemas/DashboardDataLink'
          maxItems: 5
          description: 以表格列形式渲染的下钻链接。与列级链接合计最多 5 个。
      required:
        - kind
        - options
    DashboardStatViz:
      type: object
      description: 单值（stat）可视化。
      properties:
        kind:
          type: string
          enum:
            - stat
          description: 可视化类型判别字段，固定为 `stat`。
        options:
          type: object
          additionalProperties: true
          description: 所选可视化类型的开放配置对象；也是定义中唯一无损 round-trip 的部分。缺失或 null 时规范化为 `{}`。
        unit:
          type: string
          enum:
            - unitless
            - ratio
            - percent
            - milliseconds
            - seconds
            - bytes
            - bits
            - count_per_second
            - bytes_per_second
            - bits_per_second
          description: >-
            面板数值的展示单位：`unitless` = 原始数值；`ratio` = 占比（0–1 的小数）；`percent` =
            百分比；`milliseconds` = 毫秒；`seconds` = 秒；`bytes` = 字节；`bits` =
            比特；`count_per_second` = 每秒计数；`bytes_per_second` =
            每秒字节数；`bits_per_second` = 每秒比特数。
        decimals:
          type:
            - integer
            - 'null'
          minimum: 0
          description: 固定小数位；省略或传 null 由前端决定。
        threshold:
          $ref: '#/components/schemas/DashboardThreshold'
        value_fields:
          type: array
          items:
            type: string
          description: 被归约为展示取值的字段。
        reducer:
          type: string
          enum:
            - last_non_null
            - min
            - max
            - mean
            - sum
          description: >-
            对返回行应用的归约方式：`last_non_null` = 最近的非空值；`min` = 最小值；`max` = 最大值；`mean`
            = 平均值；`sum` = 求和。
      required:
        - kind
        - options
        - value_fields
        - reducer
    DashboardBarViz:
      type: object
      description: 柱状图可视化。
      properties:
        kind:
          type: string
          enum:
            - bar
          description: 可视化类型判别字段，固定为 `bar`。
        options:
          type: object
          additionalProperties: true
          description: 所选可视化类型的开放配置对象；也是定义中唯一无损 round-trip 的部分。缺失或 null 时规范化为 `{}`。
        unit:
          type: string
          enum:
            - unitless
            - ratio
            - percent
            - milliseconds
            - seconds
            - bytes
            - bits
            - count_per_second
            - bytes_per_second
            - bits_per_second
          description: >-
            面板数值的展示单位：`unitless` = 原始数值；`ratio` = 占比（0–1 的小数）；`percent` =
            百分比；`milliseconds` = 毫秒；`seconds` = 秒；`bytes` = 字节；`bits` =
            比特；`count_per_second` = 每秒计数；`bytes_per_second` =
            每秒字节数；`bits_per_second` = 每秒比特数。
        decimals:
          type:
            - integer
            - 'null'
          minimum: 0
          description: 固定小数位；省略或传 null 由前端决定。
        threshold:
          $ref: '#/components/schemas/DashboardThreshold'
        category_field:
          type: string
          description: 提供类目轴的字段。
        value_fields:
          type: array
          items:
            type: string
          description: 提供柱值的字段。
        data_link:
          $ref: '#/components/schemas/DashboardDataLink'
      required:
        - kind
        - options
        - category_field
        - value_fields
    DashboardGaugeViz:
      type: object
      description: 仪表盘（gauge）可视化。
      properties:
        kind:
          type: string
          enum:
            - gauge
          description: 可视化类型判别字段，固定为 `gauge`。
        options:
          type: object
          additionalProperties: true
          description: 所选可视化类型的开放配置对象；也是定义中唯一无损 round-trip 的部分。缺失或 null 时规范化为 `{}`。
        unit:
          type: string
          enum:
            - unitless
            - ratio
            - percent
            - milliseconds
            - seconds
            - bytes
            - bits
            - count_per_second
            - bytes_per_second
            - bits_per_second
          description: >-
            面板数值的展示单位：`unitless` = 原始数值；`ratio` = 占比（0–1 的小数）；`percent` =
            百分比；`milliseconds` = 毫秒；`seconds` = 秒；`bytes` = 字节；`bits` =
            比特；`count_per_second` = 每秒计数；`bytes_per_second` =
            每秒字节数；`bits_per_second` = 每秒比特数。
        decimals:
          type:
            - integer
            - 'null'
          minimum: 0
          description: 固定小数位；省略或传 null 由前端决定。
        threshold:
          $ref: '#/components/schemas/DashboardThreshold'
        value_fields:
          type: array
          items:
            type: string
          description: 被归约为仪表值的字段。
        reducer:
          type: string
          enum:
            - last_non_null
            - min
            - max
            - mean
            - sum
          description: >-
            对返回行应用的归约方式：`last_non_null` = 最近的非空值；`min` = 最小值；`max` = 最大值；`mean`
            = 平均值；`sum` = 求和。
        min:
          type:
            - number
            - 'null'
          description: 刻度下限。
        max:
          type:
            - number
            - 'null'
          description: 刻度上限；两者都设置时必须大于 `min`。
      required:
        - kind
        - options
        - value_fields
        - reducer
    DashboardLogsViz:
      type: object
      description: 日志流可视化。
      properties:
        kind:
          type: string
          enum:
            - logs
          description: 可视化类型判别字段，固定为 `logs`。
        options:
          type: object
          additionalProperties: true
          description: 所选可视化类型的开放配置对象；也是定义中唯一无损 round-trip 的部分。缺失或 null 时规范化为 `{}`。
        display_fields:
          type: array
          items:
            type: string
          description: 每行渲染的日志字段。
      required:
        - kind
        - options
    DashboardTextViz:
      type: object
      description: Markdown 文本面板。
      properties:
        kind:
          type: string
          enum:
            - text
          description: 可视化类型判别字段，固定为 `text`。
        options:
          type: object
          additionalProperties: true
          description: 所选可视化类型的开放配置对象；也是定义中唯一无损 round-trip 的部分。缺失或 null 时规范化为 `{}`。
        markdown:
          type: string
          maxLength: 65536
          description: Markdown 正文，最多 64 KiB。仅限白名单节点（标题、列表、表格、链接、代码）可通过校验。
      required:
        - kind
        - options
        - markdown
    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
    DashboardThreshold:
      type: object
      description: 数值的颜色阈值。`warning`/`critical` 至少设置一个；两者都设置时需按 `mode` 满足大小关系。
      properties:
        mode:
          type: string
          enum:
            - higher_is_worse
            - lower_is_worse
          description: 比较方向：`higher_is_worse` = 值高于等于边界即为越限；`lower_is_worse` = 值低于等于边界即为越限。
        warning:
          type:
            - number
            - 'null'
          description: 警告阈值；需为有限数。
        critical:
          type:
            - number
            - 'null'
          description: 严重阈值；需为有限数。
      required:
        - mode
    DashboardColumnOption:
      type: object
      description: 表格中按列的展示覆盖配置。
      properties:
        display_name:
          type: string
          description: 替换原始字段名的表头文案。
        hidden:
          type:
            - boolean
            - 'null'
          description: 隐藏该列；省略表示保持可见。
        width_px:
          type:
            - integer
            - 'null'
          minimum: 80
          maximum: 1200
          description: 列宽（像素），80～1200。
        unit:
          type: string
          enum:
            - unitless
            - ratio
            - percent
            - milliseconds
            - seconds
            - bytes
            - bits
            - count_per_second
            - bytes_per_second
            - bits_per_second
          description: >-
            列展示单位覆盖：`unitless` = 原始数值；`ratio` = 占比（0–1 的小数）；`percent` =
            百分比；`milliseconds` = 毫秒；`seconds` = 秒；`bytes` = 字节；`bits` =
            比特；`count_per_second` = 每秒计数；`bytes_per_second` =
            每秒字节数；`bits_per_second` = 每秒比特数。
        threshold:
          $ref: '#/components/schemas/DashboardThreshold'
        threshold_display:
          type: string
          enum:
            - text
            - background
          description: 阈值的呈现方式：`text` = 为单元格文本着色；`background` = 为单元格背景着色。
        data_link:
          $ref: '#/components/schemas/DashboardDataLink'
    DashboardFieldSort:
      type: object
      description: 单个排序键。
      properties:
        field:
          type: string
          minLength: 1
          description: 排序字段名。
        direction:
          type: string
          enum:
            - asc
            - desc
          description: 排序方向：`asc` = 升序；`desc` = 降序。
      required:
        - field
        - direction
    DashboardDataLink:
      type: object
      description: 从表格列或柱状图面板下钻到另一个仪表盘的链接。目标仪表盘必须存在，且映射来源需与源面板的结构匹配。
      properties:
        dashboard_id:
          type: string
          pattern: >-
            ^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
          description: 目标仪表盘 ID。
        target_id:
          type: string
          pattern: >-
            ^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
          description: 可选的目标 tab/section/panel ID，用于在目标仪表盘中定位。
        pass_time:
          type: boolean
          description: 为 true 时把当前时间范围传递到目标仪表盘。
        variable_mappings:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/DashboardLinkMapping'
          description: 把目标变量名映射到某个来源值，例如表格列或源变量。
      required:
        - dashboard_id
        - pass_time
        - variable_mappings
    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
    DashboardLinkMapping:
      type: object
      description: 下钻变量映射中的一项。
      properties:
        source:
          type: string
          enum:
            - variable
            - row_column
            - category
            - series
            - value
          description: >-
            取值来源：`variable` = 仪表盘变量；`row_column` = 表格列（必须同时给出
            `column`）；`category` = 柱状图的类目；`series` = 序列名；`value` =
            数值本身。`category`、`series`、`value` 仅对柱状图面板有效。
        column:
          type: string
          description: 来源列名；`source` 为 `row_column` 时必填。
        name:
          type: string
          description: 来源仪表盘变量名；`source` 为 `variable` 时必填。
      required:
        - source
  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.
    Forbidden:
      description: app_key 有效但没有执行该操作的权限。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            noEditPermission:
              value:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                error:
                  code: AccessDenied
                  message: Access Denied.
    NotFound:
      description: >-
        目标资源不存在或已被删除。注意：Flashduty 对业务实体的缺失通常返回 HTTP 400 +
        code=`ResourceNotFound`，真正的 404 只用于未知路由。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            resourceMissing:
              value:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                error:
                  code: ResourceNotFound
                  message: The resource you request is not found
    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
        时都必须携带。它等同于所属账户的身份凭证，请妥善保管。

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.