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

# List Documents

> List the documents in an agent's knowledge base.

Returns the documents associated with an agent's knowledge base. The API key must belong to the supplied user, and that user must have access to the agent.

Use the related operations to upload or delete documents. An upload accepts up to 10 PDF, DOCX, or TXT files per request, with a maximum size of 10 MB per file.


## OpenAPI

````yaml GET /agent-documents
openapi: 3.0.1
info:
  title: Phonely API
  description: API for Phonely services including agent management and call summaries
  version: 1.0.0
servers:
  - url: https://app.phonely.ai/api
security: []
paths:
  /agent-documents:
    get:
      summary: List agent documents
      description: Retrieve all documents associated with a specific agent
      parameters:
        - name: uid
          in: query
          required: true
          schema:
            type: string
          description: User ID
        - name: agentId
          in: query
          required: true
          schema:
            type: string
          description: Agent ID
      responses:
        '200':
          description: List of documents
          content:
            application/json:
              schema:
                type: object
                required:
                  - documents
                properties:
                  documents:
                    type: array
                    items:
                      $ref: '#/components/schemas/Document'
        '400':
          description: Invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    Document:
      type: object
      required:
        - id
        - agentId
        - name
        - active
        - lastUpdatedBy
        - lastUpdatedAt
      properties:
        id:
          type: string
          description: Document ID
        agentId:
          type: string
          description: Associated agent ID
        name:
          type: string
          description: Document name
        active:
          type: boolean
          description: Document active status
        fileUrl:
          type: string
          description: URL to access the document
        content:
          type: string
          description: Extracted document content when stored with the record
        contentMD:
          type: string
          description: Document content in Markdown when stored with the record
        lastUpdatedBy:
          type: string
          description: Who last updated the document
        lastUpdatedAt:
          oneOf:
            - type: string
              format: date-time
            - $ref: '#/components/schemas/FirestoreTimestamp'
          description: When the document was last updated
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error code or identifier
        message:
          type: string
          description: Detailed error message
    FirestoreTimestamp:
      type: object
      required:
        - _seconds
        - _nanoseconds
      properties:
        _seconds:
          type: integer
          format: int64
        _nanoseconds:
          type: integer
      description: Serialized Firestore timestamp
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Authorization

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.