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

# 查询知识包列表

> 查询调用者可见的账户与团队范围知识包列表。

## 限制说明

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

## 使用说明

* 可见性与控制台一致：管理员可见账户包及全部团队包；非管理员可见账户包及所属团队包，传入的 `team_ids` 会被静默过滤为其所属团队。
* `scope` 用于选择 `all`（默认）、仅 `account` 或仅 `team`，会覆盖 `include_account`。
* `query` 对知识包 ID、范围和团队名称做大小写不敏感的子串过滤；`p`/`limit` 对过滤结果分页。


## OpenAPI

````yaml /api-reference/safari.openapi.zh.json post /safari/knowledge/pack/list
openapi: 3.1.0
info:
  title: Flashduty 开放 API
  description: >-
    Flashduty AI SRE 平台的公开 HTTP API —— 技能、MCP 服务器（连接器）、A2A 智能体与会话。所有接口均使用
    Flashduty 控制台签发的 `app_key` 查询参数进行认证。
  version: 1.0.0
servers:
  - url: https://api.flashcat.cloud
    description: Flashduty Open API
security:
  - AppKeyAuth: []
tags:
  - name: AI SRE/技能
    description: AI SRE 智能体技能管理。
  - name: AI SRE/MCP 服务器
    description: MCP（Model Context Protocol）服务器管理。
  - name: AI SRE/A2A 智能体
    description: A2A（智能体到智能体）远程智能体管理。
  - name: AI SRE/会话
    description: AI SRE 智能体会话历史 —— 查询、查看与导出会话记录。
  - name: AI SRE/自动化
  - name: AI SRE/知识
paths:
  /safari/knowledge/pack/list:
    post:
      tags:
        - AI SRE/知识
      summary: 查询知识包列表
      description: 查询调用者可见的账户与团队范围知识包列表。
      operationId: knowledge-pack-read-list
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/KnowledgePackListRequest'
            example:
              p: 1
              limit: 20
              scope: all
              include_account: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ResponseEnvelope'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/KnowledgePackListResponse'
              example:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                data:
                  packs:
                    - pack_id: kpk_kE49k3FhecfJBwutbshEEc
                      account_id: 2451002751131
                      scope: account
                      scope_id: 2451002751131
                      file_count: 17
                      total_bytes: 41010
                      version: 134
                      created_by: 2476444212131
                      created_at_ms: 1778768680053
                      updated_at_ms: 1786456567177
                      can_edit: true
                    - pack_id: kpk_5qRL34nKtoWM4nQVT2kHzy
                      account_id: 2451002751131
                      scope: team
                      scope_id: 2477033058131
                      team_name: 研发团队
                      file_count: 4
                      total_bytes: 11159
                      version: 15
                      created_by: 2476444212131
                      created_at_ms: 1782201586089
                      updated_at_ms: 1785462092702
                      can_edit: true
                  total: 3
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      security:
        - AppKeyAuth: []
