Skip to main content

Knowledge Base

The SendSeven Knowledge Base is an AI-powered system that stores your organization's documents, FAQs, and website content. When queried, it uses retrieval-augmented generation (RAG) to find relevant information and generate accurate answers with source citations.

Required Scopes

ScopePurpose
knowledge_base:readSearch and list documents and FAQ entries
knowledge_base:createCreate documents and folders
knowledge_base:updateEdit entries and resolve flags on FAQ entries
knowledge_base:deleteDelete documents; merge FAQ entries
knowledge_base:adminStart and manage website crawls

Key Capabilities

  • AI-powered search -- ask natural language questions and receive synthesized answers
  • Document management -- upload text documents, FAQs, and files
  • Website crawling -- automatically import content from your website
  • Folder organization -- organize documents into folders (each folder becomes a separate search corpus)
  • Confidence scoring -- every answer includes a confidence score indicating reliability

Pricing

Knowledge base queries draw from the same monthly included pool as messages and campaign messages, and any overage is billed at the same per-unit rate:

PlanBase feeIncluded pool / monthPer KB query beyond the pool
ProfessionalEUR 792,500EUR 0.020
ScaleEUR 19910,000EUR 0.015
EnterpriseEUR 49940,000EUR 0.010
API OnlyEUR 9 per connected channel1,000 per connected channelEUR 0.005

There is no separate KB allowance — a message, a campaign send, and a KB query all draw down the same pool.

Knowledge Base is not included on Basic. On API Only the Knowledge Base UI is disabled, but the API documented below is fully usable and billed exactly as shown above.


Search the Knowledge Base

Ask a natural language question and receive an AI-generated answer with source references.

POST /api/v1/knowledge-base/search

Request Body

FieldTypeRequiredDescription
querystringYesThe question or search query
limitintegerNoMax source documents to consider (default: 5, max: 20)
folder_idstringNoRestrict search to a specific folder

curl

curl -X POST "https://api.sendseven.com/api/v1/knowledge-base/search" \
-H "Authorization: Bearer s7_api_a1b2c3d4e5f6789012345678abcdef00" \
-H "Content-Type: application/json" \
-d '{
"query": "What is your return policy for electronics?",
"limit": 5
}'

Response

{
"answer": "Our return policy for electronics allows returns within 30 days of purchase. Items must be in original packaging with all accessories included. Refunds are processed within 5-7 business days after we receive the returned item. For defective products, we offer free return shipping. For non-defective returns, a flat EUR 5 return shipping fee applies.",
"confidence": 0.92,
"sources": [
{
"id": "doc_return_policy",
"title": "Return Policy - Electronics",
"relevance": 0.95,
"snippet": "Electronics may be returned within 30 days of purchase in original packaging..."
},
{
"id": "doc_shipping_faq",
"title": "Shipping & Returns FAQ",
"relevance": 0.78,
"snippet": "For defective products, we offer free return shipping..."
}
],
"tokens": {
"input": 1250,
"output": 180
}
}

Confidence Scores

RangeMeaningRecommended Action
0.70 -- 1.00High confidenceSafe to present directly to customers
0.40 -- 0.69Medium confidenceReview before presenting, may need clarification
0.00 -- 0.39Low confidenceAnswer may be incomplete or speculative
tip

Use the confidence score to decide how to present the answer. High-confidence answers can be sent directly to customers via your bot. Medium and low confidence answers should be routed to a human agent.

Python

import requests

BASE_URL = "https://api.sendseven.com/api/v1"
HEADERS = {
"Authorization": "Bearer s7_api_a1b2c3d4e5f6789012345678abcdef00",
"Content-Type": "application/json",
}

result = requests.post(
f"{BASE_URL}/knowledge-base/search",
headers=HEADERS,
json={"query": "How do I cancel my subscription?", "limit": 5},
).json()

print(f"Answer: {result['answer']}")
print(f"Confidence: {result['confidence']}")
for source in result["sources"]:
print(f" Source: {source['title']} (relevance: {source['relevance']})")

JavaScript

