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

> ## Agent Instructions
> To search or read these docs, connect the Ringg docs MCP server at https://docs.ringg.ai/mcp (no key needed; tools search_ringg_ai and query_docs_filesystem_ringg_ai) instead of browsing pages one by one. Setup for each client: https://docs.ringg.ai/resources/mcp-server/docs-mcp-server/mcp-for-ai-assistants.md
> The dashboard labels agents "Assistants"; these docs say "agent". Both mean the same object, identified by agent_id.
> API base URL: https://prod-api.ringg.ai/ca/api/v0. Send the workspace API key in the X-API-KEY header, from server-side code only.
> Placing a call dials a real phone number and spends credits. Confirm the number with the user before calling.
> To act on a Ringg workspace (place calls, edit agents, read transcripts), use the separate Ringg workspace MCP server at https://mcp.ringg.ai/mcp: https://docs.ringg.ai/resources/mcp-server/workspace-mcp-server/overview.md

> Add files, URLs or FAQs to a knowledge base and remove existing ones by ID in one request, keeping its kb_id and the agents it is attached to.

# Edit Knowledge Base

export const RelatedTopics = ({items}) => <div className="not-prose mt-12">
    <div className="text-sm font-medium text-gray-500 dark:text-zinc-400 mb-3">Related topics</div>
    <div className="flex flex-col gap-2.5">
      {items.map(([title, href]) => <a key={href} href={href} className="flex items-center gap-2.5 text-sm text-gray-700 hover:text-gray-950 dark:text-zinc-300 dark:hover:text-white">
          <Icon icon="file-text" size={16} color="currentColor" />
          {title}
        </a>)}
    </div>
  </div>;

New content is processed in the background, as on creation.

## Add content

* `new_files`: 2 MB each, 5 MB in total, with optional `new_files_metadata`
* `new_faqs`: each FAQ is a `{"question", "answer"}` object

## Remove content

Pass IDs from [Get knowledge base](/api-reference/inventory/knowledge-bases/get-knowledge-base-by-id). Removal is permanent.

```bash theme={null}
curl --request PATCH "https://prod-api.ringg.ai/ca/api/v0/external/kb" \
  --header "X-API-KEY: $RINGG_API_KEY" \
  --form 'kb_id="550e8400-e29b-41d4-a716-446655440000"' \
  --form 'files_to_remove="[\"7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d\"]"' \
  --form 'urls_to_remove="[\"https://example.com/old-page\"]"' \
  --form 'new_urls="[\"https://example.com/new-docs\"]"'
```

<RelatedTopics items={[["Knowledge base", "/documentation/build-agents/customize-agent-behaviour/attach-a-knowledge-base"]]} />


## OpenAPI

````yaml patch /external/kb
openapi: 3.0.0
info:
  title: Ringg AI API Documentation
  description: >-
    The Ringg AI REST API. Base URL https://prod-api.ringg.ai/ca/api/v0; send
    your workspace API key in the X-API-KEY header from server-side code only.
    Requests and responses are JSON.
  version: 2.0.0
  contact:
    name: Ringg AI support
    email: admin@ringg.ai
    url: https://docs.ringg.ai
servers:
  - url: https://prod-api.ringg.ai/ca/api/v0
security: []
tags:
  - name: workspace
    description: Endpoints for managing your workspace.
  - name: agent
    description: Endpoints for managing agents.
  - name: calling
    description: Endpoints for making and managing calls.
  - name: campaign
    description: Endpoints for managing campaigns.
  - name: analytics
    description: Endpoints for accessing call analytics and performance metrics.
  - name: termination
    description: Endpoints for terminating active calls using different methods.
  - name: knowledgebase
    description: Endpoints for managing knowledge bases.
paths:
  /external/kb:
    patch:
      tags:
        - knowledgebase
      summary: Edit Knowledge Base
      description: >-
        Edits an existing knowledge base by adding or removing files, URLs, and
        FAQs. Rate limit: 20 requests per hour per workspace. File size limit: 2
        MB per file, 5 MB total.
      operationId: editKnowledgeBase
      parameters:
        - name: X-API-KEY
          in: header
          description: (Required) Your Ringg AI API key.
          required: true
          schema:
            type: string
            example: rg_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - kb_id
              properties:
                kb_id:
                  type: string
                  description: (Required) ID of the knowledge base to edit
                  example: 550e8400-e29b-41d4-a716-446655440000
                files_to_remove:
                  type: string
                  description: (Optional) JSON string array of file IDs to remove
                  example: >-
                    ["7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d",
                    "8b9c0d1e-2f3a-4b5c-6d7e-8f9a0b1c2d3e"]
                urls_to_remove:
                  type: string
                  description: (Optional) JSON string array of URLs to remove
                  example: '["https://example.com/old-page"]'
                faqs_to_remove:
                  type: string
                  description: (Optional) JSON string array of FAQ IDs to remove
                  example: >-
                    ["9c0d1e2f-3a4b-5c6d-7e8f-9a0b1c2d3e4f",
                    "0d1e2f3a-4b5c-6d7e-8f9a-0b1c2d3e4f5a"]
                new_files:
                  type: array
                  items:
                    type: string
                    format: binary
                  description: (Optional) Array of new files to upload
                new_urls:
                  type: string
                  description: (Optional) JSON string array of new URLs to add
                  example: '["https://example.com/new-docs"]'
                new_faqs:
                  type: string
                  description: (Optional) JSON string array of new FAQ objects
                  example: >-
                    [{"question": "Do you ship internationally?", "answer":
                    "Yes, worldwide shipping available"}]
                new_files_metadata:
                  type: string
                  description: (Optional) JSON string object with metadata for new files
                  example: '{}'
      responses:
        '200':
          description: Knowledge base updated successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Knowledge Base edit initiated
                  kb_id:
                    type: string
                    example: 550e8400-e29b-41d4-a716-446655440000
                  items_removed:
                    type: integer
                    example: 2
                  new_files_queued:
                    type: integer
                    example: 1
                  new_files:
                    type: array
                    items:
                      type: object
                      properties:
                        filename:
                          type: string
                          example: document.pdf
                        file_id:
                          type: string
                          example: 1e2f3a4b-5c6d-7e8f-9a0b-1c2d3e4f5a6b
                        processing_status:
                          type: string
                          example: pending
        '400':
          description: Bad Request - Invalid parameters.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
        '401':
          description: Unauthorized - Invalid or missing API key.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Invalid credentials
        '404':
          description: Knowledge base not found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
        '429':
          description: Rate limit exceeded - Maximum 20 requests per hour.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.