API ReferenceKnowledge base search

Advanced semantic search

POST
/api/knowledge-bases/{id}/search

Performs semantic search with advanced options via POST. Allows more complex queries and detailed configuration.

Authorization

ApiKeyAuth
AuthorizationBearer <token>

Bearer token for API authentication

In: header

Path Parameters

id*string

Unique ID of the Knowledge Base

Request Body

application/json

query*string

Search query

Lengthlength <= 1000
limit?integer

Maximum number of results

Default10
Range1 <= value <= 50
similarityThreshold?number

Minimum similarity threshold

Default0.7
Range0 <= value <= 1
includeMetadata?boolean

Include metadata in results

Defaulttrue

Response Body

application/json

curl -X POST "https://app.docutray.com/api/knowledge-bases/string/search" \  -H "Content-Type: application/json" \  -d '{    "query": "How to configure the authentication system?"  }'
{
  "data": [
    {
      "document": {
        "id": "string",
        "documentId": "string",
        "content": {},
        "metadata": {},
        "createdAt": "2019-08-24T14:15:22Z",
        "updatedAt": "2019-08-24T14:15:22Z"
      },
      "similarity": 0.8542
    }
  ],
  "query": "string",
  "resultsCount": 0
}
Empty
Empty
Empty
Empty
Empty
Empty