Node.js
import { PeriskopeApi } from '@periskope/periskope-client';
const client = new PeriskopeApi({
authToken: 'YOUR_API_KEY',
phone: 'YOUR_PHONE_NUMBER', // e.g., '919876543210'
});
async function deleteDocument() {
const response = await client.knowledgeBase.deleteDocument({
document_id: 'doc_xyz789'
});
console.log(response);
}
deleteDocument();curl -X DELETE \
https://api.periskope.app/v1/knowledge-base/document/doc_xyz789 \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-H 'x-phone: YOUR_PHONE_NUMBER'{
"document_id": "88a010a1-c6ac-4f8f-be15-850bee5372b7"
}Knowledge Base APIs
Delete Document
Delete all entries and storage files for a document by document_id
Node.js
import { PeriskopeApi } from '@periskope/periskope-client';
const client = new PeriskopeApi({
authToken: 'YOUR_API_KEY',
phone: 'YOUR_PHONE_NUMBER', // e.g., '919876543210'
});
async function deleteDocument() {
const response = await client.knowledgeBase.deleteDocument({
document_id: 'doc_xyz789'
});
console.log(response);
}
deleteDocument();curl -X DELETE \
https://api.periskope.app/v1/knowledge-base/document/doc_xyz789 \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-H 'x-phone: YOUR_PHONE_NUMBER'{
"document_id": "88a010a1-c6ac-4f8f-be15-850bee5372b7"
}Was this page helpful?