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
| Scope | Purpose |
|---|---|
knowledge_base:read | Search and list documents |
knowledge_base:create | Create documents, folders, and start crawls |
knowledge_base:delete | Delete documents |
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:
| Plan | Base fee | Included pool / month | Per KB query beyond the pool |
|---|---|---|---|
| Professional | EUR 79 | 2,500 | EUR 0.020 |
| Scale | EUR 199 | 10,000 | EUR 0.015 |
| Enterprise | EUR 499 | 40,000 | EUR 0.010 |
| API Only | EUR 9 per connected channel | 1,000 per connected channel | EUR 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
| Field | Type | Required | Description |
|---|---|---|---|
query | string | Yes | The question or search query |
limit | integer | No | Max source documents to consider (default: 5, max: 20) |
folder_id | string | No | Restrict 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
| Range | Meaning | Recommended Action |
|---|---|---|
| 0.70 -- 1.00 | High confidence | Safe to present directly to customers |
| 0.40 -- 0.69 | Medium confidence | Review before presenting, may need clarification |
| 0.00 -- 0.39 | Low confidence | Answer may be incomplete or speculative |
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
| Parameter | Type | Default | Description |
|---|---|---|---|
folder_id | string | Filter by folder | |
type | string | Filter: faq, document, crawled | |
search | string | Search by title | |
page | integer | 1 | Page number |
page_size | integer | 20 | Items 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
| Field | Type | Required | Description |
|---|---|---|---|
title | string | Yes | Document title |
type | string | Yes | faq or document |
content | string | Yes | Document content (plain text or HTML) |
folder_id | string | No | Target 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. The crawler follows links within the same domain and indexes page content.
POST /api/v1/knowledge-base/crawl
| Field | Type | Required | Description |
|---|---|---|---|
url | string | Yes | Starting URL to crawl |
max_pages | integer | No | Maximum pages to crawl (default: 50, range: 50-500) |
folder_id | string | No | Target folder for crawled pages |
curl -X POST "https://api.sendseven.com/api/v1/knowledge-base/crawl" \
-H "Authorization: Bearer s7_api_a1b2c3d4e5f6789012345678abcdef00" \
-H "Content-Type: application/json" \
-d '{
"url": "https://docs.acme.com",
"max_pages": 100,
"folder_id": "folder_product_docs"
}'
{
"crawl_job_id": "crawl_abc123",
"url": "https://docs.acme.com",
"status": "started",
"max_pages": 100,
"folder_id": "folder_product_docs",
"started_at": "2026-02-10T17:50:00Z"
}
Crawls run asynchronously. Pages are indexed as they are discovered. You can check crawl progress in the SendSeven dashboard under Knowledge Base > Website Crawls.
Error Responses
| Status | Error Code | Description |
|---|---|---|
| 401 | INVALID_TOKEN | Token is invalid or expired |
| 403 | INSUFFICIENT_SCOPE | Token lacks knowledge_base:read or knowledge_base:create |
| 404 | RESOURCE_NOT_FOUND | Document or folder not found |
| 422 | VALIDATION_ERROR | Invalid request (e.g., URL not valid, content too large) |
Next Steps
- Send Text Messages -- send answers to customers
- Webhook Events -- receive events when knowledge base is queried
- Quick Reference -- more code examples