Skip to main content
Training Data

Search existing knowledge for a passage

Searches one passage or claim across Q&A, training files, and live help-center articles. Returns ranked candidates and query-focused excerpts without judging or writing. Similarity is an embedding score, not factual confidence; calibrate thresholds on representative examples and retain keyword-only results (similarity null). Retrieval and excerpts can miss relevant facts. Fetch full sources for decisions. Split long documents into bounded sections and audit each section before upload. Latency and embedding work depend on query size and service load.

POST
/v2/training_data/search
Authorizationstringheaderrequired

API key as Bearer token. Use: Authorization: Bearer sk_...

Featurebase-Versionenum<string>header

API version for this request. Defaults to your organization's configured API version if not specified.

Available options: 2026-08-19.orbit, 2026-01-01.nova, 2025-12-12.clover
Example: 2026-08-19.orbit

Body

application/json
excludeIdsstring[]

Q&A entry / training file IDs to leave out — typically the item you are about to update.

Maximum array length: 20
kindsenum<string>[]

Restrict to some kinds of knowledge. Default: all three (Q&A entries, training files, live help-center articles).

Required array length: 1 - 3
querystringrequired

A passage, claim, or question to find existing knowledge for — for example one section of a document you are about to upload. Compared by meaning and by keywords.

Required string length: 1 - 4000
Example: Refunds are processed within 14 days of the request.
topKintegerdefault:8

How many items to return (1–20).

Required range: 1 <= x <= 20
Example: 8

Response

application/json

Success

candidatesobject[]required

Existing items closest to the query, best first, at most topK. text is an excerpt focused on the query; section is the heading path inside a file when known.

objectenum<string>required

Object type identifier

Available options: knowledge_search
Example: knowledge_search
querystringrequired

The query as searched (trimmed)

Example: Refunds are processed within 14 days of the request.
timingsobjectrequired

Where the time went