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

# List Knowledge Documents

> Lists every document attached to the agent's knowledge base, including ones whose upload has not been completed yet (`status: PENDING`).

Lists every document attached to an agent's knowledge base.

## Overview

Returns documents oldest first, including ones whose upload has not been completed yet. The response is not paginated — an agent holds at most 10 documents.

## Reading the Response

| Field       | Meaning                                                                              |
| ----------- | ------------------------------------------------------------------------------------ |
| `status`    | `PENDING` while waiting for the file and its completion call; `READY` once verified  |
| `isActive`  | Whether the agent may consult the document on a call. Always `false` while `PENDING` |
| `sizeBytes` | Size as verified against storage. Absent until the document is `READY`               |
| `total`     | Documents currently attached, including pending ones                                 |
| `limit`     | Maximum documents one agent may hold                                                 |

<Info>
  A `PENDING` document still counts against `limit`. If `total` has reached
  `limit` and some documents are pending, either complete or delete them to free
  a slot — abandoned uploads are reclaimed automatically after 24 hours.
</Info>

## Example

```bash theme={null}
curl https://api.instaview.sk/agents/$AGENT_ID/knowledge \
  -H "Authorization: Bearer $INSTAVIEW_API_KEY"
```

```json theme={null}
{
  "data": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "title": "Benefits and perks",
      "fileName": "benefits-and-perks.pdf",
      "mimeType": "application/pdf",
      "sizeBytes": 482133,
      "status": "READY",
      "isActive": true,
      "createdAt": "2026-08-08T10:15:00.000Z"
    }
  ],
  "total": 1,
  "limit": 10
}
```

## Related Resources

* [Start Knowledge Upload](/api-reference/agents/knowledge/start-upload)
* [Update Knowledge Document](/api-reference/agents/knowledge/update-knowledge)
* [Delete Knowledge Document](/api-reference/agents/knowledge/delete-knowledge)


## OpenAPI

````yaml GET /agents/{id}/knowledge
openapi: 3.0.0
info:
  title: InstaView API
  description: |-
    InstaView API Documentation

    ## Authentication

    All endpoints require API key authentication using Bearer token:
    ```
    Authorization: Bearer sk_your_api_key_here
    ```

    ## API Key Management

    The API Key module provides comprehensive key management for:
    - **Direct Client Keys**: Company-scoped keys for your applications
    - **ATS Partner Keys**: Resource-scoped keys for ATS integrations

    ### Key Features
    - HMAC-SHA256 hashing for API key storage
    - Configurable rate limiting
    - Comprehensive audit logging
    - Company-level isolation
    - Resource scoping for ATS partners
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.instaview.sk
    description: Production API Gateway
security: []
tags: []
paths:
  /agents/{id}/knowledge:
    get:
      tags:
        - Agents
      summary: List knowledge base documents
      description: >-
        Lists every document attached to the agent's knowledge base, including
        ones whose upload has not been completed yet (`status: PENDING`).
      operationId: PublicAgentKnowledgeController_list_v1
      parameters:
        - name: id
          required: true
          in: path
          description: Agent the knowledge base belongs to.
          schema:
            type: string
            format: uuid
        - name: companyId
          required: false
          in: query
          description: >-
            Required for ATS API keys to specify which company to access.
            Ignored for standard company API keys.
          schema:
            type: string
      responses:
        '200':
          description: Documents attached to the agent, oldest first
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicListKnowledgeDocumentsResponseDto'
        '404':
          description: >-
            No agent with that id belongs to the API key's company. An id that
            exists nowhere and an id that belongs to another company answer
            identically — same status, same body — on purpose, so the response
            cannot be used to tell them apart.
      security:
        - bearer: []
components:
  schemas:
    PublicListKnowledgeDocumentsResponseDto:
      type: object
      properties:
        data:
          description: Documents attached to the agent, oldest first
          type: array
          items:
            $ref: '#/components/schemas/PublicKnowledgeDocumentDto'
        total:
          type: number
          example: 3
          description: Number of documents attached
        limit:
          type: number
          example: 10
          description: Maximum documents one agent may hold
      required:
        - data
        - total
        - limit
    PublicKnowledgeDocumentDto:
      type: object
      properties:
        id:
          type: string
          format: uuid
          example: 123e4567-e89b-12d3-a456-426614174000
          description: Document ID
        title:
          type: string
          example: Benefits and perks
          description: Human-readable label for the document
        fileName:
          type: string
          example: benefits-and-perks.pdf
          description: Original file name as uploaded
        mimeType:
          type: string
          example: application/pdf
          description: MIME type of the stored file
        sizeBytes:
          type: number
          example: 482133
          description: >-
            Size of the stored file in bytes, as verified against storage.
            Absent until the upload is READY.
        status:
          type: string
          enum:
            - PENDING
            - READY
          example: READY
          description: >-
            `PENDING` while waiting for the file to be uploaded to the presigned
            URL and the upload to be completed; `READY` once the file is
            confirmed stored. Only READY documents are attached to calls.
        isActive:
          type: boolean
          example: true
          description: >-
            Whether the agent may consult this document during a call. Always
            false while the upload is PENDING.
        createdAt:
          format: date-time
          type: string
          example: '2026-08-08T10:15:00.000Z'
          description: When the document was created
      required:
        - id
        - title
        - status
        - isActive
        - createdAt
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      description: API key for authentication using Bearer scheme

````