curl -X POST https://api.magpipe.ai/functions/v1/list-knowledge-sources \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'
const response = await fetch(
'https://api.magpipe.ai/functions/v1/list-knowledge-sources',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({}),
}
);
const { sources, total } = await response.json();
console.log(`You have ${total} knowledge sources`);
import requests
response = requests.post(
'https://api.magpipe.ai/functions/v1/list-knowledge-sources',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={}
)
data = response.json()
print(f"You have {data['total']} knowledge sources")
{
"sources": [
{
"id": "f7a8b9c0-d1e2-3f4a-5b6c-789012def345",
"url": "https://example.com/help/faq",
"title": "Frequently Asked Questions",
"sync_status": "completed",
"chunk_count": 24,
"last_synced_at": "2024-01-15T10:35:00Z",
"next_sync_at": "2024-01-22T10:35:00Z",
"created_at": "2024-01-15T10:30:00Z"
},
{
"id": "a8b9c0d1-e2f3-4a5b-6c7d-890123ef4567",
"url": "https://example.com/products",
"title": "Our Products",
"sync_status": "completed",
"chunk_count": 18,
"last_synced_at": "2024-01-14T08:00:00Z",
"next_sync_at": "2024-02-14T08:00:00Z",
"created_at": "2024-01-14T08:00:00Z"
}
],
"total": 2
}
Knowledge Base
List Knowledge Sources
List all knowledge sources in your account
POST
/
list-knowledge-sources
curl -X POST https://api.magpipe.ai/functions/v1/list-knowledge-sources \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'
const response = await fetch(
'https://api.magpipe.ai/functions/v1/list-knowledge-sources',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({}),
}
);
const { sources, total } = await response.json();
console.log(`You have ${total} knowledge sources`);
import requests
response = requests.post(
'https://api.magpipe.ai/functions/v1/list-knowledge-sources',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={}
)
data = response.json()
print(f"You have {data['total']} knowledge sources")
{
"sources": [
{
"id": "f7a8b9c0-d1e2-3f4a-5b6c-789012def345",
"url": "https://example.com/help/faq",
"title": "Frequently Asked Questions",
"sync_status": "completed",
"chunk_count": 24,
"last_synced_at": "2024-01-15T10:35:00Z",
"next_sync_at": "2024-01-22T10:35:00Z",
"created_at": "2024-01-15T10:30:00Z"
},
{
"id": "a8b9c0d1-e2f3-4a5b-6c7d-890123ef4567",
"url": "https://example.com/products",
"title": "Our Products",
"sync_status": "completed",
"chunk_count": 18,
"last_synced_at": "2024-01-14T08:00:00Z",
"next_sync_at": "2024-02-14T08:00:00Z",
"created_at": "2024-01-14T08:00:00Z"
}
],
"total": 2
}
Retrieve all knowledge sources configured for your AI agents.
Request Body
integer
default:50
Maximum sources to return. Max: 100.
integer
default:0
Number of records to skip for pagination.
string
Filter by sync status:
pending, syncing, completed, failed.Response
array
Array of knowledge source objects.
integer
Total number of knowledge sources.
curl -X POST https://api.magpipe.ai/functions/v1/list-knowledge-sources \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'
const response = await fetch(
'https://api.magpipe.ai/functions/v1/list-knowledge-sources',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({}),
}
);
const { sources, total } = await response.json();
console.log(`You have ${total} knowledge sources`);
import requests
response = requests.post(
'https://api.magpipe.ai/functions/v1/list-knowledge-sources',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={}
)
data = response.json()
print(f"You have {data['total']} knowledge sources")
{
"sources": [
{
"id": "f7a8b9c0-d1e2-3f4a-5b6c-789012def345",
"url": "https://example.com/help/faq",
"title": "Frequently Asked Questions",
"sync_status": "completed",
"chunk_count": 24,
"last_synced_at": "2024-01-15T10:35:00Z",
"next_sync_at": "2024-01-22T10:35:00Z",
"created_at": "2024-01-15T10:30:00Z"
},
{
"id": "a8b9c0d1-e2f3-4a5b-6c7d-890123ef4567",
"url": "https://example.com/products",
"title": "Our Products",
"sync_status": "completed",
"chunk_count": 18,
"last_synced_at": "2024-01-14T08:00:00Z",
"next_sync_at": "2024-02-14T08:00:00Z",
"created_at": "2024-01-14T08:00:00Z"
}
],
"total": 2
}
⌘I