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

# Update Knowledge Base

> Update a knowledge base name or settings.

Changes state - verify before retry
Update a knowledge base. Today this changes its `name`. The new name must be unique within your workspace and at most 150 characters; this route does not check the length up front, so a longer name fails with `500 Internal Server Error` instead of `400`.

## When to use this

* **Renaming**: keep knowledge base names aligned with the product line or customer they cover as those names change on your side.
* **Naming conventions**: bring older knowledge bases in line with a naming scheme so pickers stay readable.

Renaming does not affect the agents that reference the knowledge base; they keep working with the same `id`. A `400 Bad Request` means the new name is blank; a `409 Conflict` means another knowledge base in the workspace already has that name, or a document in this knowledge base is still being indexed (retry once it finishes). See [API errors](https://dialnexa.com/docs/api-reference/api-fundamentals.md#handle-dialnexa-api-errors) for the standard error format.

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

Fetch the same `kb_` ID after the update and confirm the name changed. If the request timed out, read the resource before retrying.


## OpenAPI

````yaml PATCH /v1/knowledge-base/{id}
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/{id}:
    patch:
      tags:
        - Knowledge Base
      summary: Update Knowledge Base
      description: >-
        Renames one knowledge base without changing its ID or agent attachments.
        Returns 409 when another knowledge base in the workspace has the name,
        or while a document is being indexed.
      operationId: updateKnowledgeBase
      parameters:
        - name: id
          required: true
          in: path
          description: Knowledge base ID
          schema:
            example: kb_abc123
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateKnowledgeBaseRequest'
            examples:
              request:
                summary: Update a knowledge base
                value:
                  name: Updated Loan FAQ
      responses:
        '200':
          description: Knowledge base updated 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:
                    $ref: '#/components/schemas/KnowledgeBase'
                  timestamp:
                    type: string
                    format: date-time
              examples:
                success:
                  summary: Successful response
                  value:
                    success: true
                    error: false
                    statusCode: 200
                    message: Success
                    data:
                      id: kb_abc123
                      name: Updated Loan FAQ
                      org_id: o14XKPP84rt22g
                      is_deleted: false
                      created_at: '2026-07-03T10:30:00.000Z'
                      updated_at: '2026-07-03T10:45:00.000Z'
                    timestamp: '2026-09-07T06:00:00.000Z'
        '400':
          description: Invalid request body, for example a blank name.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                error:
                  summary: 400 Bad Request
                  value:
                    statusCode: 400
                    error: true
                    success: false
                    data: []
                    message: name must not be blank
                    errors:
                      - name must not be blank
        '401':
          description: 'Unauthorized: missing or invalid API key.'
          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: []
        '404':
          description: Knowledge base not found in this workspace.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                error:
                  summary: 404 Not Found
                  value:
                    statusCode: 404
                    error: true
                    success: false
                    data: []
                    message: Knowledge base with ID abc123def45678 not found
                    errors: []
        '409':
          description: >-
            New name already in use in this workspace, or the knowledge base is
            indexing a document.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                error:
                  summary: 409 Conflict
                  value:
                    statusCode: 409
                    error: true
                    success: false
                    data: []
                    message: >-
                      A knowledge base named "Support FAQ" already exists in
                      this workspace
                    errors: []
                indexing:
                  summary: Knowledge base is indexing
                  value:
                    statusCode: 409
                    error: true
                    success: false
                    data:
                      code: KNOWLEDGE_BASE_INDEXING
                      knowledge_base_ids:
                        - kb_Qm4TzR8wLp2VxN
                    message: >-
                      This knowledge base is indexing a document. Try again in a
                      few minutes.
                    errors: []
        '500':
          description: >-
            Internal server error. A name longer than 150 characters also
            returns 500, with a message that starts `Error updating knowledge
            base:` followed by the database 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:
    UpdateKnowledgeBaseRequest:
      type: object
      properties:
        name:
          type: string
          pattern: \S
          description: >-
            Knowledge base name. Must not be blank when provided. Keep it to 150
            characters: a longer name is refused with 500.
          example: Updated Product Documentation
    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.