> ## 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 次/秒** |
| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用      |


## OpenAPI

````yaml /api-reference/on-call.openapi.zh.json post /channel/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: 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: 自定义字段、富化规则及数据映射（映射规则、映射数据、映射 API）管理。
  - name: On-call/分析看板
    description: ''
  - name: On-call/状态页
    description: ''
  - name: On-call/变更管理
    description: ''
paths:
  /channel/list:
    post:
      tags:
        - On-call/协作空间
      summary: 查询协作空间列表
      description: 查询当前用户可访问的协作空间列表，支持过滤条件。
      operationId: channelList
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ListChannelsRequest'
            example:
              p: 1
              limit: 20
              orderby: created_at
              asc: false
      responses:
        '200':
          description: 成功
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessEnvelope'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/ListChannelsResponse'
              example:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                data:
                  total: 42
                  has_next_page: true
                  items:
                    - channel_id: 1001
                      channel_name: Production Alerts
                      status: enabled
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    ListChannelsRequest:
      type: object
      properties:
        p:
          type: integer
          minimum: 1
          description: 页码，从 1 开始。
        limit:
          type: integer
          minimum: 1
          maximum: 100
          default: 100
          description: 每页大小，未传时默认为 100。
        orderby:
          type: string
          enum:
            - ranking
            - created_at
            - updated_at
            - channel_name
            - last_incident_at
          description: 排序字段。
        asc:
          type: boolean
          description: 为 true 时升序排序。
        is_my_managed:
          type: boolean
          description: 为 true 时仅返回当前用户可管理的协作空间。
        is_my_starred:
          type: boolean
          description: 为 true 时仅返回当前用户收藏的协作空间，与 `is_my_team` 互斥。
        is_brief:
          type: boolean
          description: 为 true 时仅返回简要字段（`channel_id`、`channel_name`、`description`、`status`）。
        is_my_team:
          type: boolean
          description: 为 true 时仅返回当前用户所在团队持有的协作空间，与 `is_my_starred` 互斥。
        team_ids:
          type: array
          items:
            type: integer
            format: int64
          description: 按团队 ID 过滤。
        query:
          type: string
          description: 按名称/描述的全文查询串。
        channel_ids:
          type: array
          items:
            type: integer
            format: int64
          description: 按指定协作空间 ID 过滤。
        channel_name:
          type: string
          description: 协作空间名称精确匹配，优先级高于 `query` 的名称过滤。
    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
    ListChannelsResponse:
      type: object
      required:
        - items
        - total
        - has_next_page
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/ChannelItem'
        total:
          type: integer
          format: int64
          description: 匹配到的协作空间总数。
        has_next_page:
          type: boolean
          description: 是否还有下一页。
    ChannelItem:
      type: object
      description: 协作空间详情记录，所有字段可选，仅在有值时返回。
      properties:
        channel_id:
          type: integer
          format: int64
          description: 协作空间 ID。
        team_id:
          type: integer
          format: int64
          description: 所属团队 ID。
        team_name:
          type: string
          description: 所属团队名称（由团队目录解析；无法解析时为空）。
        managing_team_ids:
          type: array
          items:
            type: integer
            format: int64
          description: 可管理该协作空间的其他团队 ID 列表。
        creator_id:
          type: integer
          format: int64
          description: 创建者成员 ID。
        creator_name:
          type: string
          description: 创建者成员名称（由成员目录解析；无法解析时为空）。
        account_id:
          type: integer
          format: int64
          description: 所属账户 ID。
        channel_name:
          type: string
          description: 协作空间名称。
        description:
          type: string
          description: 描述信息。
        status:
          type: string
          enum:
            - enabled
            - disabled
            - deleted
          description: 协作空间状态。
        deleted_at:
          type: integer
          format: int64
          description: 删除时间（Unix 秒），仅软删除的协作空间非零。
        created_at:
          type: integer
          format: int64
          description: 创建时间（Unix 秒）。
        updated_at:
          type: integer
          format: int64
          description: 最近更新时间（Unix 秒）。
        auto_resolve_timeout:
          type: integer
          format: int64
          description: 自动恢复超时，单位秒。0 表示不自动恢复。
        auto_resolve_mode:
          type: string
          enum:
            - trigger
            - update
          description: 自动恢复计时重置方式。
        is_private:
          type: boolean
          description: 为 true 时仅管理团队可见。
        disable_outlier_detection:
          type: boolean
          description: 为 true 时禁用新奇故障检测。
        disable_auto_close:
          type: boolean
          description: 为 true 时禁用故障自动关闭。
        group:
          $ref: '#/components/schemas/Group'
        flapping:
          $ref: '#/components/schemas/Flapping'
        progress_to_incident_cnts:
          $ref: '#/components/schemas/IncProgressCnts'
        is_starred:
          type: boolean
          description: 当前用户是否已收藏该协作空间。
        active_incident_highest_severity:
          type: string
          description: 协作空间内活跃故障的最高严重程度。
        last_incident_at:
          type: integer
          format: int64
          description: 最近一次故障时间（Unix 秒）。
        is_external_report_enabled:
          type: boolean
          description: 是否允许外部上报人向该协作空间上报故障。
        external_report_token:
          type: string
          description: 启用外部上报时授予外部上报人的 token。
    ErrorResponse:
      type: object
      description: 错误响应结构。`error` 必填，`data` 不存在。
      properties:
        request_id:
          type: string
          example: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
        error:
          $ref: '#/components/schemas/DutyError'
      required:
        - request_id
        - error
    Group:
      type: object
      description: 告警聚合配置。
      required:
        - method
      properties:
        method:
          type: string
          enum:
            - i
            - p
            - 'n'
          description: 聚合方式：`i` 智能、`p` 规则、`n` 不聚合。
        equals:
          type: array
          items:
            type: array
            items:
              type: string
          maxItems: 5
          description: 用于聚合判定的 label 键分组。
        cases:
          type: array
          maxItems: 100
          description: 按过滤条件的聚合策略覆盖。
          items:
            type: object
        all_equals_required:
          type: boolean
          description: 为 true 时要求所有键同时存在才能参与聚合。
        time_window:
          type: integer
          minimum: 0
          description: 聚合时间窗口，单位分钟。默认最大值为 1440 分钟（24 小时）；开启扩展功能的账号最大可设置 43200 分钟（30 天）。
        window_type:
          type: string
          enum:
            - tumbling
            - sliding
          description: 窗口类型，默认 `tumbling`。
        storm_threshold:
          type: integer
          minimum: 0
          maximum: 10000
          description: 告警风暴阈值。
        storm_thresholds:
          type: array
          items:
            type: integer
          maxItems: 5
          description: 多级告警风暴阈值。
        i_keys:
          type: array
          items:
            type: string
          maxItems: 10
          description: 用于智能聚合向量化的 label 键。
        i_score_threshold:
          type: number
          format: float
          minimum: 0.5
          maximum: 1
          description: 智能聚合相似度阈值。
    Flapping:
      type: object
      description: 抖动检测配置。
      properties:
        is_disabled:
          type: boolean
          description: 禁用抖动检测。
        max_changes:
          type: integer
          minimum: 2
          maximum: 100
          description: '`in_mins` 内允许的最大状态变更次数。'
        in_mins:
          type: integer
          minimum: 1
          maximum: 1440
          description: 观察窗口，单位分钟。
        mute_mins:
          type: integer
          minimum: 0
          maximum: 1440
          description: 检测到抖动后的静音时长，单位分钟。
    IncProgressCnts:
      type: object
      required:
        - Triggered
        - Processing
      properties:
        Triggered:
          type: integer
          format: int64
          description: 近 30 天触发中的故障数量。
        Processing:
          type: integer
          format: int64
          description: 近 30 天处理中的故障数量。
    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
    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
        时都必须携带。它等同于所属账户的身份凭证，请妥善保管。

````