curl -X PUT "https://api.leavo.ai/backend/knowledge/9f1c2d34-5678-4abc-9def-0123456789ab" \ -H "Authorization: Bearer your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "name": "Return policy 2026", "content": "Returns within 45 days upon presentation of the receipt." }'
const id = '9f1c2d34-5678-4abc-9def-0123456789ab';const response = await fetch(`https://api.leavo.ai/backend/knowledge/${id}`, { method: 'PUT', headers: { 'Authorization': 'Bearer your_api_key_here', 'Content-Type': 'application/json' }, body: JSON.stringify({ name: 'Return policy 2026', content: 'Returns within 45 days upon presentation of the receipt.' })});console.log(await response.json());
import requestsknowledge_id = '9f1c2d34-5678-4abc-9def-0123456789ab'response = requests.put( f'https://api.leavo.ai/backend/knowledge/{knowledge_id}', headers={'Authorization': 'Bearer your_api_key_here'}, json={ 'name': 'Return policy 2026', 'content': 'Returns within 45 days with the receipt.' })print(response.json())
{ "id": "9f1c2d34-5678-4abc-9def-0123456789ab", "tenant_id": "d6b10acc-2307-413f-a4de-4c2edf3f9a70", "name": "Return policy 2026", "description": "Exchange and return rules", "content": "Returns within 45 days upon presentation of the receipt.", "source_url": null, "usage_instruction": "Use when the lead asks about exchanges or returns.", "assistant_id": null, "excluded_assistant_ids": [], "created_at": "2026-01-15T10:30:00Z", "updated_at": "2026-02-10T08:45:00Z"}
Knowledge Base
Update Knowledge
Modify an existing knowledge item or change its owning assistant
PUT
/
backend
/
knowledge
/
{id}
curl -X PUT "https://api.leavo.ai/backend/knowledge/9f1c2d34-5678-4abc-9def-0123456789ab" \ -H "Authorization: Bearer your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "name": "Return policy 2026", "content": "Returns within 45 days upon presentation of the receipt." }'
const id = '9f1c2d34-5678-4abc-9def-0123456789ab';const response = await fetch(`https://api.leavo.ai/backend/knowledge/${id}`, { method: 'PUT', headers: { 'Authorization': 'Bearer your_api_key_here', 'Content-Type': 'application/json' }, body: JSON.stringify({ name: 'Return policy 2026', content: 'Returns within 45 days upon presentation of the receipt.' })});console.log(await response.json());
import requestsknowledge_id = '9f1c2d34-5678-4abc-9def-0123456789ab'response = requests.put( f'https://api.leavo.ai/backend/knowledge/{knowledge_id}', headers={'Authorization': 'Bearer your_api_key_here'}, json={ 'name': 'Return policy 2026', 'content': 'Returns within 45 days with the receipt.' })print(response.json())
{ "id": "9f1c2d34-5678-4abc-9def-0123456789ab", "tenant_id": "d6b10acc-2307-413f-a4de-4c2edf3f9a70", "name": "Return policy 2026", "description": "Exchange and return rules", "content": "Returns within 45 days upon presentation of the receipt.", "source_url": null, "usage_instruction": "Use when the lead asks about exchanges or returns.", "assistant_id": null, "excluded_assistant_ids": [], "created_at": "2026-01-15T10:30:00Z", "updated_at": "2026-02-10T08:45:00Z"}
Partial update: send only the fields you want to change. Fields left out stay
as they are.
Path Parameters
string
required
Knowledge item UUID
Body
string
New name (1 to 255 characters)
string
New description, up to 1000 characters
string
New indexed text. Replaces the previous content.
string
New usage instruction, up to 2000 characters
string
Changes the scope of the knowledge item. See the table below.
Changing the owning assistant
The assistant_id field has three distinct behaviors:
What you send
Effect
field absent
Scope stays as it is
"" (empty string)
Makes the knowledge item global
An assistant’s UUID
Links the knowledge item to that assistant
Sending "" is not the same as omitting the field. The empty string is what
removes the link to the assistant and returns the knowledge item to the global
scope.
Response
Returns 200 OK with the updated knowledge item.
curl -X PUT "https://api.leavo.ai/backend/knowledge/9f1c2d34-5678-4abc-9def-0123456789ab" \ -H "Authorization: Bearer your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "name": "Return policy 2026", "content": "Returns within 45 days upon presentation of the receipt." }'
const id = '9f1c2d34-5678-4abc-9def-0123456789ab';const response = await fetch(`https://api.leavo.ai/backend/knowledge/${id}`, { method: 'PUT', headers: { 'Authorization': 'Bearer your_api_key_here', 'Content-Type': 'application/json' }, body: JSON.stringify({ name: 'Return policy 2026', content: 'Returns within 45 days upon presentation of the receipt.' })});console.log(await response.json());
import requestsknowledge_id = '9f1c2d34-5678-4abc-9def-0123456789ab'response = requests.put( f'https://api.leavo.ai/backend/knowledge/{knowledge_id}', headers={'Authorization': 'Bearer your_api_key_here'}, json={ 'name': 'Return policy 2026', 'content': 'Returns within 45 days with the receipt.' })print(response.json())
{ "id": "9f1c2d34-5678-4abc-9def-0123456789ab", "tenant_id": "d6b10acc-2307-413f-a4de-4c2edf3f9a70", "name": "Return policy 2026", "description": "Exchange and return rules", "content": "Returns within 45 days upon presentation of the receipt.", "source_url": null, "usage_instruction": "Use when the lead asks about exchanges or returns.", "assistant_id": null, "excluded_assistant_ids": [], "created_at": "2026-01-15T10:30:00Z", "updated_at": "2026-02-10T08:45:00Z"}