#what is the endpoint to update the contents of a kb document?

1 messages · Page 1 of 1 (latest)

acoustic waveBOT
#
AI-generated Answer for seriousram_07773

There isn’t a documented endpoint to update the contents of a knowledge base document. The only “update” endpoint is:

  • PATCH /v1/convai/knowledge-base/{documentation_id} — updates the document name only. (elevenlabs.io)

To change content, recreate the document and (optionally) delete the old one:

  • POST /v1/convai/knowledge-base/text — create from raw text. (elevenlabs.io)
  • POST /v1/convai/knowledge-base/file — create from an uploaded file. (elevenlabs.io)
  • POST /v1/convai/knowledge-base/url — create by scraping a URL. (elevenlabs.io)
  • DELETE /v1/convai/knowledge-base/{documentation_id} — remove the old document (supports force deletion). (elevenlabs.io)

Sources:
Update knowledge base document | ElevenLabs Documentation
Create knowledge base document from text | ElevenLabs Documentation
Create knowledge base document from file | ElevenLabs Documentation
Create knowledge base document from URL | ElevenLabs Documentation
Delete knowledge base document | ElevenLabs Documentation

gusty river
#

Follow up question - The new document needs to be added to the agent?

acoustic waveBOT
#
AI-generated Answer for seriousram_07773

Short answer: Yes—if it’s a new document, you must attach it to the agent.

  • API path: After creating the knowledge base document, call Update agent and include the document in conversation_config.agent.prompt.knowledge_base (each item needs id and type: file|url|text). Example body fragment: "conversation_config": { "agent": { "prompt": { "knowledge_base": [{ "type": "file", "id": "<document_id>" }] } } }. This is the documented way to add documents to an agent. (elevenlabs.io)
  • If you only updated an existing document’s contents (same document_id) and the agent already references it, you typically do not need to re-add it—the agent depends on the document by ID. This follows from the docs’ “document dependencies” model. (Inference based on official docs.) (elevenlabs.io)
  • UI alternative: In the dashboard, open the agent, go to the Knowledge Base section, and click “Add document” to attach existing or newly uploaded docs. (elevenlabs.io)

References:

  • Add to Knowledge Base (note to update the agent afterward) (elevenlabs.io)
  • Update agent API (schema includes knowledge_base) (elevenlabs.io)
  • Knowledge base guide with code sample showing knowledge_base on Update agent (elevenlabs.io)

Sources:
Add To Knowledge Base | ElevenLabs Documentation
Knowledge base dashboard | ElevenLabs Documentation
Knowledge base dashboard | ElevenLabs Documentation
Add To Knowledge Base | ElevenLabs Documentation
Update agent | ElevenLabs Documentation
Knowledge base | ElevenLabs Documentation

gusty river
#

which endpoint to use to get the agent's kb articles?

acoustic waveBOT
#
AI-generated Answer for seriousram_07773

Use GET /v1/convai/agents/:agent_id. The agent response includes the assigned knowledge base under conversation_config.agent.prompt.knowledge_base (list of items with id/type/name). (elevenlabs.io)

If you need full metadata/content for each item, call GET /v1/convai/knowledge-base/:documentation_id for each id. (elevenlabs.io)

Note: the older GET /v1/convai/agents/:agent_id/knowledge-base/:documentation_id path was deprecated in February 2025—use the generic knowledge-base document endpoint instead. (elevenlabs.io)

Sources:
Get agent | ElevenLabs Documentation
Get knowledge base document | ElevenLabs Documentation
February 4, 2025 | ElevenLabs Documentation

gusty river
#

How to remove dependency of agent before deleting a document

acoustic waveBOT
#
AI-generated Answer for seriousram_07773

Here’s the supported way to remove an agent dependency before deleting a knowledge-base document:

  • Find which agents depend on the document:

    • GET /v1/convai/knowledge-base/:documentation_id/dependent-agents. (elevenlabs.io)
  • For each dependent agent, remove the document from its knowledge base:

    • PATCH /v1/convai/agents/:agent_id with a knowledge_base array that excludes that document’s id (the Update Agent schema includes a knowledge_base list of items with id/type/usage_mode). (elevenlabs.io)
  • After all dependencies are removed, delete the document:

    • DELETE /v1/convai/knowledge-base/:documentation_id (without force; deletion is blocked while any agent depends on it). (elevenlabs.io)

