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

# 查询投递到协作空间的共享集成路由

> 查询所有会向某个协作空间投递的共享集成，以及在路由上命中该空间的分支。

## 限制说明

| 项目 | 说明 |
| - | - |
| 速率限制 | 每个账户 **1,000 次/分钟**；**50 次/秒** |
| 权限要求 | **Channels 查看**（`on-call`）或 **Channels 管理**（`on-call`）或 **Integrations 查看**（`on-call`） |

## 使用说明

* 调用方必须能读取所查协作空间；不是成员且为私有协作空间时返回 `AccessDenied`。
* `matched` 与 `other_cases` 合起来覆盖路由的全部分支：`other_cases` 是投递到别处的标准分支，只暴露匹配条件、不暴露目标协作空间，避免调用方看到隐藏分支的投递去向。默认路由若也投递到该协作空间，会出现在 `matched` 中，且不计入 `total_cases`。
* `unreachable_by` 标记「永远不可能命中」的分支：因为更早的分支总是先命中。排查「为什么某个规则生效了」时很有用。
* 同一集成若向多个协作空间投递，按查询的协作空间分别返回，只展示属于该空间的分支。


## OpenAPI

````yaml /api-reference/on-call.openapi.zh.json post /channel/inbound-route/list
openapi: 3.1.0
info:
  title: Flashduty 开放 API
  description: >-
    Flashduty 事件管理平台的公开 HTTP API —— 覆盖故障、通知模板、协作空间、值班排班、监控、RUM、以及平台管理。每次调用都需在
    query 中携带 `app_key`，该 key 在 Flashduty 控制台 我的 → APP Key 中创建（也可放在请求头
    `Fd-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: On-call/故障管理
    description: ''
  - name: On-call/协作空间
    description: ''
  - name: On-call/告警管理
    description: 查询、查看和处理告警，管理卡片视图与告警处理规则。
  - name: On-call/集成中心
    description: ''
  - name: On-call/IM 集成
    description: IM 集成相关查询，例如查看哪些集成开启了作战室。
  - name: On-call/值班排班
    description: ''
  - name: On-call/许可管理
    description: ''
  - name: On-call/日历管理
    description: ''
  - name: On-call/通知模板
    description: ''
  - name: On-call/标签增强
    description: 自定义字段、富化规则及数据映射（映射规则、映射数据、映射 API）管理。
  - name: On-call/分析看板
    description: ''
  - name: On-call/状态页
    description: ''
  - name: On-call/变更管理
    description: ''
  - name: On-call/专属集成
    description: 管理各协作空间的专属告警集成。
paths:
  /channel/inbound-route/list:
    post:
      tags:
        - On-call/协作空间
      summary: 查询投递到协作空间的共享集成路由
      description: 查询所有会向某个协作空间投递的共享集成，以及在路由上命中该空间的分支。
      operationId: channel-inbound-route-read-list
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InboundRouteListRequest'
            example:
              channel_id: 5001
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessEnvelope'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/ListInboundRoutesResponse'
              example:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                data:
                  items:
                    - integration_id: 362
                      integration_name: Prometheus Prod
                      plugin_type: prometheus
                      plugin_type_name: Prometheus
                      integration_status: enabled
                      route_version: 12
                      route_updated_at: 1716958800
                      total_cases: 2
                      matched:
                        - kind: case
                          index: 0
                          if:
                            and:
                              - key: severity
                                oper: in
                                values:
                                  - Critical
                          fallthrough: false
                          match_type: static
                          channel_ids:
                            - 5001
                          channels:
                            - channel_id: 5001
                              channel_name: Production
                              status: enabled
                      other_cases:
                        - index: 1
                          fallthrough: false
                          if:
                            and:
                              - key: team
                                oper: '=='
                                values:
                                  - payments
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    InboundRouteListRequest:
      type: object
      required:
        - channel_id
      properties:
        channel_id:
          type: integer
          format: int64
          description: 要查询共享集成路由的协作空间 ID。
    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: 接口返回的数据，格式见各接口的 200 响应。没有返回数据的接口会返回 `{}` 或完全不带 `data`。
      required:
        - request_id
    ListInboundRoutesResponse:
      type: object
      required:
        - items
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/InboundRouteItem'
          description: 至少有一个分支投递到该协作空间的共享集成；没有任何集成投递时为空数组。
    InboundRouteItem:
      type: object
      description: 路由可以把告警投递到所查协作空间的一个共享集成。
      required:
        - integration_id
        - integration_name
        - plugin_type
        - plugin_type_name
        - integration_status
        - route_version
        - route_updated_at
        - total_cases
        - matched
        - other_cases
      properties:
        integration_id:
          type: integer
          format: int64
          description: 共享集成（数据源）ID。
        integration_name:
          type: string
          description: 共享集成名称。
        plugin_type:
          type: string
          description: 集成的插件类型，例如 `prometheus`。
        plugin_type_name:
          type: string
          description: 调用方语言下该插件类型的展示名。
        integration_status:
          type: string
          description: 集成状态，`enabled` 或 `disabled`。
        route_version:
          type: integer
          format: int64
          description: 该集成路由配置的版本号。
        route_updated_at:
          type: integer
          format: int64
          description: 路由配置最后一次变更的时刻，Unix 时间戳（秒）。
        total_cases:
          type: integer
          description: 该路由的条件分支数量，不含默认路由。
        matched:
          type: array
          items:
            $ref: '#/components/schemas/InboundRouteBranch'
          description: 投递到所查协作空间的分支，若默认路由也投递到该空间则一并返回。
        other_cases:
          type: array
          items:
            $ref: '#/components/schemas/InboundRouteOtherCase'
          description: 不投递到所查协作空间的条件分支；它与 `matched` 合起来覆盖全部分支。
    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
    InboundRouteBranch:
      type: object
      description: 共享集成路由中投递到所查协作空间的一个分支。
      required:
        - kind
        - fallthrough
        - match_type
        - channels
      properties:
        kind:
          type: string
          enum:
            - case
            - default
          description: 分支类型：`case` 条件分支、`default` 默认路由。
        index:
          type: integer
          description: 条件分支的序号（从 0 开始）；默认路由不返回。
        if:
          type: object
          additionalProperties: true
          description: 该条件分支保存在路由上的匹配条件（决定哪些告警命中该分支的过滤器树）；默认路由不返回。
        fallthrough:
          type: boolean
          description: 命中后是否继续匹配后续分支，而非在首个命中处停止。
        routing_mode:
          type: string
          enum:
            - standard
            - name_mapping
          description: >-
            该分支确定投递目标的方式：`standard` 按分支自身的协作空间投递，`name_mapping` 把告警标签映射到协作空间名称。为
            `standard` 时不返回。
        name_mapping_label:
          type: string
          description: '`name_mapping` 模式下用其取值匹配协作空间名称的告警标签；其他情况不返回。'
        match_type:
          type: string
          enum:
            - static
            - dynamic
          description: 分支协作空间列表的解析方式：`static` 固定协作空间 ID，`dynamic` 在告警到达时解析。
        channel_ids:
          type: array
          items:
            type: integer
            description: 协作空间 ID。
            format: int64
          description: 分支投递到的协作空间 ID（未解析名称）；为空时不返回。
        channels:
          type: array
          items:
            $ref: '#/components/schemas/ChannelShort'
          description: 分支投递到的协作空间及其名称。
        unreachable_by:
          type: integer
          description: 更早某个分支只要该分支会命中就必定命中，因此该分支永远不会触发；该分支可命中或无法判定时不返回。默认路由不会设置。
    InboundRouteOtherCase:
      type: object
      description: 路由中不投递到所查协作空间的一个标准条件分支。
      required:
        - index
        - fallthrough
        - if
      properties:
        index:
          type: integer
          description: 条件分支的序号（从 0 开始）。
        fallthrough:
          type: boolean
          description: 命中后是否继续匹配后续分支。
        if:
          type: object
          additionalProperties: true
          description: 该条件分支的匹配条件，供调用方构造 NOT 链；隐藏分支投递到的协作空间被刻意省略。
    DutyError:
      type: object
      description: 响应结构中的错误 payload，仅在非 2xx 响应时出现。
      properties:
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
          description: >-
            按响应语言（query 参数 `locale` / `lang` 或请求头
            `Accept-Language`）返回的错误描述，可能包含出错的字段名，请不要解析它。
          example: The specified parameter template_id is not valid.
      required:
        - code
        - message
    ChannelShort:
      type: object
      required:
        - channel_id
        - channel_name
      properties:
        channel_id:
          type: integer
          format: int64
          description: 协作空间 ID，为请求的 `channel_ids` 之一。
        channel_name:
          type: string
          description: 协作空间名称，账户内唯一。
        status:
          type: string
          enum:
            - enabled
            - disabled
            - deleted
          description: |-
            协作空间状态：
            - `enabled`：正常处理新进入的告警事件。
            - `disabled`：新进入的告警事件被丢弃。
            - `deleted`：已删除。
    ErrorCode:
      type: string
      description: >-
        错误码。所有失败响应都会把 `error.code` 设为下列稳定字符串之一，请以它而不是 HTTP 状态码做判断。


        | 错误码 | HTTP | 含义 |

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

        | `OK` | 200 | 保留值，失败的请求不会返回。 |

        | `InvalidParameter` | 400 | 参数缺失、类型错误或未通过校验，`message` 通常会指出字段名。 |

        | `BadRequest` | 400 | 请求违反业务规则或与对象当前状态冲突，`message` 会说明原因。 |

        | `InvalidContentType` | 400 | 请求体没有以 `application/json` 发送。 |

        | `ResourceNotFound` | 400 | 引用的对象在本账户中不存在或已删除。注意 HTTP 状态码是 400 而不是 404。
        |

        | `NoLicense` | 400 | 账户套餐不包含该功能、套餐配额已用完、套餐已过期或额度不足。 |

        | `ReferenceExist` | 400 | 对象仍被其他对象引用，无法删除。 |

        | `Unauthorized` | 401 | APP Key 缺失、无效或已删除。 |

        | `BalanceNotEnough` | 402 | 仅用于控制台计费流程，Open API 接口不会返回。 |

        | `AccessDenied` | 403 | APP Key 的权限范围或创建者角色不允许该操作或该对象。 |

        | `RouteNotFound` | 404 | 没有与该 HTTP 方法和路径匹配的接口。 |

        | `MethodNotAllowed` | 405 | 路径存在，但不支持该 HTTP 方法。 |

        | `UndonedOrderExist` | 409 | 仅用于控制台计费流程，Open API 接口不会返回。 |

        | `EntityTooLarge` | 413 | 请求体超出大小限制。 |

        | `RequestLocked` | 423 | 仅用于控制台登录保护，Open API 接口不会返回。 |

        | `RequestVerifyRequired` | 428 | 仅用于控制台验证码流程，Open API 接口不会返回。 |

        | `DangerousOperation` | 428 | 仅用于控制台高风险操作的 MFA 校验，Open API 接口不会返回。 |

        | `RequestTooFrequently` | 429 | 触发频率限制；请等待响应头
        `Flashcat-Request-Rate-Limit-Delay` 给出的秒数后再重试。 |

        | `InternalError` | 500 | 服务端意外错误；请退避后重试，反馈问题时附上 `request_id`。 |

        | `ServiceUnavailable` | 503 | 后端依赖过载或不可用，请退避后重试。 |
      enum:
        - OK
        - InvalidParameter
        - BadRequest
        - InvalidContentType
        - ResourceNotFound
        - NoLicense
        - ReferenceExist
        - Unauthorized
        - BalanceNotEnough
        - AccessDenied
        - RouteNotFound
        - MethodNotAllowed
        - UndonedOrderExist
        - EntityTooLarge
        - RequestLocked
        - RequestVerifyRequired
        - DangerousOperation
        - RequestTooFrequently
        - InternalError
        - ServiceUnavailable
      x-enumDescriptions:
        OK: 保留值，失败的请求不会返回。
        InvalidParameter: 参数缺失、类型错误或未通过校验，`message` 通常会指出字段名。
        BadRequest: 请求违反业务规则或与对象当前状态冲突，`message` 会说明原因。
        InvalidContentType: 请求体没有以 `application/json` 发送。
        ResourceNotFound: 引用的对象在本账户中不存在或已删除。注意 HTTP 状态码是 400 而不是 404。
        NoLicense: 账户套餐不包含该功能、套餐配额已用完、套餐已过期或额度不足。
        ReferenceExist: 对象仍被其他对象引用，无法删除。
        Unauthorized: APP Key 缺失、无效或已删除。
        BalanceNotEnough: 仅用于控制台计费流程，Open API 接口不会返回。
        AccessDenied: APP Key 的权限范围或创建者角色不允许该操作或该对象。
        RouteNotFound: 没有与该 HTTP 方法和路径匹配的接口。
        MethodNotAllowed: 路径存在，但不支持该 HTTP 方法。
        UndonedOrderExist: 仅用于控制台计费流程，Open API 接口不会返回。
        EntityTooLarge: 请求体超出大小限制。
        RequestLocked: 仅用于控制台登录保护，Open API 接口不会返回。
        RequestVerifyRequired: 仅用于控制台验证码流程，Open API 接口不会返回。
        DangerousOperation: 仅用于控制台高风险操作的 MFA 校验，Open API 接口不会返回。
        RequestTooFrequently: 触发频率限制；请等待响应头 `Flashcat-Request-Rate-Limit-Delay` 给出的秒数后再重试。
        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.
    Forbidden:
      description: app_key 有效，但其权限范围或创建者角色不允许该操作或该对象。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            noEditPermission:
              value:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                error:
                  code: AccessDenied
                  message: Access Denied.
    TooManyRequests:
      description: 触发频率限制。请等待响应头 `Flashcat-Request-Rate-Limit-Delay` 给出的秒数后重试。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            rateLimited:
              value:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                error:
                  code: RequestTooFrequently
                  message: Request too frequently.
      headers:
        Flashcat-Request-Rate-Limit-Delay:
          description: 距当前限流窗口重置的秒数。请求被网关全局保护限流拒绝时不返回该响应头。
          schema:
            type: integer
            minimum: 0
    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。可通过 query 参数 `app_key` 或请求头
        `Fd-App-Key` 传入。实际可访问范围是该 APP Key 的权限范围与创建者当前角色权限的交集，请妥善保管。

````

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