---
title: "Create Knowledge Base"
method: POST
path: "/v1/knowledge-base"
tags: ["Knowledge Base"]
---

# Create Knowledge Base

`POST /v1/knowledge-base`

## Request

- Base URL: `https://api.call2me.app`
- URL: `https://api.call2me.app/v1/knowledge-base`
- Auth: HTTP bearer

Create a new knowledge base with optional text and URL sources.

## Request body

- CreateKnowledgeBaseRequest: Request to create a new knowledge base.
  - `knowledge_base_name` string, required: Name of the knowledge base
  - `knowledge_base_texts` KnowledgeBaseTextInput[], nullable: Texts to add
    - `title` string, required: Title of the text
    - `text` string, required: Text content to add
  - `knowledge_base_urls` string[], nullable: URLs to scrape and add
  - `enable_auto_refresh` boolean: Auto-refresh URLs every 12 hours
  - `agent_id` string, nullable: Agent to own/link this knowledge base to

## Response `201`

Successful Response

- KnowledgeBase: Knowledge base response model - matches Retell's schema.
  - `knowledge_base_id` string, required: Unique identifier
  - `knowledge_base_name` string, required: Name of the knowledge base
  - `status` 'in_progress' | 'complete' | 'error' | 'refreshing_in_progress', required: Status of a knowledge base.
  - `knowledge_base_sources` union[]: Sources in this knowledge base
    - union
      - KnowledgeBaseTextSource: Text source in a knowledge base.
        - `type` 'text'
        - `source_id` string, required: Unique identifier for this source
        - `title` string, required: Title of the text content
        - `content` string, required: Text content
      - KnowledgeBaseUrlSource: URL source in a knowledge base.
        - `type` 'url'
        - `source_id` string, required: Unique identifier for this source
        - `url` string, required: URL that was scraped
      - KnowledgeBaseDocumentSource: Document/file source in a knowledge base.
        - `type` 'document'
        - `source_id` string, required: Unique identifier for this source
        - `filename` string, required: Original filename
        - `file_url` string, required: URL to access the file
        - `file_size` integer, required: File size in bytes
  - `enable_auto_refresh` boolean: Auto-refresh URLs every 12 hours
  - `last_refreshed_timestamp` integer, nullable: Last refresh timestamp (ms since epoch)
  - `agent_id` string, nullable: Agent this knowledge base is linked to
  - `chunk_count` integer: Number of chunks in this knowledge base
  - `source_count` integer: Number of sources
  - `created_at` string, date-time, nullable: Creation timestamp

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/call2me/apis/call2me-api.md) · [All operations](https://skmtc.dev/call2me/apis/call2me-api/llms.txt) · [OpenAPI document](https://skmtc.dev/call2me/apis/call2me-api/revisions/3951f9b7e47d?raw)
