curl -X POST https://api.magpipe.ai/functions/v1/delete-knowledge-source \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"source_id": "f7a8b9c0-d1e2-3f4a-5b6c-789012def345"}'
const response = await fetch(
'https://api.magpipe.ai/functions/v1/delete-knowledge-source',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
source_id: 'f7a8b9c0-d1e2-3f4a-5b6c-789012def345'
}),
}
);
const result = await response.json();
console.log(`Deleted ${result.chunks_deleted} chunks`);
import requests
response = requests.post(
'https://api.magpipe.ai/functions/v1/delete-knowledge-source',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={'source_id': 'f7a8b9c0-d1e2-3f4a-5b6c-789012def345'}
)
result = response.json()
print(f"Deleted {result['chunks_deleted']} chunks")
{
"success": true,
"chunks_deleted": 24
}
{
"error": {
"code": "source_not_found",
"message": "Knowledge source not found"
}
}
Knowledge Base
Delete Knowledge Source
Remove a knowledge source from your account
POST
/
delete-knowledge-source
curl -X POST https://api.magpipe.ai/functions/v1/delete-knowledge-source \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"source_id": "f7a8b9c0-d1e2-3f4a-5b6c-789012def345"}'
const response = await fetch(
'https://api.magpipe.ai/functions/v1/delete-knowledge-source',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
source_id: 'f7a8b9c0-d1e2-3f4a-5b6c-789012def345'
}),
}
);
const result = await response.json();
console.log(`Deleted ${result.chunks_deleted} chunks`);
import requests
response = requests.post(
'https://api.magpipe.ai/functions/v1/delete-knowledge-source',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={'source_id': 'f7a8b9c0-d1e2-3f4a-5b6c-789012def345'}
)
result = response.json()
print(f"Deleted {result['chunks_deleted']} chunks")
{
"success": true,
"chunks_deleted": 24
}
{
"error": {
"code": "source_not_found",
"message": "Knowledge source not found"
}
}
Delete a knowledge source and all its associated embeddings from the vector database.
This action is irreversible. All chunks and embeddings from this source will be permanently deleted.
Request Body
string
required
The unique identifier of the knowledge source to delete.
Response
boolean
Whether the source was deleted successfully.
integer
Number of chunks removed from the vector database.
curl -X POST https://api.magpipe.ai/functions/v1/delete-knowledge-source \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"source_id": "f7a8b9c0-d1e2-3f4a-5b6c-789012def345"}'
const response = await fetch(
'https://api.magpipe.ai/functions/v1/delete-knowledge-source',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
source_id: 'f7a8b9c0-d1e2-3f4a-5b6c-789012def345'
}),
}
);
const result = await response.json();
console.log(`Deleted ${result.chunks_deleted} chunks`);
import requests
response = requests.post(
'https://api.magpipe.ai/functions/v1/delete-knowledge-source',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={'source_id': 'f7a8b9c0-d1e2-3f4a-5b6c-789012def345'}
)
result = response.json()
print(f"Deleted {result['chunks_deleted']} chunks")
{
"success": true,
"chunks_deleted": 24
}
{
"error": {
"code": "source_not_found",
"message": "Knowledge source not found"
}
}
⌘I