Retell AI Knowledge Base API

The Knowledge Base API from Retell AI — 6 operation(s) for knowledge base.

Documentation

📖
Documentation
https://docs.retellai.com/build/create-your-first-agent
📖
APIReference
https://docs.retellai.com/api-references/create-agent
📖
Documentation
https://docs.retellai.com/build/llms/overview
📖
APIReference
https://docs.retellai.com/api-references/create-retell-llm
📖
Documentation
https://docs.retellai.com/build/conversation-flow/overview
📖
APIReference
https://docs.retellai.com/api-references/create-conversation-flow
📖
Documentation
https://docs.retellai.com/make-calls/outbound-call
📖
APIReference
https://docs.retellai.com/api-references/create-phone-call
📖
Documentation
https://docs.retellai.com/make-calls/web-call
📖
APIReference
https://docs.retellai.com/api-references/create-web-call
📖
Documentation
https://docs.retellai.com/deploy/phone-number
📖
APIReference
https://docs.retellai.com/api-references/create-phone-number
📖
Documentation
https://docs.retellai.com/build/voices
📖
APIReference
https://docs.retellai.com/api-references/list-voices
📖
Documentation
https://docs.retellai.com/build/knowledge-base
📖
APIReference
https://docs.retellai.com/api-references/create-knowledge-base
📖
Documentation
https://docs.retellai.com/make-calls/batch-call
📖
APIReference
https://docs.retellai.com/api-references/create-batch-call
📖
APIReference
https://docs.retellai.com/api-references/get-concurrency
📖
RateLimits
https://raw.githubusercontent.com/api-evangelist/retell/refs/heads/main/rate-limits/retell-rate-limits.yml

Specifications

OpenAPI Specification

retell-knowledge-base-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Retell AI Agent Knowledge Base API
  description: REST API for building, testing, and deploying AI voice agents that make and receive phone and web calls. Configure a response engine (Retell LLM, a custom LLM, or a Conversation Flow), attach a voice, provision phone numbers, place outbound and web calls, run batch campaigns, ground agents with knowledge bases, and read back transcripts, recordings, and call analysis. All endpoints are authenticated with a Bearer API key.
  termsOfService: https://www.retellai.com/terms-of-service
  contact:
    name: Retell AI Support
    url: https://docs.retellai.com
  version: '2.0'
servers:
- url: https://api.retellai.com
security:
- api_key: []
tags:
- name: Knowledge Base
paths:
  /create-knowledge-base:
    post:
      operationId: createKnowledgeBase
      tags:
      - Knowledge Base
      summary: Create a knowledge base.
      description: Creates a knowledge base from texts, files, and/or URLs that agents can retrieve from (RAG) during calls.
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CreateKnowledgeBaseRequest'
      responses:
        '201':
          description: Knowledge base created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeBaseResponse'
  /get-knowledge-base/{knowledge_base_id}:
    get:
      operationId: getKnowledgeBase
      tags:
      - Knowledge Base
      summary: Retrieve a knowledge base.
      parameters:
      - $ref: '#/components/parameters/KnowledgeBaseId'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeBaseResponse'
  /list-knowledge-bases:
    get:
      operationId: listKnowledgeBases
      tags:
      - Knowledge Base
      summary: List all knowledge bases.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/KnowledgeBaseResponse'
  /delete-knowledge-base/{knowledge_base_id}:
    delete:
      operationId: deleteKnowledgeBase
      tags:
      - Knowledge Base
      summary: Delete a knowledge base.
      parameters:
      - $ref: '#/components/parameters/KnowledgeBaseId'
      responses:
        '204':
          description: Knowledge base deleted.
  /add-knowledge-base-sources/{knowledge_base_id}:
    post:
      operationId: addKnowledgeBaseSources
      tags:
      - Knowledge Base
      summary: Add sources to a knowledge base.
      parameters:
      - $ref: '#/components/parameters/KnowledgeBaseId'
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/AddKnowledgeBaseSourcesRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeBaseResponse'
  /delete-knowledge-base-source/{knowledge_base_id}/source/{source_id}:
    delete:
      operationId: deleteKnowledgeBaseSource
      tags:
      - Knowledge Base
      summary: Delete a knowledge base source.
      parameters:
      - $ref: '#/components/parameters/KnowledgeBaseId'
      - name: source_id
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeBaseResponse'
components:
  schemas:
    CreateKnowledgeBaseRequest:
      type: object
      required:
      - knowledge_base_name
      properties:
        knowledge_base_name:
          type: string
          maxLength: 40
        knowledge_base_texts:
          type: array
          items:
            type: object
            properties:
              title:
                type: string
              text:
                type: string
        knowledge_base_files:
          type: array
          items:
            type: string
            format: binary
        knowledge_base_urls:
          type: array
          items:
            type: string
        enable_auto_refresh:
          type: boolean
    KnowledgeBaseResponse:
      type: object
      properties:
        knowledge_base_id:
          type: string
        knowledge_base_name:
          type: string
        status:
          type: string
          enum:
          - in_progress
          - complete
          - error
          - refreshing_in_progress
        enable_auto_refresh:
          type: boolean
        last_refreshed_timestamp:
          type: integer
        knowledge_base_sources:
          type: array
          items:
            type: object
            properties:
              source_id:
                type: string
              type:
                type: string
                enum:
                - document
                - text
                - url
              filename:
                type: string
              url:
                type: string
    AddKnowledgeBaseSourcesRequest:
      type: object
      properties:
        knowledge_base_texts:
          type: array
          items:
            type: object
        knowledge_base_files:
          type: array
          items:
            type: string
            format: binary
        knowledge_base_urls:
          type: array
          items:
            type: string
  parameters:
    KnowledgeBaseId:
      name: knowledge_base_id
      in: path
      required: true
      schema:
        type: string
  securitySchemes:
    api_key:
      type: http
      scheme: bearer
      bearerFormat: apiKey
      description: 'Retell API key, sent as: Authorization: Bearer <RETELL_API_KEY>'