Search indexed knowledge
POST /v1/knowledge/search takes query (1–1,000 nonblank characters) and optional max_results (1–8, default 4). Select the team with Totem-Team when your key can access several teams. This is a read: it has no idempotency key and creates no durable operation.
The integration needs knowledge:read and a separate, current knowledge-content acknowledgement when its key is created. Ordinary read access, CRM writes and old keys do not grant knowledge content. Adding another team to a organization integration requires that acknowledgement again. Totem-hosted assistant processing uses its current execution and team processing delegation, independently of a third-party recipient's content grant.
The team must have its knowledge base enabled. The response contains object: "knowledge_search", status and passages. Each passage has text, stored title, optional section and page (both nullable), and a similarity score from 0 to 1. Query text, private lead files, raw source/file identifiers and provider URLs are excluded.
An empty passages array is a successful search. status: "indexing" with no passages means the knowledge index is still being prepared; ready with no passages means no current retained result matched. An unavailable provider or vector index returns an error rather than an invented no-hit.
Only a completed, current indexed source generation is served. Revoking the grant, disabling the knowledge base, deleting indexed content or disconnecting its account withdraws access when observed locally. Provider-side deletion or moves are discovered by sync/reconciliation and are eventual; this endpoint does not promise instant source-provider withdrawal.
POST /
Retrieves bounded passages from the team’s enabled, retained indexed knowledge with a separate knowledge-content opt-in; existing keys gain no access. Provider deletion discovery is eventual. Private lead files, raw file identifiers and source URLs are excluded.
Headers
Totem-Teamstring Conditional ID prefixteam_…The team to read, as a
team_…id. Omit it when the key reads one team; it is required when the key reads several (400 team_required). When you send it, it must name a team the key reads: a malformed id gets400 invalid_request, and a team outside the key gets404 team_not_accessible, as does a request without it once the key reads no team at all.
Request body
A bounded team knowledge search; private lead files and provider filters are unavailable.
querystring Required 1–1000 charsQuestion to retrieve from the selected team’s indexed knowledge.
max_resultsinteger Range 1–8 Default4Maximum passages, from 1 to 8; defaults to 4.
Returns
Returns a KnowledgeSearch object.
objectstringAlways knowledge_search.
statusstringIndexing with no retained match means the index is still being prepared.
Possible valuesreadyindexing
passagesArray<object> ≤ 8 itemsMatching passages only; an empty array is a successful search.
textstring 1–1200 charsRetained matching passage.
titlestring ≤ 512 charsStored document title.
sectionstring Nullable ≤ 512 charsStored section, if available.
pageinteger NullableStored page number, if available.
scorenumber Range 0–1Similarity score from 0 to 1.
Errors
- 400
team_requiredTeam required - 403
team_state_restrictedTeam restricted - 403
sector_restrictedSector restricted - 404
team_not_accessibleTeam not accessible - 409
capture_not_readyTeam data is still being prepared
# Fictional fixtures: replace references and dates with current API values.
# Send consent or confirmation attestations only after the person confirms.
curl -X POST 'https://api.totemstudio.ai/v1/knowledge/search' \
-H "Authorization: Bearer $TOTEM_API_KEY" \
-H "Totem-Team: $TOTEM_TEAM_ID" \
-H "Content-Type: application/json" \
--data '{"query": "What does the first visit include?", "max_results": 4}'{
"object": "knowledge_search",
"status": "ready",
"passages": [
{
"text": "The first visit includes an initial assessment and a written estimate.",
"title": "Service guide",
"section": "First visit",
"page": 2,
"score": 0.85
}
]
}Current retained knowledge passages without query echo, provider ids or source URLs.
Attributes
objectstringAlways knowledge_search.
statusstringIndexing with no retained match means the index is still being prepared.
Possible valuesreadyindexing
passagesArray<object> ≤ 8 itemsMatching passages only; an empty array is a successful search.
textstring 1–1200 charsRetained matching passage.
titlestring ≤ 512 charsStored document title.
sectionstring Nullable ≤ 512 charsStored section, if available.
pageinteger NullableStored page number, if available.
scorenumber Range 0–1Similarity score from 0 to 1.
{
"object": "knowledge_search",
"status": "ready",
"passages": [
{
"text": "The first visit includes an initial assessment and a written estimate.",
"title": "Service guide",
"section": "First visit",
"page": 2,
"score": 0.85
}
]
}