Search Documents
POST /api/v1/documents/search — semantic + keyword search across stored documents (added in PR #57).
APIKeyHeaderX-API-Key<token>application/json- body
Vector search over indexed documents.
Mirrors MCP caura_doc op=search: when collection is omitted,
search spans every collection in the tenant (broad strategy); when
supplied, search is restricted to that collection (narrow strategy).
Only documents written with a data["summary"] (i.e. with a
non-NULL embedding column) are considered.
tenant_id?Tenant IdTenant to operate on. Omit it and the tenant is resolved from the credential, which is what a tenant- or agent-scoped key already identifies — no prior /whoami call is needed. Supply it to act on a different tenant your credential may read (and for an admin key, which belongs to no single tenant, it is required).
""fleet_id?string|nullcollection?|nullquery*Query1 <= lengthtop_k?Top K1 <= value <= 505Successful Response
application/json- response
collection*|Echo of the requested collection; null for cross-collection search.
count*Countresults*array<>Deprecated alias of items (wire contract D1).
items*array<>unindexed_count?|Present only on a zero-result search that had unsearchable documents in scope. Documents are indexed only when their write supplies data.summary (or data.description for skills); without one a document is stored and readable by id but never returned by search.
note?|Human-readable explanation accompanying unindexed_count.
curl -X POST 'https://example.com/api/v1/documents/search' \ -H 'Content-Type: application/json' \ -d '{ "query": "string"}'{ "collection": "string", "count": 0, "results": [ { "collection": "string", "doc_id": "string", "data": {}, "similarity": 0 } ], "items": [ { "collection": "string", "doc_id": "string", "data": {}, "similarity": 0 } ], "unindexed_count": 0, "note": "string"}