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

# List Agent Knowledge Bases

> Returns the knowledge bases currently attached to the specified agent.
Requires `agent_config:view` permission.




## OpenAPI

````yaml GET /api/agent-config/{id}/knowledge-bases
openapi: 3.1.0
info:
  title: Naturalead Agent Config API
  version: 1.0.0
  description: >
    API for managing AI agent configurations in the Naturalead platform.

    Agent configs define how the AI converses with leads, including the system
    prompt,

    conversation stages, guardrails, and attached knowledge bases.


    All endpoints require API key authentication and are scoped to the caller's
    account.
servers:
  - url: '{baseUrl}'
    description: API server
    variables:
      baseUrl:
        default: http://localhost:3001
security:
  - BearerAuth: []
tags:
  - name: Agent Config
    description: AI agent configuration CRUD, templates, and knowledge base assignment
  - name: Templates
    description: Pre-built agent configuration templates
  - name: Knowledge Bases
    description: Attach and detach knowledge bases from agents
paths:
  /api/agent-config/{id}/knowledge-bases:
    get:
      tags:
        - Knowledge Bases
      summary: List agent knowledge bases
      description: |
        Returns the knowledge bases currently attached to the specified agent.
        Requires `agent_config:view` permission.
      operationId: listAgentKnowledgeBases
      parameters:
        - $ref: '#/components/parameters/AgentId'
      responses:
        '200':
          description: Knowledge bases attached to the agent
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/KnowledgeBase'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  parameters:
    AgentId:
      name: id
      in: path
      required: true
      description: Agent configuration ObjectId
      schema:
        type: string
  schemas:
    KnowledgeBase:
      type: object
      properties:
        _id:
          type: string
          description: MongoDB ObjectId
        accountId:
          type: string
        name:
          type: string
        description:
          type: string
        documentCount:
          type: integer
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
        - _id
        - accountId
        - name
  responses:
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
            required:
              - error
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Bearer token using an API key (format nl_live_* or nl_test_*)

````