Shortcut (if you don’t want to update each agent first):

  • Call DELETE /v1/convai/knowledge-base/:documentation_id?force=true to delete the document and automatically remove it from all dependent agents. (elevenlabs.io)

Sources:
Knowledge base | ElevenLabs Documentation
Update agent | ElevenLabs Documentation
Delete knowledge base document | ElevenLabs Documentation
Delete knowledge base document | ElevenLabs Documentation

gusty river
#

Adding new document to an agent. Please provide the sample payload and the endpoint

acoustic waveBOT
#
AI-generated Answer for seriousram_07773

Here’s the officially documented way to add a new document to an agent:

  1. Create the knowledge base document
  • Endpoint: POST /v1/convai/knowledge-base (multipart: provide either file or url; optional name)
  • Required header: xi-api-key
  • Note: There’s also POST /v1/convai/knowledge-base/url if you’re only supplying a URL. After creation, attach the document to the agent via Update agent. (elevenlabs.io)

Example (create from URL) request body:
{ "url": "https://example.com/faq", "name": "FAQ" } (elevenlabs.io)

  1. Attach the document to the agent
  • Endpoint: PATCH /v1/convai/agents/:agent_id
  • Field to set: conversation_config.agent.prompt.knowledge_base (array of documents)
  • Each entry should include the document id, its type (one of file | url | text), and a name. (elevenlabs.io)

Sample payload (attach a single newly created document):
{
"conversation_config": {
"agent": {
"prompt": {
"knowledge_base": [
{
"id": "kb_doc_12345",
"type": "url",
"name": "FAQ"
}
]
}
}
}
} (elevenlabs.io)

References:

  • Add To Knowledge Base (POST /v1/convai/knowledge-base): headers, multipart fields, and guidance to update the agent afterward. (elevenlabs.io)
  • Create knowledge base document from URL (POST /v1/convai/knowledge-base/url). (elevenlabs.io)
  • Update agent (PATCH /v1/convai/agents/:agent_id). (elevenlabs.io)
  • Knowledge base docs page with example update showing conversation_config.agent.prompt.knowledge_base shape. (elevenlabs.io)
  • Allowed document types (file, url, text). (elevenlabs.io)

Sources:
Add To Knowledge Base | ElevenLabs Documentation
Create knowledge base document from URL | ElevenLabs Documentation
Update agent | ElevenLabs Documentation
Knowledge base | ElevenLabs Documentation
Add To Knowledge Base | ElevenLabs Documentation
Create knowledge base document from URL | ElevenLabs Documentation
Update agent | ElevenLabs Documentation
Knowledge base | ElevenLabs Documentation
List knowledge base documents | ElevenLabs Documentation

gusty river
#

Getting the following error while trying to add a document to an agent
headers: {
'date': 'Sun, 30 Nov 2025 221109 GMT',
'server': 'uvicorn',
'content-length': '84',
'content-type': 'application/json',
'access-control-allow-origin': '',
'access-control-allow-headers': '
',
'access-control-allow-methods': 'POST, PATCH, OPTIONS, DELETE, GET, PUT',
'access-control-max-age': '600',
'strict-transport-security': 'max-age=31536000; includeSubDomains',
'x-trace-id': '9aa47d045b2bb6cf982f92b62c8ee725',
'x-region': 'us-central1',
'via': '1.1 google, 1.1 google',
'alt-svc': 'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000'
},
status_code: 400,
body: {
'detail': {
'status': 'ReadabilityError',
'message': 'Error while running readability'
}
}

acoustic waveBOT
#
AI-generated Answer for seriousram_07773

Short answer: “ReadabilityError” is not documented in ElevenLabs’ public docs. The only documented way to add a web page as a KB doc is the create-from-URL endpoint, which “scrapes the given webpage.” If that scrape fails, the recommended, documented alternatives are to ingest the same content via text or file, then attach the created document to your agent.

What you can do now (all endpoints and payloads are documented):

  • If you’re using the legacy POST /v1/convai/knowledge-base to pass a url, switch to the dedicated endpoint (the legacy “general endpoint” was deprecated in favor of the specialized ones). (elevenlabs.io)
  • Use these creation endpoints as workarounds when a URL scrape fails:
    • POST /v1/convai/knowledge-base/text with { "text": "...", "name": "..." }. (elevenlabs.io)
    • POST /v1/convai/knowledge-base/file as multipart form with file and optional name. (elevenlabs.io)
    • FYI, the URL route is POST /v1/convai/knowledge-base/url with { "url": "https://..." }. (elevenlabs.io)
  • After the document is created, attach it to the agent with PATCH /v1/convai/agents/:agent_id by setting conversation_config.agent.prompt.knowledge_base to include the document’s type, name, and id. The docs include a concrete example of this exact payload shape. (elevenlabs.io)

