Retrieve document chunks
Deprecated: Use the v3 search endpoint instead.
Invoke the document retrieval pipeline (embedding + hybrid vector search + reranking) and return matched document chunks.
Relevance scoring (relevance_scoring): controls the relevance scoring stage.
scoring_and_filtering(default): Score candidates for relevance and only return those above the quality threshold. When no candidate clears the threshold, the few best-scoring candidates are returned instead of an empty result; theirscores.relevanceis then below the usual threshold.scoring_only: Score every candidate for relevance but return them all, even low-scoring ones. Useful for building your own filtering logic.none: Skip the relevance scoring step and return all candidates unfiltered. Fastest option, useful when you handle scoring yourself.
Omit relevance_scoring for the default; send none to skip scoring.
skip_rerank is deprecated — true maps to relevance_scoring=none,
false to scoring_and_filtering. relevance_scoring wins if both are sent.
Result ordering: results are returned in descending order of score.
With scoring_and_filtering or scoring_only, score equals the relevance
score (scores.relevance, 0–1). With none, score is the combined retrieval
score (higher is better, no fixed upper bound).
If the scoring model is temporarily unavailable, results are returned in
retrieval order and a warnings array is included. Each warning has a code
matching the degraded scores key (e.g. relevance) and a reason classifying
the failure: model_not_found, timeout, service_error, or unknown.
The warnings key is absent when all pipeline steps succeed.
Scoping: use workspace_id and/or tag_id to narrow retrieval to specific
workspaces or tags, or use file_id to target specific files.
file_id cannot be combined with workspace_id or tag_id.
A 403 is returned if any provided filter resolves to no authorized resources.
When no filters are provided, retrieval runs across all authorized documents.
Public datasets: a public dataset workspace must be the only workspace in the
request — combining it with any other workspace_id, file_id, or tag_id returns
400. Public datasets are reachable only through a workspace-scoped API key whose scope
includes the workspace, and only for companies allowed to access them; otherwise the
result is empty.
Facet filtering: use content_type and/or attribute to narrow retrieval
by document metadata. These can be combined with workspace/tag scoping.
Content type uses colon-separated paths (e.g. legal:contract:nda).
Attributes support operators, OR, and content-type scoping.
Modes:
text(default): hybrid text searchvision: image-based search
Explain mode: set explain=true to receive a per-chunk scoring breakdown
in the response (raw scores, normalized scores, fusion weights, filter stats,
timing). Requires the SEARCH_EXPLAIN_MODE feature flag to be enabled.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
DRF serializer mixin providing content_type and attribute fields.
Compose into any request serializer via multiple inheritance::
Natural-language search query. Maximum 1500 characters.
1500Filter by content type path. Multiple values are OR. Exact-or-subtree matching by default (e.g. legal matches legal, legal:contract). Wildcards: *contract* (contains), legal:contract* (prefix).
Filter by attribute value. Repeated attribute entries are ANDed; values inside one entry are ORed with | (pipe is the recommended OR delimiter — comma also works but can be ambiguous with multi-key values). Example: attribute=fiscal_year:2024|2025&attribute=status:active → (fiscal_year 2024 OR 2025) AND (status active). Formats: name (has any value), name:value (exact), name:>value / name:>=value (gt/gte), name:<value / name:<=value (lt/lte), name:prefix* (starts with, case-insensitive), name:*text* (contains, case-insensitive), name:a|b (OR). Smart dates: filing_date:2023 (year), filing_date:2023-06 (month). Type-aware: booleans (true/false), multi-select (membership check). Scoped: content_type(legal:compliance).regulation:AML.
Retrieval pipeline: "text" (hybrid search on DocumentChunk) or "vision" (image-based on VisionChunk).
text- textvision- vision
text, vision Number of best candidates to score and return. Relevance scoring evaluates all top_k candidates from retrieval; scoring_and_filtering then keeps only those above the quality threshold. Range: 1–100.
1 <= x <= 100Scope retrieval to specific workspace IDs (authorized only).
Scope retrieval to specific file IDs (authorized only).
Scope retrieval to documents with any of these tag IDs (company-scoped).
Controls the relevance scoring step. "scoring_and_filtering" (default): Score candidates for relevance and only return those above the quality threshold. When no candidate clears the threshold, the few best-scoring candidates are returned instead of an empty result; their scores.relevance is then below the usual threshold. "scoring_only": Score every candidate for relevance but return them all, even low-scoring ones. Useful for building your own filtering logic. "none": Skip the relevance scoring step and return all candidates unfiltered. Fastest option, useful when you handle scoring yourself. Omit the field for the default; send "none" to skip. Overrides skip_rerank when both are sent.
none- nonescoring_only- scoring_onlyscoring_and_filtering- scoring_and_filtering
none, scoring_only, scoring_and_filtering Deprecated — use relevance_scoring. true → relevance_scoring=none, false → relevance_scoring=scoring_and_filtering. Ignored when relevance_scoring is provided.
Include base64-encoded page image in each result.
Expand document metadata in results. When true, content types include breadcrumb, code, and attribute definitions (type, required, choices).
Response
Chunks retrieved successfully. Empty array if no documents match.
The search query that was executed.
Retrieval parameters used (including defaults).
Scoping parameters used to narrow retrieval.
Retrieved chunks with context, ordered by score descending.
Present only when a pipeline signal degrades. Absent in the happy path.