components:
  schemas:
    KnowledgePackListRequest:
      type: object
      description: 知识包列表的过滤与分页参数。
      properties:
        p:
          type: integer
          description: 页码，从 1 开始；`p` 与 `limit` 均未设置时返回全部结果。
        limit:
          type: integer
          description: 每页条数。
        scope:
          type: string
          description: >-
            限定范围；`all`（默认）会覆盖 `include_account`。可选值：`all`（账户范围 +
            可见团队范围）、`account`（仅账户级知识包）、`team`（仅团队级知识包，可配合 `team_ids` 过滤）。
          enum:
            - all
            - account
            - team
        query:
          type: string
          description: 对知识包 ID、范围和团队名称做大小写不敏感的子串过滤。
          maxLength: 128
        team_ids:
          type: array
          description: 限定团队 ID；非管理员会与其所属团队取交集。
          items:
            type: integer
            format: int64
        include_account:
          type:
            - boolean
            - 'null'
          description: 是否包含账户范围的知识包；默认为 true。
    ResponseEnvelope:
      type: object
      description: >-
        Standard response envelope used by every Flashduty public API. On
        success `data` contains the endpoint-specific payload and `error` is
        absent. On failure `error` is present and `data` is absent. `request_id`
        is always present and is also mirrored in the `Flashcat-Request-Id`
        response header.
      properties:
        request_id:
          type: string
          description: >-
            Unique ID for this request. Mirrored in the Flashcat-Request-Id
            header. Include it when reporting issues.
          example: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
        error:
          $ref: '#/components/schemas/DutyError'
        data:
          description: Endpoint-specific payload. See each operation's 200 response schema.
      required:
        - request_id
    KnowledgePackListResponse:
      type: object
      description: 可见的知识包及过滤后的总数。
      properties:
        packs:
          type: array
          items:
            $ref: '#/components/schemas/KnowledgePackItem'
          description: 过滤后当前可见的知识包数组（当前页），与 `total` 配合分页。
        total:
          type: integer
          description: 过滤后、分页前的知识包总数。
          format: int64
      required:
        - packs
        - total
    DutyError:
      type: object
      description: >-
        Error payload inside the response envelope. Present only on non-2xx
        responses.
      properties:
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
          description: >-
            Human-readable error message, localized by the caller's
            Accept-Language. May contain field names, IDs, or other context from
            the failing request.
      required:
        - code
        - message
    KnowledgePackItem:
      type: object
      description: 知识包——一棵带版本号的文件树，AI SRE 会话启动时会注入到每个沙箱中。每个（账户, scope, scope_id）仅有一个知识包。
      properties:
        pack_id:
          type: string
          description: 知识包 ID（`kpk_` 前缀）。
        account_id:
          type: integer
          description: 知识包所属账户 ID。
          format: int64
        scope:
          type: string
          description: 知识包范围；`channel` 为历史遗留范围，新建知识包为 `account` 或 `team`。
          enum:
            - account
            - team
            - channel
        scope_id:
          type: integer
          description: 范围归属 ID：账户范围为账户 ID，团队范围为团队 ID。
          format: int64
        team_name:
          type: string
          description: 所属团队的显示名称（仅团队范围）；账户范围为空。
        file_count:
          type: integer
          description: 包内文件数量。
        total_bytes:
          type: integer
          description: 包内所有文件的总字节数。
          format: int64
        version:
          type: integer
          description: 知识包版本号，文件每次变更时递增。
        created_by:
          type: integer
          description: 创建者成员 ID。
          format: int64
        created_at_ms:
          type: integer
          description: 创建时间的 Unix 毫秒时间戳。
          format: int64
        updated_at_ms:
          type: integer
          description: 最近修改时间的 Unix 毫秒时间戳。
          format: int64
        can_edit:
          type: boolean
          description: 调用者是否有权限编辑该知识包。
      required:
        - pack_id
        - account_id
        - scope
        - scope_id
        - file_count
        - total_bytes
        - version
        - created_by
        - created_at_ms
        - updated_at_ms
        - can_edit
    ErrorResponse:
      type: object
      description: Response envelope for errors. `error` is required; `data` is absent.
      properties:
        request_id:
          type: string
          example: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
          description: 本次请求的唯一追踪 ID（trace ID），反馈问题时请提供该值以便检索日志。
        error:
          $ref: '#/components/schemas/DutyError'
      required:
        - request_id
        - error
    ErrorCode:
      type: string
      description: >-
        Flashduty error code enum. Every failed API response sets `error.code`
        to one of these values. The value is a stable wire string — not a
        localized message and not a numeric status. HTTP status is
        informational.
      enum:
        - OK
        - InvalidParameter
        - BadRequest
        - InvalidContentType
        - ResourceNotFound
        - NoLicense
        - ReferenceExist
        - Unauthorized
        - BalanceNotEnough
        - AccessDenied
        - RouteNotFound
        - MethodNotAllowed
        - UndonedOrderExist
        - RequestLocked
        - EntityTooLarge
        - RequestTooFrequently
        - RequestVerifyRequired
        - DangerousOperation
        - InternalError
        - ServiceUnavailable
  responses:
    BadRequest:
      description: Invalid request — usually a missing or malformed parameter.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            missingParameter:
              summary: Missing required parameter
              value:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                error:
                  code: InvalidParameter
                  message: The specified parameter skill_id is not valid.
    Unauthorized:
      description: Missing or invalid 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: Rate limit hit. Either the global API limit or a per-account limit.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            rateLimited:
              value:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                error:
                  code: RequestTooFrequently
                  message: Request too frequently.
    ServerError:
      description: Unexpected server-side error. Include the request_id when reporting.
      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: >-
        App key issued from the Flashduty console. Required on every public API
        call. Keep it secret — it grants the same access as the owning account.

````