const BASE_URL = "https://api.sendseven.com/api/v1";
const HEADERS = {
"Authorization": "Bearer s7_api_a1b2c3d4e5f6789012345678abcdef00",
"Content-Type": "application/json",
};

const response = await fetch(`${BASE_URL}/knowledge-base/search`, {
method: "POST",
headers: HEADERS,
body: JSON.stringify({
query: "What payment methods do you accept?",
limit: 3,
}),
});
const result = await response.json();
console.log(`Answer (${Math.round(result.confidence * 100)}% confident):`);
console.log(result.answer);

Manage Documents

List Documents

GET /api/v1/knowledge-base/documents
ParameterTypeDefaultDescription
folder_idstringFilter by folder
document_typestringFilter by document type (e.g. faq, document, crawled)
searchstringSearch by title or source URL
pageinteger1Page number
page_sizeinteger20Items per page (max 100)
curl -X GET "https://api.sendseven.com/api/v1/knowledge-base/documents?page=1&page_size=20" \
-H "Authorization: Bearer s7_api_a1b2c3d4e5f6789012345678abcdef00" \
-H "Content-Type: application/json"

Create a Document

POST /api/v1/knowledge-base/documents
FieldTypeRequiredDescription
titlestringYesDocument title
typestringYesfaq or document
contentstringYesDocument content (plain text or HTML)
folder_idstringNoTarget folder ID
curl -X POST "https://api.sendseven.com/api/v1/knowledge-base/documents" \
-H "Authorization: Bearer s7_api_a1b2c3d4e5f6789012345678abcdef00" \
-H "Content-Type: application/json" \
-d '{
"title": "Product Warranty Information",
"type": "document",
"content": "All products sold by Acme Store come with a standard 12-month warranty. This warranty covers manufacturing defects and hardware failures under normal use.",
"folder_id": "folder_policies"
}'

Delete a Document

DELETE /api/v1/knowledge-base/documents/{document_id}
curl -X DELETE "https://api.sendseven.com/api/v1/knowledge-base/documents/doc_warranty_info" \
-H "Authorization: Bearer s7_api_a1b2c3d4e5f6789012345678abcdef00"

Folders

Folders organize documents. Each folder acts as a separate search corpus, allowing targeted search with the folder_id parameter.

Create a Folder

POST /api/v1/knowledge-base/folders
curl -X POST "https://api.sendseven.com/api/v1/knowledge-base/folders" \
-H "Authorization: Bearer s7_api_a1b2c3d4e5f6789012345678abcdef00" \
-H "Content-Type: application/json" \
-d '{
"name": "Product Documentation",
"description": "Technical documentation and user guides for all products"
}'

Website Crawl

Trigger a website crawl to automatically import content from a URL. Crawled pages land in the Websites system folder. Requires the knowledge_base:admin scope.

POST /api/v1/knowledge-base/documents/crawl
FieldTypeRequiredDescription
urlstringYesStarting URL to crawl
follow_linksbooleanNoFollow links and crawl multiple pages (default true). Set false to index only the single URL.
page_limitintegerNoMaximum pages when follow_links is true (1–2000, default 200)
max_depthintegerNoMaximum crawl depth when follow_links is true (1–10)
title_prefixstringNoPrefix added to imported document titles (max 100 chars)
rate_limitnumberNoSeconds between requests (0.1–10.0)
refreshbooleanNoDelete existing documents from this domain before crawling (default false)
curl -X POST "https://api.sendseven.com/api/v1/knowledge-base/documents/crawl" \
-H "Authorization: Bearer s7_api_a1b2c3d4e5f6789012345678abcdef00" \
-H "Content-Type: application/json" \
-d '{
"url": "https://docs.acme.com",
"follow_links": true,
"page_limit": 100,
"max_depth": 3
}'
{
"job_id": "b3f1c2d4-5678-90ab-cdef-1234567890ab",
"status": "queued",
"message": "Website crawl job started. Use the poll_url to check progress.",
"poll_url": "/api/v1/knowledge-base/documents/crawl/{job_id}/status"
}
info

