import { PeriskopeApi } from '@periskope/periskope-client';
const client = new PeriskopeApi({
authToken: 'YOUR_API_KEY',
});
async function main() {
const response = await client.knowledgeBase.createFaq({
question: 'What is Periskope?',
answer: 'Periskope is a platform to manage WhatsApp at scale.',
});
console.log(response);
}
main();curl -X POST 'https://api.periskope.app/v1/knowledge-base/faq/create' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"question": "What is Periskope?",
"answer": "Periskope is a platform to manage WhatsApp at scale."
}'Create FAQ
Creates an FAQ — a question/answer pair the AI agent learns to answer from. Its embedding is generated automatically. The entry starts inactive unless is_active is sent as true.
import { PeriskopeApi } from '@periskope/periskope-client';
const client = new PeriskopeApi({
authToken: 'YOUR_API_KEY',
});
async function main() {
const response = await client.knowledgeBase.createFaq({
question: 'What is Periskope?',
answer: 'Periskope is a platform to manage WhatsApp at scale.',
});
console.log(response);
}
main();curl -X POST 'https://api.periskope.app/v1/knowledge-base/faq/create' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"question": "What is Periskope?",
"answer": "Periskope is a platform to manage WhatsApp at scale."
}'Authorizations
Body
Response
The created FAQ entry
An entry in the AI knowledge base — the content the AI agent draws on when answering queries. An entry is either an FAQ (a question/answer pair), one chunk of an uploaded PDF document, or a self-learned entry captured automatically from conversations.
Kind of entry: 'faq' for question/answer pairs created via the API or dashboard, 'document' for chunks extracted from uploaded PDF documents, 'self-learned' for entries the AI agent captured automatically from conversations.
faq, document, self-learned "faq"
Attachments stored on the entry — for FAQs created with an attachment, an array of { link: { url, type, name } } objects pointing at the stored file. null or an empty array when the entry has no attachments.
[ { "link": { "url": "org-assets/00000000-0000-0000-0000-000000000000/ai_assets/00000000-0000-0000-0000-000000000000/pricing.pdf", "type": "application/pdf", "name": "pricing.pdf" } } ]
Extra metadata about the entry. For document chunks: fileName, filePath, chunkIndex, tokenCount and the extraction source ('qa' for detected Q&A pairs, 'paragraph' for paragraph blocks, 'text' for sentence windows). null for FAQs.
{ "fileName": "product-faq.pdf", "chunkIndex": 1, "tokenCount": 180, "source": "qa" }
Was this page helpful?