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

# List knowledge packs

> List knowledge packs visible to the caller across account and team scopes.

## Restrictions

| Aspect      | Value                                                         |
| ----------- | ------------------------------------------------------------- |
| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |
| Permissions | None — any valid `app_key` can call this operation            |

## Usage

* Visibility matches the console: admins see the account pack plus every team pack; non-admins see the account pack plus their own teams, and requested `team_ids` are silently intersected with their teams.
* `scope` selects `all` (default), `account`-only, or `team`-only, overriding `include_account`.
* `query` applies a case-insensitive substring filter over pack ID, scope, and team name; `p`/`limit` paginate the filtered result.


## OpenAPI

````yaml /api-reference/safari.openapi.en.json post /safari/knowledge/pack/list
openapi: 3.1.0
info:
  title: Flashduty Open API
  description: >-
    Public HTTP API for the Flashduty AI SRE platform — skills, MCP servers
    (connectors), A2A agents, and sessions. Every operation is authenticated
    with an `app_key` query parameter issued from the Flashduty console.
  version: 1.0.0
servers:
  - url: https://api.flashcat.cloud
    description: Flashduty Open API
security:
  - AppKeyAuth: []
tags:
  - name: AI SRE/Skills
    description: AI SRE agent skill management.
  - name: AI SRE/MCP servers
    description: MCP (Model Context Protocol) server management.
  - name: AI SRE/A2A agents
    description: A2A (agent-to-agent) remote agent management.
  - name: AI SRE/Sessions
    description: AI SRE agent session history — list, inspect, and export transcripts.
  - name: AI SRE/Automations
  - name: AI SRE/Knowledge
paths:
  /safari/knowledge/pack/list:
    post:
      tags:
        - AI SRE/Knowledge
      summary: List knowledge packs
      description: >-
        List knowledge packs visible to the caller across account and team
        scopes.
      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: Filter and pagination for the pack list.
      properties:
        p:
          type: integer
          description: >-
            Page number, 1-based; returns all results when both `p` and `limit`
            are unset.
        limit:
          type: integer
          description: Page size.
        scope:
          type: string
          description: >-
            Restrict to one scope; `all` (default) overrides `include_account`.
            One of: `all` (account scope plus visible team scopes), `account`
            (account-level packs only), `team` (team-level packs only, can be
            combined with `team_ids`).
          enum:
            - all
            - account
            - team
        query:
          type: string
          description: >-
            Case-insensitive substring filter over pack ID, scope, and team
            name.
          maxLength: 128
        team_ids:
          type: array
          description: >-
            Restrict to these team IDs; for non-admins the list is intersected
            with their own teams.
          items:
            type: integer
            format: int64
        include_account:
          type:
            - boolean
            - 'null'
          description: Include the account-scope pack; defaults to 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: Visible packs and the total after filtering.
      properties:
        packs:
          type: array
          items:
            $ref: '#/components/schemas/KnowledgePackItem'
          description: >-
            Array of visible knowledge packs after filtering (current page),
            used with `total` for pagination.
        total:
          type: integer
          description: Total number of packs after filtering, before pagination.
          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: >-
        A knowledge pack — a versioned file tree staged into every AI SRE
        sandbox at session start. One pack exists per (account, scope,
        scope_id).
      properties:
        pack_id:
          type: string
          description: Knowledge pack ID (`kpk_` prefix).
        account_id:
          type: integer
          description: Account that owns the pack.
          format: int64
        scope:
          type: string
          description: >-
            Pack scope. `channel` is a legacy scope; new packs are `account` or
            `team`.
          enum:
            - account
            - team
            - channel
        scope_id:
          type: integer
          description: >-
            Scope owner: the account ID for `account` scope, the team ID for
            `team` scope.
          format: int64
        team_name:
          type: string
          description: >-
            Display name of the owning team (team scope only); empty for account
            scope.
        file_count:
          type: integer
          description: Number of files in the pack.
        total_bytes:
          type: integer
          description: Total size of all files in bytes.
          format: int64
        version:
          type: integer
          description: Pack version, incremented on every file change.
        created_by:
          type: integer
          description: Person ID of the member who created the pack.
          format: int64
        created_at_ms:
          type: integer
          description: Unix timestamp in milliseconds when the pack was created.
          format: int64
        updated_at_ms:
          type: integer
          description: Unix timestamp in milliseconds when the pack was last modified.
          format: int64
        can_edit:
          type: boolean
          description: Whether the caller can edit this pack.
      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: >-
            Unique trace ID of this request; include it when reporting issues so
            logs can be located.
        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.

````