Notes that might help:

  • KB document types supported are text, url, and file. (elevenlabs.io)
  • For RAG usage later, docs note documents smaller than 500 bytes won’t be indexed (they’ll be used in the prompt instead). This doesn’t explain your error, but it’s useful to know once the document is added. (elevenlabs.io)
  • You can retrieve a document (if creation succeeds) with GET /v1/convai/knowledge-base/:documentation_id; the response includes fields like extracted_inner_html for inspection. (elevenlabs.io)

Because “ReadabilityError” itself isn’t listed in the public error catalog, I can’t confirm the exact root cause from documentation alone. If you share which endpoint and payload you used (and the URL, if

gusty river
#

What is the best practice for notifying the agents that the call center is currently closed before transferring the call to a live agent?

acoustic waveBOT
#
AI-generated Answer for seriousram_07773

Best practice: use the Transfer to Human system tool and include an operator-only “agent_message” that tells the receiving human it’s after-hours before they join the caller.

How to set it up

  • Add the Transfer to Human tool (transfer_to_number) to your agent. Configure a rule for after-hours escalation. (elevenlabs.io)
  • Provide both messages in the tool call:
    • client_message (what the caller hears): e.g., “Our call center is currently closed. I’ll connect you to the on‑call agent.”
    • agent_message (operator-only whisper): e.g., “Heads up: this is an after‑hours transfer. The caller has been informed the center is closed.” (elevenlabs.io)
  • Use the default Conference transfer type so the system calls the destination, plays the operator summary, then leaves the caller and human connected. (elevenlabs.io)
  • You can transfer to Twilio numbers or SIP URIs (via SIP trunking) depending on your telephony setup. (elevenlabs.io)

This approach is explicitly supported in the tool parameters (client_message and agent_message) and is the recommended way to brief live agents during a handoff. (elevenlabs.io)

Sources:
Transfer to human | ElevenLabs Documentation
Transfer to human | ElevenLabs Documentation
Transfer to human | ElevenLabs Documentation
Transfer to human | ElevenLabs Documentation
Transfer to human | ElevenLabs Documentation

gusty river
#

live agent is not available where to set the hours of operation and update it dynamically through API or any other method?

acoustic waveBOT
#
AI-generated Answer for seriousram_07773

Short answer: there isn’t a native “Hours of Operation” switch in ElevenLabs Agents. You implement after-hours behavior by passing or computing “open/closed” state and letting the agent act on it.

Documented ways to do this (all supported today):

  • Pass hours/availability at call start via dynamic variables

    • Use conversation initiation (e.g., Twilio personalization webhook) to return dynamic_variables such as is_open and today_hours; the agent can branch its script accordingly. Dynamic variables also include system__time and system__timezone if you prefer to compute inside the agent.
  • Compute availability on demand with a tool

    • Add a webhook/MCP tool the agent can call to “tell the current time” or fetch business hours from your backend, then decide whether to proceed, transfer, or take a message.
  • Control call outcomes using built‑in system tools

    • Transfer to Human: define rules (e.g., only transfer during open hours); provide messages for the caller and the human. Transfers work with Twilio and SIP numbers. You can also make the destination dynamic at runtime.
    • Voicemail detection: if the handoff rings out or goes to voicemail, detect and leave a pre‑configured message, or end the call.
    • End call: have the agent play a “we’re closed” message and hang up when appropriate.
  • Update behavior dynamically via API

    • You can PATCH agent configuration (prompt, tool config, workflow) to change after‑hours messaging or rules without redeploying.
    • You can also inject or update context mid‑call (e.g., flip is_open) using client‑to‑server contextual updates.
  • Handle hours upstream in your telephony

    • If you prefer to play a closed message before the agent answers, do it at the carrier/IVR layer; ElevenLabs supports inbound routing via Twilio native integration or SIP trunking.

Practical pattern

  • Compute is_open on your server from your hours table and caller timezone.
  • Return it (plus today_hours) in the Twilio personalization webhook response.
  • In the agent prompt/tool descriptions: “If {{is_open}} is true, transfer to the live queue; otherwise, inform the caller we’re closed and offer to take a message or schedule a callback.”
  • Optionally, set the transfer destination via a dynamic variable so the on‑call number can rotate without code changes.

If you need examples for any of the steps above (dynamic variable schema, tool setup, or the PATCH payload), I can point you to the exact snippets from the docs.

gusty river
#

Provide examples for 'Compute availability on demand with a tool' and steps to create. Sample tool with parameters, variable

acoustic waveBOT
#
AI-generated Answer for seriousram_07773

Below are two vetted patterns to “compute availability on demand with a tool,” plus exact steps and a minimal sample tool config that uses parameters and dynamic variables.

Patterns you can implement with a Server (webhook) Tool

  • Hours-of-operation checker: a webhook that takes current time and timezone, returns { open, next_open_at }. Use dynamic variables system__time_utc and system__timezone as inputs, then branch to Transfer to human when open is true. (elevenlabs.io)
  • Live-queue/agent-status checker: a webhook that queries your CCaaS/CRM (e.g., “support” vs “billing” queue) and returns { open, preferred_number }. Use tool assignments to write these values into dynamic variables the agent can reference right before calling transfer_to_number. (elevenlabs.io)

How to build it (end-to-end)

  1. Create a Server Tool (webhook)
  • Define a webhook tool that accepts parameters like now_iso, timezone, and optional queue. You describe the parameters in api_schema so the LLM knows what to send. Keep auth in headers via Workspace Auth/Secrets (Bearer, Basic, OAuth2) as needed. (elevenlabs.io)
  • Use assignments to persist fields from the webhook response into dynamic variables (e.g., is_open, next_open_at, transfer_target). (elevenlabs.io)
  1. Attach the tool to your agent
  • Tools are standalone objects; attach them by ID via prompt.tool_ids (system tools are referenced via prompt.built_in_tools). The legacy prompt.tools field is deprecated and rejected after July 23, 2025. (elevenlabs.io)
  1. Orchestrate behavior in the prompt
  • In your agent’s system prompt, instruct the model to:
    • First call check_agent_availability with now_iso = system__time_utc and timezone = system__timezone (or a custom variable you supply).
    • If is_open is true, call transfer_to_number with the correct transfer_number and messages; otherwise inform the caller of hours/next_open_at and avoid transfer. (elevenlabs.io)
  1. (Optional) Seed variables at call start
  • If the call is coming from Twilio, you can return dynamic variables (e.g., business_timezone) from the inbound personalization webhook so the tool has all needed context on the first turn. (elevenlabs.io)

Minimal example: Create a “check_agent_availability” webhook tool

  • Endpoint returns JSON like:
    { "open": true, "next_open_at": "2025-12-02T16:00:00Z", "preferred_number": "+15551234567" }
  • Tool creation request (fields per API reference):
    POST /v1/convai/tools
    {
    "tool_config": {
    "type": "webhook",
    "name": "check_agent_availability",
    "description": "Checks if a live agent is available now using business hours and queue status. Call this before transferring.",
    "response_timeout_secs": 15,
    "api_schema": {
    "url": "https://your.api/availability",
    "method": "POST",
    "request_body_schema": {
    "type": "object",
    "properties": {
    "now_iso": { "type": "string", "description": "Current time in ISO-8601" },
    "timezone": { "type": "string", "description": "IANA timezone, e.g. America/New_York" },
    "queue": { "type": "string", "description": "Routing queue, e.g. support or billing" }
    },
    "required": ["now_iso",
gusty river
#

I see this line inside a prompt. "- Your knowledge is strictly limited to attached knowledge base. " But I need to use a tool named 'myorg_kbtool' to get realtime knowledge from webhook tool. How can I modify the knowledge base line in the prompt to tell assistant to just only use tool for the knowledge.

acoustic waveBOT
#
AI-generated Answer for seriousram_07773

Short answer: Replace that line with an instruction that prioritizes your webhook tool and forbids using the model’s own knowledge or any attached KB.

Suggested replacement line:

  • For all factual knowledge, you must call the tool “myorg_kbtool” and base responses only on its returned data. Do not rely on the model’s pretraining or any attached knowledge base. If the tool returns no result or errors, ask a clarifying question or state that you don’t know—never guess.

Why this works (per ElevenLabs docs):

  • Agents can call named Webhook (server) tools for real-time data; give the tool a clear name/description so the LLM knows when to use it. You can also guide tool use explicitly in the system prompt. (elevenlabs.io)
  • Guardrail language like “never guess” and explicit error-handling guidance are recommended prompt practices. (elevenlabs.io)
  • If you need to guarantee a tool call at a specific point, add a Dispatch Tool node in Workflows (this enforces the call regardless of prompt wording). (elevenlabs.io)
  • Webhook tools are intended for external APIs/real-time tasks (e.g., “telling the current time”), matching your “realtime knowledge” requirement. (help.elevenlabs.io)

Optional hardening:

  • Detach/omit KB items (or override them in a subagent node) so the tool is the only source during that phase. (elevenlabs.io)

Sources:
Server tools | ElevenLabs Documentation
Prompting guide | ElevenLabs Documentation
Workflows | ElevenLabs Documentation
How to use tools with ElevenLabs Agents (formerly Conversational AI)? – ElevenLabs
Workflows | ElevenLabs Documentation

gusty river
#

does this line make sense? "- Search the attached KB using the 'myorg_kbtool' tool for the most relevant article." Since there will be no kb attached. The assistant must use the tool real time to fetch the articles.

acoustic waveBOT
#
AI-generated Answer for seriousram_07773

Short answer: No. That line implies an attached knowledge base. If you have no KB attached and want the agent to rely only on a tool, instruct it explicitly to use the tool and not any KB.

Recommended prompt line (per ElevenLabs’ prompting guidance to spell out when/how to use tools):

  • “Use the ‘myorg_kbtool’ tool to fetch information in real time. Base all answers solely on this tool’s results; do not use any attached knowledge base or model prior knowledge. If the tool returns no relevant results or errors, ask a clarifying question or state that the information is unavailable.”

Rationale and implementation notes from ElevenLabs docs:

  • You should explain when and how to use each tool in the system prompt and include guardrails; do not rely on vague KB references. (elevenlabs.io)
  • Tools are a separate capability from Knowledge Base; running an agent with tools and no KB is supported. (elevenlabs.io)
  • Ensure the tool is actually wired into the agent (use prompt.tool_ids or built-in tools); prompt text alone won’t enable calls. (elevenlabs.io)
  • Knowledge Base is optional—use it only if you attach documents. (elevenlabs.io)

Sources:
Prompting guide | ElevenLabs Documentation
Tools | ElevenLabs Documentation
Agent tools deprecation | ElevenLabs Documentation
Knowledge base | ElevenLabs Documentation

gusty river
#

How about this line - "- Always use the myorg_kbtool tool to search the knowledge base as the only source of truth. Answering or providing guidance outside the knowledge base is treated as an invalid call response. "

acoustic waveBOT
#
AI-generated Answer for seriousram_07773

Short answer: Close, but tighten it per ElevenLabs’ prompting guidance and include an explicit fallback.

Why:

  • ElevenLabs recommends specifying which tools exist, when to use them, and fallback behavior if a tool fails or returns nothing. It also advises prioritizing tool-sourced knowledge over model memory. (elevenlabs.io)
  • Agents are commonly evaluated against “hallucination_kb” (answers must adhere to the KB), so constraining answers to KB content is valid—provided you define what to do when the KB has no answer. (elevenlabs.io)
  • The knowledge base augments the LLM; if you want it to be the only source of truth, you must state that explicitly in the prompt and add recovery steps. (help.elevenlabs.io)

Suggested line (concise, doc-aligned):

  • Before answering, query the knowledge base with the myorg_kbtool and base your response only on retrieved results; do not rely on memory or speculate. If the tool returns no relevant results or errors, do not answer—inform the user that the information isn’t in the KB and trigger the defined fallback (e.g., redirect to docs/support). (elevenlabs.io)

This keeps “KB-only” behavior while following ElevenLabs’ guidance on tool usage and error handling. (elevenlabs.io)

Sources:
ElevenLabs Agents prompting guide | ElevenLabs Documentation
Building an effective Voice Agent for our own docs
What can I create with ElevenLabs Agents (formerly Conversational AI) – ElevenLabs
ElevenLabs Agents prompting guide | ElevenLabs Documentation
ElevenLabs Agents prompting guide | ElevenLabs Documentation

gusty river
#

Can I add this line in the prompt as the tool is used realtime for knowledge base - "Use tool myorg_kbtool for knowledge base."