Search Knowledge

Search one or more knowledge bases with semantic vector retrieval, optional hybrid full-text retrieval, and structured tag filters. The request body is capped at 2 MiB; a larger body is a 413.

POST/api/v2/knowledge/search
X-API-Key<token>

Your Sim API key, personal or workspace-scoped. Generate one from the Sim dashboard under Settings > API Keys. A workspace API key is not accepted everywhere: operations that act on behalf of a specific human — administrative reads, secret access, and irreversible or governance-affecting writes — always reject it, whatever role the key carries. Each such operation says so in its own description, and the rejection surfaces as 403 unless the operation conceals unauthorized resources, in which case it is reported as 404. Use a personal API key for those.

In: header

Request Body

application/json

Knowledge bases, query, result limit, retrieval mode, and optional tag filters.

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://www.sim.ai/api/v2/knowledge/search" \  -H "Content-Type: application/json" \  -d '{    "workspaceId": "string",    "knowledgeBaseIds": [      "7c9e6679-7425-40de-944b-e07fc1f90ae7"    ]  }'
{
  "data": {
    "results": [
      {
        "documentId": "b2d4f8a0-1c3e-4a5b-9d7c-2e6f0a8b4c12",
        "documentName": "getting-started.pdf",
        "sourceUrl": "string",
        "content": "To reset your password, open Settings and choose Security.",
        "chunkIndex": 3,
        "metadata": {
          "category": "billing",
          "priority": 2
        },
        "similarity": 0.8423
      }
    ],
    "query": "How do I reset my password?",
    "knowledgeBaseIds": [
      "7c9e6679-7425-40de-944b-e07fc1f90ae7"
    ],
    "topK": 10,
    "totalResults": 4
  }
}
{
  "error": {
    "code": "BAD_REQUEST",
    "message": "The request is invalid."
  }
}
{
  "error": {
    "code": "BAD_REQUEST",
    "message": "The request is invalid."
  }
}
{
  "error": {
    "code": "BAD_REQUEST",
    "message": "The request is invalid."
  }
}
{
  "error": {
    "code": "BAD_REQUEST",
    "message": "The request is invalid."
  }
}
{
  "error": {
    "code": "BAD_REQUEST",
    "message": "The request is invalid."
  }
}
{
  "error": {
    "code": "BAD_REQUEST",
    "message": "The request is invalid."
  }
}
{
  "error": {
    "code": "BAD_REQUEST",
    "message": "The request is invalid."
  }
}
{
  "error": {
    "code": "BAD_REQUEST",
    "message": "The request is invalid."
  }
}
{
  "error": {
    "code": "BAD_REQUEST",
    "message": "The request is invalid."
  }
}