Knowledge
Knowledge packs and their documents.
/v1/knowledge/basesList knowledge packs
Newest first, with how many documents each holds.
Query parameters
limitintegerPage size, 1-200 (default 50).
cursorstringThe
nextCursorof the previous page.
Returns
200 A page of knowledge packs. A page: data is a list of KnowledgeBase, and nextCursor fetches the next page.
Fields of data
idstringrequiredKnowledge base id (
kb_…).pattern `^kb_.*`
namestringrequireddocumentCountintegerrequiredIts documents (not deleted ones).
readyCountintegerrequiredIts documents that have been read: the ones the avatar answers from.
createdAtstring (date-time)requiredISO 8601 UTC timestamp.
updatedAtstring (date-time)requiredISO 8601 UTC timestamp.
Errors
invalid_requestunauthorizedforbiddenupgrade_requiredrate_limitedserver_error
Request
curl "https://app.zentiqai.com/v1/knowledge/bases?limit=20" \
-H "Authorization: Bearer $ZENTIQ_API_KEY"import { Zentiq } from "@zentiq/node";
const zentiq = new Zentiq({ apiKey: process.env.ZENTIQ_API_KEY });
const page = await zentiq.listKnowledgeBases({
limit: 20,
});import os
from zentiq import Zentiq
zentiq = Zentiq(api_key=os.environ["ZENTIQ_API_KEY"])
page = zentiq.list_knowledge_bases(limit=20)Example answer
{
"data": [
{
"id": "kb_cmfq2b7x10000abcd1234",
"name": "Zoe",
"documentCount": 1,
"readyCount": 1,
"createdAt": "2026-09-25T12:00:00.000Z",
"updatedAt": "2026-09-25T12:00:00.000Z"
}
],
"error": null,
"requestId": "req_4f1c2e9a7b3d5e6f7a8b9c0d",
"nextCursor": null
}/v1/knowledge/basesCreate a knowledge pack
Body
namestringrequiredat most 200 characters
Returns
201 The new knowledge pack. data is KnowledgeBase.
Fields of data
idstringrequiredKnowledge base id (
kb_…).pattern `^kb_.*`
namestringrequireddocumentCountintegerrequiredIts documents (not deleted ones).
readyCountintegerrequiredIts documents that have been read: the ones the avatar answers from.
createdAtstring (date-time)requiredISO 8601 UTC timestamp.
updatedAtstring (date-time)requiredISO 8601 UTC timestamp.
Errors
invalid_requestunauthorizedforbiddenupgrade_requiredidempotency_conflictidempotency_in_progresstoo_largerate_limitedserver_error
Request
curl -X POST "https://app.zentiqai.com/v1/knowledge/bases" \
-H "Authorization: Bearer $ZENTIQ_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"name": "Zoe"
}'import { Zentiq } from "@zentiq/node";
const zentiq = new Zentiq({ apiKey: process.env.ZENTIQ_API_KEY });
const result = await zentiq.createKnowledgeBase({
name: "Zoe",
});import os
from zentiq import Zentiq
zentiq = Zentiq(api_key=os.environ["ZENTIQ_API_KEY"])
result = zentiq.create_knowledge_base({
"name": "Zoe",
})Example answer
{
"data": {
"id": "kb_cmfq2b7x10000abcd1234",
"name": "Zoe",
"documentCount": 1,
"readyCount": 1,
"createdAt": "2026-09-25T12:00:00.000Z",
"updatedAt": "2026-09-25T12:00:00.000Z"
},
"error": null,
"requestId": "req_4f1c2e9a7b3d5e6f7a8b9c0d"
}/v1/knowledge/bases/{id}Get a knowledge pack
Path parameters
idstringrequiredKnowledge base id (
kb_…); the id without its prefix is accepted too.
Returns
200 The knowledge pack. data is KnowledgeBase.
Fields of data
idstringrequiredKnowledge base id (
kb_…).pattern `^kb_.*`
namestringrequireddocumentCountintegerrequiredIts documents (not deleted ones).
readyCountintegerrequiredIts documents that have been read: the ones the avatar answers from.
createdAtstring (date-time)requiredISO 8601 UTC timestamp.
updatedAtstring (date-time)requiredISO 8601 UTC timestamp.
Errors
invalid_requestunauthorizedforbiddenupgrade_requirednot_foundgonerate_limitedserver_error
Request
curl "https://app.zentiqai.com/v1/knowledge/bases/kb_123" \
-H "Authorization: Bearer $ZENTIQ_API_KEY"import { Zentiq } from "@zentiq/node";
const zentiq = new Zentiq({ apiKey: process.env.ZENTIQ_API_KEY });
const result = await zentiq.getKnowledgeBase("kb_123");import os
from zentiq import Zentiq
zentiq = Zentiq(api_key=os.environ["ZENTIQ_API_KEY"])
result = zentiq.get_knowledge_base("kb_123")Example answer
{
"data": {
"id": "kb_cmfq2b7x10000abcd1234",
"name": "Zoe",
"documentCount": 1,
"readyCount": 1,
"createdAt": "2026-09-25T12:00:00.000Z",
"updatedAt": "2026-09-25T12:00:00.000Z"
},
"error": null,
"requestId": "req_4f1c2e9a7b3d5e6f7a8b9c0d"
}/v1/knowledge/bases/{id}Rename a knowledge pack
Path parameters
idstringrequiredKnowledge base id (
kb_…); the id without its prefix is accepted too.
Body
namestringrequiredat most 200 characters
Returns
200 The knowledge pack. data is KnowledgeBase.
Fields of data
idstringrequiredKnowledge base id (
kb_…).pattern `^kb_.*`
namestringrequireddocumentCountintegerrequiredIts documents (not deleted ones).
readyCountintegerrequiredIts documents that have been read: the ones the avatar answers from.
createdAtstring (date-time)requiredISO 8601 UTC timestamp.
updatedAtstring (date-time)requiredISO 8601 UTC timestamp.
Errors
invalid_requestunauthorizedforbiddenupgrade_requirednot_foundgonetoo_largerate_limitedserver_error
Request
curl -X PATCH "https://app.zentiqai.com/v1/knowledge/bases/kb_123" \
-H "Authorization: Bearer $ZENTIQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Zoe"
}'import { Zentiq } from "@zentiq/node";
const zentiq = new Zentiq({ apiKey: process.env.ZENTIQ_API_KEY });
const result = await zentiq.updateKnowledgeBase("kb_123", {
name: "Zoe",
});import os
from zentiq import Zentiq
zentiq = Zentiq(api_key=os.environ["ZENTIQ_API_KEY"])
result = zentiq.update_knowledge_base("kb_123", {
"name": "Zoe",
})Example answer
{
"data": {
"id": "kb_cmfq2b7x10000abcd1234",
"name": "Zoe",
"documentCount": 1,
"readyCount": 1,
"createdAt": "2026-09-25T12:00:00.000Z",
"updatedAt": "2026-09-25T12:00:00.000Z"
},
"error": null,
"requestId": "req_4f1c2e9a7b3d5e6f7a8b9c0d"
}/v1/knowledge/bases/{id}Delete a knowledge pack
Its documents go with it and are no longer answered from.
Path parameters
idstringrequiredKnowledge base id (
kb_…); the id without its prefix is accepted too.
Returns
200 Deleted. data is object.
Fields of data
deletedtruerequiredidstringrequiredKnowledge base id (
kb_…).pattern `^kb_.*`
detachedFromintegerrequiredHow many personas had it attached (it is detached from them).
Errors
invalid_requestunauthorizedforbiddenupgrade_requirednot_foundrate_limitedserver_error
Request
curl -X DELETE "https://app.zentiqai.com/v1/knowledge/bases/kb_123" \
-H "Authorization: Bearer $ZENTIQ_API_KEY"import { Zentiq } from "@zentiq/node";
const zentiq = new Zentiq({ apiKey: process.env.ZENTIQ_API_KEY });
const result = await zentiq.deleteKnowledgeBase("kb_123");import os
from zentiq import Zentiq
zentiq = Zentiq(api_key=os.environ["ZENTIQ_API_KEY"])
result = zentiq.delete_knowledge_base("kb_123")Example answer
{
"data": {
"deleted": true,
"id": "kb_cmfq2b7x10000abcd1234",
"detachedFrom": 1
},
"error": null,
"requestId": "req_4f1c2e9a7b3d5e6f7a8b9c0d"
}/v1/knowledge/bases/{id}/documentsList a knowledge pack's documents
Newest first.
Path parameters
idstringrequiredKnowledge base id (
kb_…); the id without its prefix is accepted too.
Query parameters
limitintegerPage size, 1-200 (default 50).
cursorstringThe
nextCursorof the previous page.
Returns
200 A page of documents. A page: data is a list of Document, and nextCursor fetches the next page.
Fields of data
idstringrequiredDocument id (
doc_…).pattern `^doc_.*`
knowledgeBaseIdstringrequiredKnowledge base id (
kb_…).pattern `^kb_.*`
namestringrequiredtypestring | nullrequiredpdf, txt, md, docx, csv, url or text.
bytesinteger | nullrequiredstatus"processing" | "ready" | "failed"requiredprocessing until it has been read; then ready, or failed.
chunkCountinteger | nullrequiredHow many passages were read from it, once ready.
errorstring | nullrequiredWhen failed: one plain sentence (the file couldn't be read, took too long, reading is unavailable, or it couldn't be processed).
createdAtstring (date-time)requiredISO 8601 UTC timestamp.
updatedAtstring (date-time)requiredISO 8601 UTC timestamp.
Errors
invalid_requestunauthorizedforbiddenupgrade_requirednot_foundgonerate_limitedserver_error
Request
curl "https://app.zentiqai.com/v1/knowledge/bases/kb_123/documents?limit=20" \
-H "Authorization: Bearer $ZENTIQ_API_KEY"import { Zentiq } from "@zentiq/node";
const zentiq = new Zentiq({ apiKey: process.env.ZENTIQ_API_KEY });
const page = await zentiq.listDocuments("kb_123", {
limit: 20,
});import os
from zentiq import Zentiq
zentiq = Zentiq(api_key=os.environ["ZENTIQ_API_KEY"])
page = zentiq.list_documents("kb_123", limit=20)Example answer
{
"data": [
{
"id": "doc_cmfq2b7x10000abcd1234",
"knowledgeBaseId": "kb_cmfq2b7x10000abcd1234",
"name": "Zoe",
"type": "…",
"bytes": 1,
"status": "processing"
}
],
"error": null,
"requestId": "req_4f1c2e9a7b3d5e6f7a8b9c0d",
"nextCursor": null
}/v1/knowledge/bases/{id}/documentsAdd a document (a file, an address or text)
Three ways: a multipart file; or JSON { url }; or JSON { text }. Answers at once with the document processing; poll GET /knowledge/documents/{id}, or subscribe to the knowledge.document.* webhooks. Documents count against the plan (403 upgrade_required).
Path parameters
idstringrequiredKnowledge base id (
kb_…); the id without its prefix is accepted too.
Body
urlstring (uri)A public https address to fetch and read (25 MB at most; every redirect is checked too).
textstringText to read (1 MB at most).
at most 1,048,576 characters
namestringat most 200 characters
Or a multipart/form-data upload:
filestring (binary)requiredpdf, txt, md, docx or csv; 25 MB at most.
namestring
Returns
202 Accepted: the document is being read. data is Document.
Fields of data
idstringrequiredDocument id (
doc_…).pattern `^doc_.*`
knowledgeBaseIdstringrequiredKnowledge base id (
kb_…).pattern `^kb_.*`
namestringrequiredtypestring | nullrequiredpdf, txt, md, docx, csv, url or text.
bytesinteger | nullrequiredstatus"processing" | "ready" | "failed"requiredprocessing until it has been read; then ready, or failed.
chunkCountinteger | nullrequiredHow many passages were read from it, once ready.
errorstring | nullrequiredWhen failed: one plain sentence (the file couldn't be read, took too long, reading is unavailable, or it couldn't be processed).
createdAtstring (date-time)requiredISO 8601 UTC timestamp.
updatedAtstring (date-time)requiredISO 8601 UTC timestamp.
Errors
invalid_requestunauthorizedforbiddenupgrade_requirednot_foundidempotency_conflictidempotency_in_progressgonetoo_largeunsupported_media_typerate_limitedserver_error
Events
knowledge.document.processedknowledge.document.failed
Request
curl -X POST "https://app.zentiqai.com/v1/knowledge/bases/kb_123/documents" \
-H "Authorization: Bearer $ZENTIQ_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{}'import { Zentiq } from "@zentiq/node";
const zentiq = new Zentiq({ apiKey: process.env.ZENTIQ_API_KEY });
const result = await zentiq.createDocument("kb_123", {});import os
from zentiq import Zentiq
zentiq = Zentiq(api_key=os.environ["ZENTIQ_API_KEY"])
result = zentiq.create_document("kb_123", {})Example answer
{
"data": {
"id": "doc_cmfq2b7x10000abcd1234",
"knowledgeBaseId": "kb_cmfq2b7x10000abcd1234",
"name": "Zoe",
"type": "…",
"bytes": 1,
"status": "processing"
},
"error": null,
"requestId": "req_4f1c2e9a7b3d5e6f7a8b9c0d"
}/v1/knowledge/bases/{id}/searchSearch a knowledge pack
The same look-up a live session makes, on its own: the passages closest to query.
Path parameters
idstringrequiredKnowledge base id (
kb_…); the id without its prefix is accepted too.
Body
querystringrequiredat most 4,096 characters
topKintegerHow many passages (default 5).
1-50
minScorenumberLeave out passages below this similarity (0-1, default 0).
0-1
Returns
200 The closest passages. data is SearchResult.
Fields of data
resultsobject[]requireddocumentIdstringrequiredDocument id (
doc_…).pattern `^doc_.*`
textstringrequiredscorenumberrequired0-1 similarity (higher is closer).
metadataobjectrequiredpageinteger | nullrequired
Errors
invalid_requestunauthorizedforbiddenupgrade_requirednot_foundgonetoo_largerate_limitedserver_errorupstream_error
Request
curl -X POST "https://app.zentiqai.com/v1/knowledge/bases/kb_123/search" \
-H "Authorization: Bearer $ZENTIQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "…"
}'import { Zentiq } from "@zentiq/node";
const zentiq = new Zentiq({ apiKey: process.env.ZENTIQ_API_KEY });
const result = await zentiq.searchKnowledge("kb_123", {
query: "…",
});import os
from zentiq import Zentiq
zentiq = Zentiq(api_key=os.environ["ZENTIQ_API_KEY"])
result = zentiq.search_knowledge("kb_123", {
"query": "…",
})Example answer
{
"data": {
"results": [
{
"documentId": "doc_cmfq2b7x10000abcd1234",
"text": "…",
"score": 1,
"metadata": {
"page": 1
}
}
]
},
"error": null,
"requestId": "req_4f1c2e9a7b3d5e6f7a8b9c0d"
}/v1/knowledge/documents/{id}Get a document (poll until it is read)
Path parameters
idstringrequiredDocument id (
doc_…); the id without its prefix is accepted too.
Returns
200 The document. data is Document.
Fields of data
idstringrequiredDocument id (
doc_…).pattern `^doc_.*`
knowledgeBaseIdstringrequiredKnowledge base id (
kb_…).pattern `^kb_.*`
namestringrequiredtypestring | nullrequiredpdf, txt, md, docx, csv, url or text.
bytesinteger | nullrequiredstatus"processing" | "ready" | "failed"requiredprocessing until it has been read; then ready, or failed.
chunkCountinteger | nullrequiredHow many passages were read from it, once ready.
errorstring | nullrequiredWhen failed: one plain sentence (the file couldn't be read, took too long, reading is unavailable, or it couldn't be processed).
createdAtstring (date-time)requiredISO 8601 UTC timestamp.
updatedAtstring (date-time)requiredISO 8601 UTC timestamp.
Errors
invalid_requestunauthorizedforbiddenupgrade_requirednot_foundgonerate_limitedserver_error
Request
curl "https://app.zentiqai.com/v1/knowledge/documents/doc_123" \
-H "Authorization: Bearer $ZENTIQ_API_KEY"import { Zentiq } from "@zentiq/node";
const zentiq = new Zentiq({ apiKey: process.env.ZENTIQ_API_KEY });
const result = await zentiq.getDocument("doc_123");import os
from zentiq import Zentiq
zentiq = Zentiq(api_key=os.environ["ZENTIQ_API_KEY"])
result = zentiq.get_document("doc_123")Example answer
{
"data": {
"id": "doc_cmfq2b7x10000abcd1234",
"knowledgeBaseId": "kb_cmfq2b7x10000abcd1234",
"name": "Zoe",
"type": "…",
"bytes": 1,
"status": "processing"
},
"error": null,
"requestId": "req_4f1c2e9a7b3d5e6f7a8b9c0d"
}/v1/knowledge/documents/{id}Delete a document
Its passages and its original file go with it.
Path parameters
idstringrequiredDocument id (
doc_…); the id without its prefix is accepted too.
Returns
200 Deleted. data is object.
Fields of data
deletedtruerequiredidstringrequiredDocument id (
doc_…).pattern `^doc_.*`
Errors
invalid_requestunauthorizedforbiddenupgrade_requirednot_foundrate_limitedserver_error
Request
curl -X DELETE "https://app.zentiqai.com/v1/knowledge/documents/doc_123" \
-H "Authorization: Bearer $ZENTIQ_API_KEY"import { Zentiq } from "@zentiq/node";
const zentiq = new Zentiq({ apiKey: process.env.ZENTIQ_API_KEY });
const result = await zentiq.deleteDocument("doc_123");import os
from zentiq import Zentiq
zentiq = Zentiq(api_key=os.environ["ZENTIQ_API_KEY"])
result = zentiq.delete_document("doc_123")Example answer
{
"data": {
"deleted": true,
"id": "doc_cmfq2b7x10000abcd1234"
},
"error": null,
"requestId": "req_4f1c2e9a7b3d5e6f7a8b9c0d"
}/v1/knowledge/documents/{id}/downloadDownload a document's original file
A signed address that works for about ten minutes; never a storage path.
Path parameters
idstringrequiredDocument id (
doc_…); the id without its prefix is accepted too.
Returns
200 Where to download it. data is DownloadUrl.
Fields of data
urlstringrequiredA short-lived signed address of the original file.
expiresAtstring (date-time)requiredISO 8601 UTC timestamp.
Errors
invalid_requestunauthorizedforbiddenupgrade_requirednot_foundgonerate_limitedserver_error
Request
curl "https://app.zentiqai.com/v1/knowledge/documents/doc_123/download" \
-H "Authorization: Bearer $ZENTIQ_API_KEY"import { Zentiq } from "@zentiq/node";
const zentiq = new Zentiq({ apiKey: process.env.ZENTIQ_API_KEY });
const result = await zentiq.downloadDocument("doc_123");import os
from zentiq import Zentiq
zentiq = Zentiq(api_key=os.environ["ZENTIQ_API_KEY"])
result = zentiq.download_document("doc_123")Example answer
{
"data": {
"url": "https://www.example.com",
"expiresAt": "2026-09-25T12:00:00.000Z"
},
"error": null,
"requestId": "req_4f1c2e9a7b3d5e6f7a8b9c0d"
}