Skip to main content
POST
/
v1
/
boards
/
{boardId}
/
documents
/
search
curl -X POST "https://api.chatgrid.ai/v1/boards/a1b2c3d4-e5f6-7890-abcd-ef1234567890/documents/search" \
  -H "Authorization: Bearer cgk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "What were the Q1 revenue numbers?",
    "limit": 5,
    "threshold": 0.6,
    "node_ids": ["e5f6a7b8-c9d0-1234-efab-345678901234"]
  }'
{
  "object": "list",
  "data": [
    {
      "id": "dd112233-4455-6677-8899-aabbccddeeff",
      "content": "The quarterly revenue report shows a 15% increase in SaaS subscriptions.",
      "node_id": "e5f6a7b8-c9d0-1234-efab-345678901234",
      "metadata": {
        "source": "annual-report-2026.pdf",
        "page": 3,
        "chunkIndex": 0,
        "totalChunks": 3,
        "sourceType": "api_vectorize"
      },
      "score": 0.87
    },
    {
      "id": "ee223344-5566-7788-99aa-bbccddeeff11",
      "content": "New enterprise deals accounted for $2.3M in recurring revenue.",
      "node_id": "e5f6a7b8-c9d0-1234-efab-345678901234",
      "metadata": {
        "source": "annual-report-2026.pdf",
        "page": 3,
        "chunkIndex": 2,
        "totalChunks": 3,
        "sourceType": "api_vectorize"
      },
      "score": 0.79
    }
  ],
  "has_more": false,
  "cursor": null
}
boardId
string
required
Board UUID.
query
string
required
Natural language search query. 1-2,000 characters.
limit
integer
default:10
Maximum results to return (1-50).
threshold
number
Minimum similarity score (0-1). Results below this threshold are excluded.
node_ids
string[]
Restrict search to chunks associated with specific nodes. When omitted, all chunks on the board are searched.
Results are ranked by cosine similarity score. When node_ids is provided, the search uses an optimized database function for better performance.
curl -X POST "https://api.chatgrid.ai/v1/boards/a1b2c3d4-e5f6-7890-abcd-ef1234567890/documents/search" \
  -H "Authorization: Bearer cgk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "What were the Q1 revenue numbers?",
    "limit": 5,
    "threshold": 0.6,
    "node_ids": ["e5f6a7b8-c9d0-1234-efab-345678901234"]
  }'
{
  "object": "list",
  "data": [
    {
      "id": "dd112233-4455-6677-8899-aabbccddeeff",
      "content": "The quarterly revenue report shows a 15% increase in SaaS subscriptions.",
      "node_id": "e5f6a7b8-c9d0-1234-efab-345678901234",
      "metadata": {
        "source": "annual-report-2026.pdf",
        "page": 3,
        "chunkIndex": 0,
        "totalChunks": 3,
        "sourceType": "api_vectorize"
      },
      "score": 0.87
    },
    {
      "id": "ee223344-5566-7788-99aa-bbccddeeff11",
      "content": "New enterprise deals accounted for $2.3M in recurring revenue.",
      "node_id": "e5f6a7b8-c9d0-1234-efab-345678901234",
      "metadata": {
        "source": "annual-report-2026.pdf",
        "page": 3,
        "chunkIndex": 2,
        "totalChunks": 3,
        "sourceType": "api_vectorize"
      },
      "score": 0.79
    }
  ],
  "has_more": false,
  "cursor": null
}