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

# List Knowledge Bases

> List knowledge bases in your workspace.

Read only
Return all knowledge bases that belong to the authenticated workspace. Use this to populate a picker in your own UI, or to find the `id` of a knowledge base before attaching it to an agent.

## When to use this

* **Pickers**: list the knowledge bases an operator can attach to an agent.
* **ID lookup**: find the `kb_` ID by name before passing it in `knowledge_base_ids` on [Create Agent](https://dialnexa.com/docs/api-reference/v1/agents/create.md) or [Update Agent](https://dialnexa.com/docs/api-reference/v1/agents/update.md).
* **Housekeeping**: audit which knowledge bases exist before creating a new one, since names must be unique within a workspace.

The response contains a `data.items` array, each item with `id`, `name`, `org_id`, `is_deleted`, `created_at` and `updated_at`, and a `data.meta` object with `totalItems`, `itemsPerPage`, `totalPages`, and `currentPage`. The endpoint accepts `page`, `limit`, `sortBy`, and `sortOrder`; see [API pagination](https://dialnexa.com/docs/api-reference/api-fundamentals.md#paginate-dialnexa-list-responses) for iteration examples.

## Query parameters

| Parameter | Description |
| - | - |
| `page` | Page number, starting at 1. Must be a whole number; `0` is treated as `1`, and a decimal returns `400`. |
| `limit` | Knowledge bases per page. Must be a whole number. Default 20; `0` returns 50 per page, values above 100 are treated as 100, a decimal returns `400`, and a negative value fails with `500`. |
| `sortBy` | Column to sort by: `id`, `name`, `org_id`, `is_deleted`, `created_at` or `updated_at`. Default `id`. Any other value fails with `500`. |
| `sortOrder` | Sort direction: `ASC` or `DESC`, in any case. Default ASC. Any other value fails with `500`. |


## OpenAPI

````yaml GET /v1/knowledge-base
openapi: 3.0.0
info:
  title: DialNexa API
  description: Public `/v1` REST API for the DialNexa voice AI platform.
  version: 1.0.0
servers:
  - url: https://api.dialnexa.com
    description: DialNexa production API
security:
  - bearer: []
tags:
  - name: Agents
  - name: Batch Calls
  - name: Calls
  - name: Knowledge Base
  - name: Languages
  - name: LLMs
  - name: Phone Numbers
  - name: Organization Folders
  - name: Transcribers
  - name: Webhooks
  - name: Voices
  - name: Workflows
  - name: Workflow Leads
  - name: Authentication
  - name: Agent Builder
  - name: Agent Evaluations
paths:
  /v1/knowledge-base:
    get:
      tags:
        - Knowledge Base
      summary: List Knowledge Bases
      description: >-
        Returns knowledge bases for the authenticated workspace in an items and
        meta pagination envelope.
      operationId: listKnowledgeBases
      parameters:
        - name: page
          required: false
          in: query
          description: >-
            Page number, starting at 1. Must be a whole number; 0 is treated as
            1.
          schema:
            type: integer
            default: 1
            example: 1
        - name: limit
          required: false
          in: query
          description: >-
            Knowledge bases per page. Must be a whole number. Default 20; 0
            returns 50 per page, values above 100 are treated as 100, and a
            negative value fails with 500.
          schema:
            type: integer
            default: 20
            example: 20
        - name: sortBy
          required: false
          in: query
          description: >-
            Column to sort by: id, name, org_id, is_deleted, created_at or
            updated_at. Default id. Any other value fails with 500.
          schema:
            type: string
            default: id
            example: id
        - name: sortOrder
          required: false
          in: query
          description: >-
            Sort direction: ASC or DESC, in any case. Default ASC. Any other
            value fails with 500.
          schema:
            type: string
            default: ASC
      responses:
        '200':
          description: Knowledge bases returned successfully.
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - error
                  - statusCode
                  - message
                  - data
                  - timestamp
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  error:
                    type: boolean
                    enum:
                      - false
                  statusCode:
                    type: integer
                    example: 200
                  message:
                    type: string
                    example: Success
                  data:
                    type: object
                    required:
                      - items
                      - meta
                    properties:
                      items:
                        type: array
                        items:
                          $ref: '#/components/schemas/KnowledgeBase'
                      meta:
                        type: object
                        required:
                          - totalItems
                          - itemsPerPage
                          - totalPages
                          - currentPage
                        properties:
                          totalItems:
                            type: integer
                            example: 1
                          itemsPerPage:
                            type: integer
                            example: 20
                          totalPages:
                            type: integer
                            example: 1
                          currentPage:
                            type: integer
                            example: 1
                  timestamp:
                    type: string
                    format: date-time
              examples:
                success:
                  summary: Successful response
                  value:
                    success: true
                    error: false
                    statusCode: 200
                    message: Success
                    data:
                      items:
                        - id: kb_abc123
                          name: Loan FAQ
                          org_id: o14XKPP84rt22g
                          is_deleted: false
                          created_at: '2026-07-03T10:30:00.000Z'
                          updated_at: '2026-07-03T10:45:00.000Z'
                      meta:
                        totalItems: 1
                        itemsPerPage: 20
                        totalPages: 1
                        currentPage: 1
                    timestamp: '2026-09-07T06:00:00.000Z'
        '400':
          description: page or limit is a decimal.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                decimal:
                  summary: Decimal page
                  value:
                    statusCode: 400
                    error: true
                    success: false
                    data: []
                    message: Validation failed (numeric string is expected)
                    errors:
                      - Validation failed (numeric string is expected)
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                error:
                  summary: 401 Unauthorized
                  value:
                    statusCode: 401
                    error: true
                    success: false
                    data: []
                    message: Invalid API key
                    errors: []
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                error:
                  summary: 500 Internal Server Error
                  value:
                    statusCode: 500
                    error: true
                    success: false
                    data: []
                    message: Internal server error
                    errors: []
      security:
        - bearer: []
components:
  schemas:
    KnowledgeBase:
      type: object
      properties:
        id:
          type: string
          example: kb_abc123
          description: Signed knowledge base ID.
        name:
          type: string
          example: Loan FAQ
          maxLength: 150
        org_id:
          type: string
          example: o14XKPP84rt22g
          description: Owning organization.
        is_deleted:
          type: boolean
          description: Whether the knowledge base has been deleted.
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - id
        - name
    ErrorResponse:
      type: object
      description: Error body on endpoints without response filtering.
      properties:
        statusCode:
          type: integer
          example: 404
        error:
          type: boolean
          enum:
            - true
        success:
          type: boolean
          enum:
            - false
        data:
          oneOf:
            - type: object
              properties:
                code:
                  type: string
                  description: Machine-readable refusal code.
            - type: array
              items: {}
          description: >-
            For a coded refusal, an object with code and the details listed for
            that code. Otherwise an empty array.
        message:
          type: string
        errors:
          type: array
          items:
            type: string
          description: Validation messages for a 400. Empty for other errors.
        validation_errors:
          type: array
          description: >-
            Present when uploaded rows fail number validation (batch and
            workflow lead uploads): one group per distinct error.
          items:
            type: object
            properties:
              error:
                type: string
              rows:
                type: array
                items:
                  type: integer
                description: Row numbers with this error.
              phone_numbers:
                type: array
                items:
                  type: string
        invalid_row_count:
          type: integer
          description: 'Present with validation_errors: how many rows failed.'
      required:
        - statusCode
        - error
        - success
        - data
        - message
        - errors
  securitySchemes:
    bearer:
      scheme: bearer
      type: http

````

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