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

# Create knowledge base

> Create a new knowledge base for an agent.



## OpenAPI

````yaml /openapi.json post /v1/senders/{senderId}/agent/knowledge-bases
openapi: 3.0.3
info:
  title: Zavu Unified Messaging Layer API
  version: 0.2.0
  description: >
    Unified multi-channel messaging API for Zavu.


    Supported channels:

    - **SMS**: Simple text messages

    - **WhatsApp**: Rich messaging with media, buttons, lists, CTA URL buttons,
    and templates

    - **Telegram**: Bot messaging with text, media, and interactive elements

    - **Email**: Transactional emails via Amazon SES


    Design goals:

    - Simple `send()` entrypoint for developers

    - Project-level authentication via Bearer token

    - Support for all WhatsApp message types (text, image, video, audio,
    document, sticker, location, contact, buttons, list, cta_url, reaction,
    template)

    - If a non-text message type is sent, WhatsApp channel is used automatically

    - 24-hour WhatsApp conversation window enforcement

    - Universal `to` field accepts phone numbers (E.164), email addresses, or
    numeric chat IDs (Telegram/Instagram)
servers:
  - url: https://api.zavu.dev
security:
  - bearerAuth: []
paths:
  /v1/senders/{senderId}/agent/knowledge-bases:
    post:
      tags:
        - Agent Knowledge Bases
      summary: Create knowledge base
      description: Create a new knowledge base for an agent.
      operationId: createAgentKnowledgeBase
      parameters:
        - $ref: '#/components/parameters/SenderIdParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/KnowledgeBaseCreateRequest'
            example:
              name: Product FAQ
              description: Frequently asked questions about our products
      responses:
        '201':
          description: Knowledge base created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeBaseResponse'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Agent not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  parameters:
    SenderIdParam:
      name: senderId
      in: path
      required: true
      schema:
        type: string
  schemas:
    KnowledgeBaseCreateRequest:
      type: object
      required:
        - name
      properties:
        name:
          type: string
          maxLength: 100
        description:
          type: string
    KnowledgeBaseResponse:
      type: object
      required:
        - knowledgeBase
      properties:
        knowledgeBase:
          $ref: '#/components/schemas/AgentKnowledgeBase'
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          example: invalid_request
        message:
          type: string
          example: Phone number is invalid
        details:
          type: object
          additionalProperties: true
    AgentKnowledgeBase:
      type: object
      required:
        - id
        - agentId
        - name
        - documentCount
        - totalChunks
        - createdAt
        - updatedAt
      properties:
        id:
          type: string
        agentId:
          type: string
        name:
          type: string
        description:
          type: string
          nullable: true
        documentCount:
          type: integer
        totalChunks:
          type: integer
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````