All docs

GTM Knowledge Base

Search and list org-scoped knowledge base documents used by GTM campaigns and AI agents

The GTM Knowledge Base stores structured documents that power your campaigns and AI agents. These endpoints let you search across KB content and list all available documents in your org’s knowledge base.


Search Knowledge Base

POST /kb/search

Performs a semantic search over your org’s knowledge base and returns the most relevant document chunks ranked by score.

Request Body

FieldTypeRequiredDescription
querystringYesThe search query string
limitintegerNoMaximum number of results to return. Range: 1–50. Default: 10

Example

cURL

curl -X POST "https://be.graph8.com/api/v1/kb/search" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "pricing",
    "limit": 10
  }'

Response

{
  "data": [
    {
      "doc_path": "...",
      "section": "...",
      "title": "...",
      "content": "<500 chars>",
      "score": 0.87
    }
  ]
}
FieldTypeDescription
doc_pathstringPath identifier of the source document
sectionstringSection within the document where the chunk was found
titlestringTitle of the document or section
contentstringMatched content excerpt, up to 500 characters
scorefloatRelevance score for this result

List Knowledge Base Documents

GET /kb

Returns all documents in your org’s knowledge base, including metadata about each document’s structure and freshness.

Example

cURL

curl "https://be.graph8.com/api/v1/kb" \
  -H "Authorization: Bearer $API_KEY"

Response

{
  "data": [
    {
      "doc_path": "...",
      "section": "...",
      "title": "...",
      "chunks": 3,
      "last_updated": "..."
    }
  ]
}
FieldTypeDescription
doc_pathstringPath identifier of the document
sectionstringSection label within the document
titlestringHuman-readable document title
chunksintegerNumber of indexed chunks in this document
last_updatedstringISO 8601 timestamp of the most recent update
Build with graph8