Skip to content
v1

Reference Knowledge

Knowledge

Retrieve bounded passages from the selected team's indexed knowledge with explicit content access.

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.

Search team knowledge

POST /v1/knowledge/search

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.

Scopes
knowledge:read
Rate limit
Read

Headers

  • Totem-Team string Conditional ID prefix team_…

    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 gets 400 invalid_request, and a team outside the key gets 404 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.

  • query string Required 1–1000 chars

    Question to retrieve from the selected team’s indexed knowledge.

  • max_results integer Range 1–8 Default 4

    Maximum passages, from 1 to 8; defaults to 4.

Returns

Returns a KnowledgeSearch object.

Errors

+ 12 common errors

POST /v1/knowledge/search
# 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}'
Response · 200JSON
{
  "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
    }
  ]
}

The KnowledgeSearch object

Current retained knowledge passages without query echo, provider ids or source URLs.

Attributes

  • object string

    Always knowledge_search.

  • status string

    Indexing with no retained match means the index is still being prepared.

    Possible values
    • ready
    • indexing
  • passages Array<object> ≤ 8 items

    Matching passages only; an empty array is a successful search.

KnowledgeSearch · exampleJSON
{
  "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
    }
  ]
}

API version 1.0.0