> ## 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.

# Create Knowledge Base

> Create a knowledge base for agent context.

<span data-api-safety-label="changes-state"><Badge color="yellow" size="sm" shape="pill">Changes state - verify before retry</Badge></span>

<Info>
  **v1 only.** Knowledge bases are available on the `/v1` API. There is no legacy unversioned equivalent.
</Info>

A knowledge base is a named collection of your own content that an agent can draw on to answer questions accurately. Create one knowledge base per topic or product area, then attach it to the agents that should use it.

## When to use this

Use this endpoint to spin up a knowledge base before uploading documents to it - for example, one knowledge base per product line, or one per customer in a multi-tenant setup. The name must be unique within your workspace.

## Minimal request

```json theme={null}
{
  "name": "Loan qualification FAQ"
}
```

## Verify and continue

Store the returned `kb_` ID, list knowledge bases to confirm the record, populate content through the supported dashboard ingestion flow, then attach the ID to an agent version with `knowledge_base_ids`. If creation times out, list by name before retrying so you do not create a duplicate.


## OpenAPI

````yaml POST /v1/knowledge-base
openapi: 3.0.0
info:
  title: DialNexa API
  description: >-
    Public REST API for the DialNexa voice AI platform. Versioned endpoints are
    under /v1; unversioned endpoints are legacy and deprecated.
  version: 1.0.0
servers:
  - url: https://api.dialnexa.com
    description: DialNexa production API
security:
  - bearer: []
tags:
  - name: API Keys
  - name: Agent Functions
  - name: Agents V1
  - name: Agents2
  - name: Batch Calls
  - name: Batch Calls V1
  - name: Call Logs
  - name: Calls
  - name: Calls V1
  - name: Campaign Leads
  - name: Campaigns
  - name: External Webhooks
  - name: Knowledge Base
  - name: Knowledge Base V1
  - name: LLMs
  - name: LLMs V1
  - name: Languages
  - name: Languages V1
  - name: Organization Phone Numbers
  - name: Organization Phone Numbers V1
  - name: Phone Number Pricing
  - name: Phone Number Pricing V1
  - name: Transcribers
  - name: Transcribers V1
  - name: User Webhooks
  - name: User Webhooks V1
  - name: V1
  - name: Voices
  - name: Voices V1
  - name: Webcall
  - name: Workflow Leads
  - name: Workflow Leads V1
  - name: Workflows
  - name: Workflows V1
paths:
  /v1/knowledge-base:
    post:
      tags:
        - Knowledge Base
        - Knowledge Base V1
        - V1
      summary: Create Knowledge Base
      description: >-
        Creates an empty knowledge base that can be populated and attached to
        agent versions.
      operationId: KnowledgeBaseV1Controller_create
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateKnowledgeBaseDto'
            examples:
              request:
                summary: Request example
                value:
                  name: Product Documentation
      responses:
        '201':
          description: Knowledge base created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeBase'
              examples:
                success:
                  summary: Successful response
                  value:
                    id: kb_abc123
                    name: Loan FAQ
                    description: Frequently asked questions for loan calls
                    file_name: loan-faq.pdf
                    status: ready
                    createdAt: '2026-07-03T10:30:00.000Z'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                error:
                  summary: 401 Unauthorized
                  value:
                    statusCode: 401
                    message: API key is missing or invalid
                    error: Unauthorized
        '409':
          description: Knowledge base name already exists.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                error:
                  summary: 409 Conflict
                  value:
                    statusCode: 409
                    message: Knowledge base with this name already exists
                    error: Conflict
      security:
        - bearer: []
components:
  schemas:
    CreateKnowledgeBaseDto:
      type: object
      properties:
        name:
          type: string
          description: Name of the knowledge base (must be unique within the workspace)
          example: Product Documentation
          maxLength: 150
      required:
        - name
    KnowledgeBase:
      type: object
      properties:
        id:
          type: string
          example: kb_abc123
          description: Signed knowledge base ID.
        name:
          type: string
          example: Loan FAQ
          maxLength: 150
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - id
        - name
    ErrorResponse:
      type: object
      properties:
        statusCode:
          type: integer
          example: 400
        message:
          oneOf:
            - type: string
            - type: array
              items:
                type: string
          example: phone_number must be a valid E.164 phone number
        error:
          type: string
          example: Bad Request
      required:
        - statusCode
        - message
        - error
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````