POST /add-knowledge-base-sources/{knowledge_base_id}

Changed on

Add sources to a knowledge base

Request

  • Base URL
    https://api.retellai.com
  • Auth
    HTTP bearer

Path parameters

knowledge_base_idstring required
Example:kb_1234567890

The knowledge base id to delete source from.

Request body multipart/form-data

knowledge_base_filesstring[]

Files to add to the knowledge base. Limit to 25 files, where each file is limited to 50MB.

knowledge_base_urlsstring[]

URLs to be scraped and added to the knowledge base. Must be valid urls.

Example request

{
  "knowledge_base_urls": [
    "https://www.example.com",
    "https://www.retellai.com"
  ]
}

Response

Successfully created a new knowledge base.

knowledge_base_idstring required

Unique id of the knowledge base.

knowledge_base_namestring required

Name of the knowledge base. Must be less than 40 characters.

status'in_progress' | 'complete' | 'error' | 'refreshing_in_progress' required

Current processing state of the knowledge base:

  • in_progress: Initial indexing is running. Source metadata may be incomplete until indexing finishes.
  • complete: Initial indexing or the latest update or refresh finished. Individual source failures may still be reported in error_messages.
  • error: Initial indexing failed. Source metadata may be incomplete.
  • refreshing_in_progress: An existing knowledge base is being updated. This includes indexing newly added sources or running a manual or automatic refresh that re-indexes URLs, Google Drive files, Microsoft OneDrive files, and pages from auto-crawling paths. Previously indexed sources remain available during the update, and the source list may change when it finishes.
max_chunk_sizeinteger

Maximum number of characters per chunk when splitting knowledge base content.

min_chunk_sizeinteger

Minimum number of characters per chunk. Chunks smaller than this are merged with adjacent chunks.

enable_auto_refreshboolean

Whether eligible URL and connected-file sources refresh automatically on a daily cadence.

last_refreshed_timestampinteger

Last refreshed timestamp (milliseconds since epoch). Only applicable when enable_auto_refresh is true.

Example response

{
  "knowledge_base_id": "knowledge_base_a456426614174000",
  "knowledge_base_name": "Sample KB",
  "status": "in_progress",
  "max_chunk_size": 2000,
  "min_chunk_size": 400,
  "enable_auto_refresh": true,
  "last_refreshed_timestamp": 1703413636133
}

Changes

    • info

      added the required property ////// to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status