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

# Add Source

> Add a source to a knowledge base. Supports three source types:
- **Text**: Send JSON with `sourceType: "text"`, `displayName`, and `content`
- **URL**: Send JSON with `sourceType: "url"` and `originalUrl`
- **File**: Send `multipart/form-data` with a `file` field (max 20MB)

Maximum of 10 sources per knowledge base. Sources are processed asynchronously.



## OpenAPI

````yaml POST /knowledge-bases/{id}/sources
openapi: 3.1.0
info:
  title: RevRing Voice AI API
  description: >-
    RevRing Voice AI platform API for managing AI voice agents, phone calls, SIP
    trunks, and analytics. Build intelligent voice applications that can handle
    inbound and outbound phone calls with AI-powered conversational agents.
  version: 1.0.0
  contact:
    name: RevRing Support
    url: https://revring.ai
servers:
  - url: https://api.revring.ai/v1
    description: Production API
security:
  - apiKeyAuth: []
tags:
  - name: Messaging Connections
    description: Connect messaging providers so agents can send text messages
  - name: Messages
    description: Send text messages and read your message log
  - name: Conversations
    description: List and clear managed conversation threads
  - name: SIP Trunks
    description: Manage SIP trunks for connecting agents to the phone network
  - name: Agents
    description: Manage AI voice agents and their configuration
  - name: Agent Folders
    description: Organize agents into folders for dashboard navigation
  - name: Calls
    description: Manage and query phone calls
  - name: Analytics
    description: Get analytics and metrics about your calls
  - name: Knowledge Bases
    description: >-
      Manage knowledge bases and sources for agent retrieval-augmented
      generation
  - name: Test Suites
    description: Manage test suites, test cases, and test runs for agent evaluation
  - name: Voices
    description: Browse the voices available to your organization for agent speech
paths:
  /knowledge-bases/{id}/sources:
    parameters:
      - name: id
        in: path
        required: true
        description: Knowledge base ID
        schema:
          type: string
          format: uuid
    post:
      tags:
        - Knowledge Bases
      summary: Add Source
      description: >-
        Add a source to a knowledge base. Supports three source types:

        - **Text**: Send JSON with `sourceType: "text"`, `displayName`, and
        `content`

        - **URL**: Send JSON with `sourceType: "url"` and `originalUrl`

        - **File**: Send `multipart/form-data` with a `file` field (max 20MB)


        Maximum of 10 sources per knowledge base. Sources are processed
        asynchronously.
      operationId: addKnowledgeBaseSource
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/KnowledgeSourceCreateText'
                - $ref: '#/components/schemas/KnowledgeSourceCreateUrl'
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: File to upload (max 20MB)
              required:
                - file
      responses:
        '201':
          description: Source added
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/KnowledgeSource'
        '400':
          description: Invalid request or source limit reached
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '402':
          $ref: '#/components/responses/BillingInactiveError'
        '404':
          $ref: '#/components/responses/NotFoundError'
components:
  schemas:
    KnowledgeSourceCreateText:
      type: object
      description: Create a text source
      properties:
        sourceType:
          type: string
          enum:
            - text
        displayName:
          type: string
          maxLength: 256
          description: Display name
        content:
          type: string
          maxLength: 100000
          description: Text content
      required:
        - sourceType
        - displayName
        - content
    KnowledgeSourceCreateUrl:
      type: object
      description: Create a URL source
      properties:
        sourceType:
          type: string
          enum:
            - url
        displayName:
          type: string
          maxLength: 256
          description: Display name (optional, auto-generated from URL if omitted)
        originalUrl:
          type: string
          format: uri
          description: URL to fetch content from (http/https only)
      required:
        - sourceType
        - originalUrl
    KnowledgeSource:
      type: object
      description: A source within a knowledge base
      properties:
        id:
          type: string
          format: uuid
        knowledgeBaseId:
          type: string
          format: uuid
        sourceType:
          type: string
          enum:
            - file
            - url
            - text
          description: Type of source
        displayName:
          type: string
          description: Display name of the source
        content:
          type: string
          nullable: true
          description: Text content (for text sources)
        originalUrl:
          type: string
          nullable: true
          description: Original URL (for URL sources)
        mimeType:
          type: string
          nullable: true
          description: MIME type (for file sources)
        fileSize:
          type: integer
          nullable: true
          description: File size in bytes (for file sources)
        status:
          type: string
          enum:
            - queued
            - processing
            - ready
            - failed
          description: Processing status
        errorMessage:
          type: string
          nullable: true
          description: Error message if processing failed
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
        - id
        - knowledgeBaseId
        - sourceType
        - displayName
        - status
        - createdAt
        - updatedAt
  responses:
    UnauthorizedError:
      description: Authentication required or API key invalid
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: unauthorized
    BillingInactiveError:
      description: Subscription inactive or billing issue
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: billing_inactive
    NotFoundError:
      description: Resource not found
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: not_found
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key for authentication. Generate API keys from the RevRing
        dashboard.

````