> ## Documentation Index
> Fetch the complete documentation index at: https://docs.traversal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List knowledge files

> Lists customer-visible files under `user_generated/` and `skills/`,
ordered by path. Traversal-generated knowledge and memories are not
exposed.




## OpenAPI

````yaml /api/openapi.yaml get /v1/knowledge/files
openapi: 3.1.0
info:
  title: Traversal API
  version: 1.0.0
  description: |
    The Traversal V1 API lets you launch investigations and manage the
    customer-authored knowledge files that agents use.

    All endpoints require a Bearer token. The authenticated user must have at
    least the `member` role within the organization unless an endpoint states
    otherwise.

    To wait for an investigation without polling, connect to
    `GET /v1/sessions/{session_id}/events`. The Server-Sent Events stream sends
    session status snapshots and closes when the session reaches a terminal
    status.
servers:
  - url: https://api.traversal.com
    description: Traversal API
security:
  - bearerAuth: []
tags:
  - name: Sessions
    description: Create, list, retrieve, and continue investigation sessions.
  - name: Knowledge Files
    description: List, upload, download, and delete customer-authored agent knowledge.
paths:
  /v1/knowledge/files:
    get:
      tags:
        - Knowledge Files
      summary: List knowledge files
      description: |
        Lists customer-visible files under `user_generated/` and `skills/`,
        ordered by path. Traversal-generated knowledge and memories are not
        exposed.
      operationId: listKnowledgeFiles
      parameters:
        - name: prefix
          in: query
          required: false
          description: |
            Restrict results to this path and its descendants. Must be
            `user_generated`, `skills`, or a path under one of those roots.
          schema:
            type: string
          example: skills/checkout-triage
        - name: page
          in: query
          required: false
          description: Page number (1-indexed).
          schema:
            type: integer
            minimum: 1
            default: 1
        - name: limit
          in: query
          required: false
          description: Number of files per page.
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 50
      responses:
        '200':
          description: A page of knowledge files.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeFileList'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '405':
          $ref: '#/components/responses/MethodNotAllowed'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
components:
  schemas:
    KnowledgeFileList:
      type: object
      required:
        - files
        - count
        - total
      properties:
        files:
          type: array
          items:
            $ref: '#/components/schemas/KnowledgeFile'
        count:
          type: integer
          description: Number of files in this page.
        total:
          type: integer
          description: Total matching files across all pages.
        prev:
          type:
            - integer
            - 'null'
          description: Previous page number, or null on the first page.
        next:
          type:
            - integer
            - 'null'
          description: Next page number, or null on the last page.
    KnowledgeFile:
      type: object
      required:
        - path
        - content_type
        - size_bytes
        - sha256
        - etag
        - created_at
        - updated_at
      properties:
        path:
          type: string
          description: POSIX path under `user_generated/` or `skills/`.
          example: user_generated/runbooks/checkout.md
        content_type:
          type: string
          description: Stored media type.
          example: text/markdown
        size_bytes:
          type: integer
          minimum: 0
          description: File size in bytes.
        sha256:
          type: string
          pattern: ^[0-9a-f]{64}$
          description: Hex SHA-256 digest of the file bytes.
        etag:
          type: string
          description: Opaque version token for conditional requests.
          example: '"d50c991679d03c2a7392b123eb748b4f"'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              enum:
                - conflict
                - internal
                - invalid_argument
                - not_found
                - payload_too_large
                - permission_denied
                - precondition_failed
                - resource_exhausted
                - unauthenticated
                - unavailable
                - unsupported_media_type
              description: Stable machine-readable error category.
            message:
              type: string
              description: Human-readable explanation of the error.
            retry_after:
              type: integer
              description: |
                Optional suggested seconds to wait before retrying. Present
                only when the server can recommend a delay, such as some `429`
                and `503` responses. When set, the response also includes a
                standard `Retry-After` HTTP header with the same value.
  responses:
    BadRequest:
      description: >-
        An invalid body, path, query parameter, or header value. The `message`
        identifies the failed validation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Missing, invalid, or revoked API key.
      headers:
        WWW-Authenticate:
          schema:
            type: string
          description: Authentication challenge (`Bearer`).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: Insufficient role, ownership, permission, or endpoint-specific access.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    MethodNotAllowed:
      description: >-
        The path exists but does not support the requested HTTP method. Uses the
        `invalid_argument` error code.
      headers:
        Allow:
          schema:
            type: string
          description: Comma-separated HTTP methods supported by the path.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalServerError:
      description: An unexpected error occurred on the server.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ServiceUnavailable:
      description: >-
        API infrastructure is not available. Some responses include a
        recommended retry delay.
      headers:
        Retry-After:
          schema:
            type: integer
          description: Suggested seconds to wait before retrying, when available.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: |
        Bearer token in the `Authorization` header — for example,
        `Authorization: Bearer trv_ak_your_api_key_here`. Each key is bound to a
        specific user and organization.

````