Crawls run asynchronously. Poll GET /api/v1/knowledge-base/documents/crawl/{job_id}/status for progress, or watch it in the SendSeven dashboard under Knowledge Base.

FAQ Entries

FAQ entries are the curated question-and-answer pairs in the Managed FAQ folder — the answers an Assistant works from most directly. Unlike uploaded documents they follow a review lifecycle (draftpublishedneeds_reviewarchived), and only published entries are retrievable. For the concepts behind this, see the Knowledge Base for Bots guide.

List FAQ entries

GET /api/v1/knowledge-base/faq-entries
ParameterTypeDescription
statusstringdraft, published, needs_review, or archived. Accepts a comma-separated list (e.g. draft,needs_review) for a union.
originstringmanual, auto_conversation, migrated, or correction.
folder_idstringRestrict to one KB folder.
flagged_onlybooleanOnly entries with flagged_count > 0.
review_onlybooleanThe review queue: entries needing attention (draft/needs_review, or flagged). Overrides status/flagged_only.
searchstringSubstring match on question/answer.
sort_bystringuses, quality, flags, retrieved, created_at, updated_at, or sort_order.
page / page_sizeintegerPagination (page_size max 200).

Each entry includes its status, origin, question, answer, and the usage counters times_in_sent_reply (Sent), times_retrieved (Retrieved), duplicate_count (Sources — a provenance count, not a duplicate warning), and flagged_count. rag_file_name is null when the entry is not indexed for retrieval.

{
"items": [
{
"id": "faq_a1b2c3",
"status": "published",
"origin": "auto_conversation",
"question": "What is your return policy?",
"answer": "You can return any unused item within 30 days...",
"times_in_sent_reply": 12,
"times_retrieved": 47,
"duplicate_count": 3,
"flagged_count": 0,
"rag_file_name": "faq_a1b2c3.md"
}
],
"pagination": { "page": 1, "page_size": 50, "total": 1 }
}

Review-queue count

Powers the review-queue badge. count is the number of distinct entries in the queue (the same set as ?review_only=true). The breakdown is not a partition — a flagged draft is counted under both draft and flagged, so the parts can sum to more than count.

GET /api/v1/knowledge-base/faq-entries/review-count
{
"count": 42,
"breakdown": { "draft": 40, "needs_review": 1, "flagged": 3 }
}

Resolve flags

Clears an entry's flags after a reviewer has looked at it: sets flagged_count to 0 and writes an audit revision, without touching the content, status, or the corpus. Requires knowledge_base:update.

POST /api/v1/knowledge-base/faq-entries/{entry_id}/resolve-flags

Editing or re-publishing an entry clears its flags automatically, so this endpoint is only needed when you want to keep an entry as-is and just dismiss its flags.

Find and merge duplicate entries

Duplicate clusters (live entries whose normalised question matches) are candidates for merging into one:

GET /api/v1/knowledge-base/faq-entries/duplicate-clusters
POST /api/v1/knowledge-base/faq-entries/merge
FieldTypeDefaultDescription
winner_idstringThe entry that survives the merge.
loser_idsstring[]Entries folded into the winner, then archived.
dry_runbooleantruePreview only. Set false to execute the destructive merge.
keep_loser_questions_as_variantsbooleantrueKeep loser phrasings as retrievable alternate questions on the winner.

dry_run: true (the default) previews the merge — the combined stats, the question variants that would be kept, and the RAG files that would be removed — and changes nothing.

warning

Merge execution (dry_run: false) is gated off in production. While the server-side flag is disabled, an execute request returns 403 before anything is deleted — this is intentional, not a transient error. Until execution is enabled, use dry_run: true to preview, then consolidate by hand. Requires knowledge_base:delete.

Error Responses

StatusError CodeDescription
401INVALID_TOKENToken is invalid or expired
403INSUFFICIENT_SCOPEToken lacks the required knowledge_base:* scope for this operation (see the scope table above). Also returned when merge execution is attempted while it is gated off.
404RESOURCE_NOT_FOUNDDocument or folder not found
422VALIDATION_ERRORInvalid request (e.g., URL not valid, content too large)

Next Steps