> ## 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` 即可调用              |

## 使用说明

* 不传 `pack_id` 时默认查询调用者的账户范围知识包（不存在时惰性创建）。
* 读取团队范围知识包需要是该团队成员。
* `p`/`limit` 参数会被接受，但当前实现始终返回完整文件列表。


## OpenAPI

````yaml /api-reference/safari.openapi.zh.json post /safari/knowledge/file/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/file/list:
    post:
      tags:
        - AI SRE/知识
      summary: 查询知识文件列表
      description: 查询知识包内的文件列表，包含大小、校验和等元数据。
      operationId: knowledge-file-read-list
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/KnowledgeFileListRequest'
            example:
              pack_id: kpk_kE49k3FhecfJBwutbshEEc
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ResponseEnvelope'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/KnowledgeFileListResponse'
              example:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                data:
                  files:
                    - file_id: kfl_QvT4g3c8zAHxTthuT6hGne
                      pack_id: kpk_kE49k3FhecfJBwutbshEEc
                      rel_path: aliyun.md
                      content_type: text/markdown
                      size_bytes: 1436
                      checksum: >-
                        fccc276c0d7fbae2e9508285cdde0f8475169634e89e466dac2e59f176c9be2f
                      updated_by: 3790925372131
                      updated_at_ms: 1783311304757
                    - file_id: kfl_BMsQZCZSqhW4TFskYNb4H5
                      pack_id: kpk_kE49k3FhecfJBwutbshEEc
                      rel_path: DUTY.md
                      content_type: text/markdown
                      size_bytes: 1301
                      checksum: >-
                        450eabf178b41e46ea2f43d395a80bf8b956ddb9c9cea34f44ffc69a53e7a36b
                      updated_by: 2476444212131
                      updated_at_ms: 1784800003394
                  total: 17
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      security:
        - AppKeyAuth: []
components:
  schemas:
    KnowledgeFileListRequest:
      type: object
      description: 要列出文件的知识包。
      properties:
        pack_id:
          type: string
          description: 知识包 ID；默认为调用者的账户范围知识包。
        p:
          type: integer
          description: 页码，从 1 开始。
        limit:
          type: integer
          description: 每页条数。
    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
    KnowledgeFileListResponse:
      type: object
      description: 知识包内的文件。
      properties:
        files:
          type: array
          items:
            $ref: '#/components/schemas/KnowledgeFileItem'
          description: 指定知识包内的文件数组；无文件时为空数组。
        total:
          type: integer
          description: 知识包内文件总数。
          format: int64
      required:
        - files
        - 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
    KnowledgeFileItem:
      type: object
      description: 知识包内单个文件的元数据；文件内容需通过 file/get 单独获取。
      properties:
        file_id:
          type: string
          description: 文件 ID（`kfl_` 前缀）。
        pack_id:
          type: string
          description: 文件所属的知识包 ID。
        rel_path:
          type: string
          description: 相对于知识包根目录的路径，如 `runbooks/restart.md`。
        content_type:
          type: string
          description: MIME 类型；上传时未指定则按扩展名推断。
        size_bytes:
          type: integer
          description: 文件大小（字节）。
          format: int64
        checksum:
          type: string
          description: 文件内容的 SHA-256 十六进制摘要。
        updated_by:
          type: integer
          description: 最近修改者成员 ID。
          format: int64
        updated_at_ms:
          type: integer
          description: 最近修改时间的 Unix 毫秒时间戳。
          format: int64
      required:
        - file_id
        - pack_id
        - rel_path
        - content_type
        - size_bytes
        - checksum
        - updated_by
        - updated_at_ms
    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.

````