curl -X GET "https://api.leavo.ai/backend/knowledge" \
-H "Authorization: Bearer your_api_key_here"
const response = await fetch('https://api.leavo.ai/backend/knowledge', {
headers: {
'Authorization': 'Bearer your_api_key_here'
}
});
const knowledgeItems = await response.json();
console.log(`${knowledgeItems.length} items in the knowledge base`);
import requests
response = requests.get(
'https://api.leavo.ai/backend/knowledge',
headers={'Authorization': 'Bearer your_api_key_here'}
)
for item in response.json():
scope = 'global' if item['assistant_id'] is None else 'exclusive'
print(item['name'], '-', scope)
[
{
"id": "9f1c2d34-5678-4abc-9def-0123456789ab",
"tenant_id": "d6b10acc-2307-413f-a4de-4c2edf3f9a70",
"name": "Return policy",
"description": "Exchange and return rules",
"content": "Returns within 30 days with the receipt...",
"source_url": null,
"usage_instruction": "Use when the lead asks about exchanges.",
"assistant_id": null,
"excluded_assistant_ids": [],
"created_at": "2026-01-15T10:30:00Z",
"updated_at": "2026-02-02T09:12:00Z"
},
{
"id": "1a2b3c4d-5e6f-4071-8293-a4b5c6d7e8f9",
"tenant_id": "d6b10acc-2307-413f-a4de-4c2edf3f9a70",
"name": "Qualification script",
"description": "",
"content": "Questions to qualify the lead...",
"source_url": null,
"usage_instruction": null,
"assistant_id": "3f8a1b2c-4d5e-6f70-8192-a3b4c5d6e7f8",
"excluded_assistant_ids": [],
"created_at": "2026-01-20T14:00:00Z",
"updated_at": "2026-01-20T14:00:00Z"
}
]
Knowledge Base
List Knowledge
List the organization’s knowledge items and retrieve a specific one
GET
/
backend
/
knowledge
curl -X GET "https://api.leavo.ai/backend/knowledge" \
-H "Authorization: Bearer your_api_key_here"
const response = await fetch('https://api.leavo.ai/backend/knowledge', {
headers: {
'Authorization': 'Bearer your_api_key_here'
}
});
const knowledgeItems = await response.json();
console.log(`${knowledgeItems.length} items in the knowledge base`);
import requests
response = requests.get(
'https://api.leavo.ai/backend/knowledge',
headers={'Authorization': 'Bearer your_api_key_here'}
)
for item in response.json():
scope = 'global' if item['assistant_id'] is None else 'exclusive'
print(item['name'], '-', scope)
[
{
"id": "9f1c2d34-5678-4abc-9def-0123456789ab",
"tenant_id": "d6b10acc-2307-413f-a4de-4c2edf3f9a70",
"name": "Return policy",
"description": "Exchange and return rules",
"content": "Returns within 30 days with the receipt...",
"source_url": null,
"usage_instruction": "Use when the lead asks about exchanges.",
"assistant_id": null,
"excluded_assistant_ids": [],
"created_at": "2026-01-15T10:30:00Z",
"updated_at": "2026-02-02T09:12:00Z"
},
{
"id": "1a2b3c4d-5e6f-4071-8293-a4b5c6d7e8f9",
"tenant_id": "d6b10acc-2307-413f-a4de-4c2edf3f9a70",
"name": "Qualification script",
"description": "",
"content": "Questions to qualify the lead...",
"source_url": null,
"usage_instruction": null,
"assistant_id": "3f8a1b2c-4d5e-6f70-8192-a3b4c5d6e7f8",
"excluded_assistant_ids": [],
"created_at": "2026-01-20T14:00:00Z",
"updated_at": "2026-01-20T14:00:00Z"
}
]
Returns every knowledge item in the organization, both global and
assistant-specific ones.
Returns
Response
Returns200 OK with an array of knowledge objects.
string
Knowledge item UUID
string
Display name
string
Indexed text of the knowledge item
string | null
null when the knowledge is global; a UUID when it belongs to a single assistantarray
Assistants that do not see this global knowledge item
curl -X GET "https://api.leavo.ai/backend/knowledge" \
-H "Authorization: Bearer your_api_key_here"
const response = await fetch('https://api.leavo.ai/backend/knowledge', {
headers: {
'Authorization': 'Bearer your_api_key_here'
}
});
const knowledgeItems = await response.json();
console.log(`${knowledgeItems.length} items in the knowledge base`);
import requests
response = requests.get(
'https://api.leavo.ai/backend/knowledge',
headers={'Authorization': 'Bearer your_api_key_here'}
)
for item in response.json():
scope = 'global' if item['assistant_id'] is None else 'exclusive'
print(item['name'], '-', scope)
[
{
"id": "9f1c2d34-5678-4abc-9def-0123456789ab",
"tenant_id": "d6b10acc-2307-413f-a4de-4c2edf3f9a70",
"name": "Return policy",
"description": "Exchange and return rules",
"content": "Returns within 30 days with the receipt...",
"source_url": null,
"usage_instruction": "Use when the lead asks about exchanges.",
"assistant_id": null,
"excluded_assistant_ids": [],
"created_at": "2026-01-15T10:30:00Z",
"updated_at": "2026-02-02T09:12:00Z"
},
{
"id": "1a2b3c4d-5e6f-4071-8293-a4b5c6d7e8f9",
"tenant_id": "d6b10acc-2307-413f-a4de-4c2edf3f9a70",
"name": "Qualification script",
"description": "",
"content": "Questions to qualify the lead...",
"source_url": null,
"usage_instruction": null,
"assistant_id": "3f8a1b2c-4d5e-6f70-8192-a3b4c5d6e7f8",
"excluded_assistant_ids": [],
"created_at": "2026-01-20T14:00:00Z",
"updated_at": "2026-01-20T14:00:00Z"
}
]
Retrieve a specific knowledge item
GET /backend/knowledge/{id}
Path Parameters
string
required
Knowledge item UUID
200 OK with a single knowledge object, or 404 if the item does not
exist in your organization.
curl -X GET "https://api.leavo.ai/backend/knowledge/9f1c2d34-5678-4abc-9def-0123456789ab" \
-H "Authorization: Bearer your_api_key_here"
const id = '9f1c2d34-5678-4abc-9def-0123456789ab';
const response = await fetch(`https://api.leavo.ai/backend/knowledge/${id}`, {
headers: {
'Authorization': 'Bearer your_api_key_here'
}
});
if (response.status === 404) {
console.log('Knowledge not found');
} else {
console.log(await response.json());
}
Errors
| Code | Description |
|---|---|
401 | Missing or invalid API key |
404 | Knowledge item not found in this organization |
⌘I