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 requests
knowledge_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 requests
knowledge_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
Theassistant_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
Returns200 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 requests
knowledge_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"
}
Link to an assistant
cURL
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 '{"assistant_id": "3f8a1b2c-4d5e-6f70-8192-a3b4c5d6e7f8"}'
Make it global again
cURL
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 '{"assistant_id": ""}'
Replace the file
Send the request asmultipart/form-data with the file field. The same
extensions and the same 10 MB limit from
creation apply.
cURL
curl -X PUT "https://api.leavo.ai/backend/knowledge/9f1c2d34-5678-4abc-9def-0123456789ab" \
-H "Authorization: Bearer your_api_key_here" \
-F "name=Product manual v2" \
-F "file=@manual_v2.pdf"
Errors
| Code | Description |
|---|---|
400 | Field over the character limit, empty name, unsupported extension, or file over 10 MB |
401 | Missing or invalid API key |
404 | Knowledge item not found, or assistant_id does not belong to this organization |
⌘I