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

# List documents

> Lists knowledge base documents for the authenticated client, with optional filtering and pagination.



## OpenAPI

````yaml GET /v1/documents
openapi: 3.0.0
info:
  title: Devic.ai Public API
  description: >-
    Devic.ai is an AI platform that allows you to create, manage, and use AI
    agents for various tasks.
  version: 1.0.0
  contact:
    name: Devic.ai Support
    url: https://devic.ai
  x-logo:
    url: https://devic.ai/logo.png
    altText: Devic.ai Logo
  x-summary: Public API for interacting with Devic.ai platform
servers:
  - url: https://api.devic.ai
    description: Production server
  - url: https://staging-api.devic.ai
    description: Staging server
security:
  - bearerAuth: []
tags:
  - name: Projects
    description: Group agents, assistants, documents and costs into projects
  - name: Documents
    description: >-
      Knowledge base documents: create, version, attach and index markdown
      content for RAG
  - name: Document Folders
    description: Organise knowledge base documents into folders and attach them in bulk
  - name: Files
    description: Upload files and obtain shareable download URLs to attach to messages
  - name: Agents
    description: Endpoints related to AI agents and their operations
  - name: Assistants
    description: Endpoints for interacting with assistants and their specializations
  - name: Tool Servers
    description: Endpoints for managing tool servers and their tool definitions
  - name: Health
    description: API health check endpoints
  - name: Documentation
    description: Endpoints for retrieving markdown documentation
paths:
  /v1/documents:
    get:
      tags:
        - Documents
      summary: List documents
      description: >-
        Lists knowledge base documents for the authenticated client, with
        optional filtering and pagination.
      operationId: listDocuments
      parameters:
        - name: projectId
          in: query
          required: false
          description: Filter by project ID
          schema:
            type: string
        - name: status
          in: query
          required: false
          description: Filter by status
          schema:
            type: string
            enum:
              - pending
              - ready
              - failed
        - name: fileType
          in: query
          required: false
          description: Filter by file type
          schema:
            type: string
            enum:
              - md
              - pdf
              - txt
              - docx
        - name: search
          in: query
          required: false
          description: Free-text search in name and content
          schema:
            type: string
        - name: folderId
          in: query
          required: false
          description: Filter by folder ID. Use "none" to return documents without a folder
          schema:
            type: string
        - name: parentOnly
          in: query
          required: false
          description: When true, only return root documents (no parent)
          schema:
            type: boolean
        - name: limit
          in: query
          required: false
          description: Maximum number of items to return
          schema:
            type: integer
            default: 20
            maximum: 100
        - name: offset
          in: query
          required: false
          description: Number of items to skip
          schema:
            type: integer
            default: 0
      responses:
        '200':
          description: Documents retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedDocuments'
        '401':
          description: Unauthorized - Invalid or missing token
        '429':
          description: Too Many Requests - Rate limit exceeded
        '500':
          description: Internal Server Error
      security:
        - bearerAuth: []
components:
  schemas:
    PaginatedDocuments:
      type: object
      properties:
        documents:
          type: array
          items:
            $ref: '#/components/schemas/KnowledgeDocument'
        total:
          type: integer
          description: Total number of documents matching the query
    KnowledgeDocument:
      type: object
      properties:
        _id:
          type: string
          description: Document ID
        clientUID:
          type: string
          description: Client UID
        projectId:
          type: string
          nullable: true
          description: Project ID the document is scoped to
        name:
          type: string
          description: Document name
        fileName:
          type: string
          description: File name (with extension)
        fileType:
          type: string
          enum:
            - md
            - pdf
            - txt
            - docx
          description: File type
        mimeType:
          type: string
          description: MIME type
        size:
          type: integer
          description: File size in bytes
        status:
          type: string
          enum:
            - pending
            - ready
            - failed
          description: Processing / indexing status
        markdownContent:
          type: string
          description: Markdown content (for markdown documents)
        summary:
          type: string
          description: Auto-generated summary
        tokenCount:
          type: integer
          description: Token count
        currentVersion:
          type: integer
          description: Current version number
        folderId:
          type: string
          nullable: true
          description: Folder ID the document is filed in
        parentDocumentId:
          type: string
          nullable: true
          description: Parent document ID (for subdocuments referenced via @ mentions)
        createdByUserUID:
          type: string
          description: UID of the user that created the document
        creationTimestampMs:
          type: integer
          format: int64
          description: Creation timestamp (ms)
        lastEditTimestampMs:
          type: integer
          format: int64
          description: Last edit timestamp (ms)
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Use JWT token for authentication

````