Skip to main content
GET
Rate limit tier: general, 600 requests/min. See Rate limits. Ranks a workflow’s knowledge corpus by relevance to query — for a topic-style question such as “where is termination discussed”, not an exact string, a count, or a sum. For an answer with citations, use Ask; for the full tree, use List. Each hit carries a relevance rank (higher first), a block_id, a content_url and a snippet: the text of the document’s best-matching block, up to 600 characters, with no highlight markers. Ranking is full-text search over the document’s blocks, headings and title, and rank is that score for the best block. It is relevance, not match count — a document matching the query term fewer times can still outrank one matching it more, and a document matching no query term is not returned. block_id is the anchor of that best block, the same block_id that Read content and Ask citations use. content_url is a presigned GET URL of the document’s whole body text, valid for 15 minutes; possession of the URL is read permission until it expires. Both are null on an older snapshot, and content_url is also null when the document changed after the snapshot was published.

Requires a knowledge base

Same requirement as ask: the workflow needs a knowledge node, or this returns 409 KNOWLEDGE_NOT_ENABLED. 409 KNOWLEDGE_NOT_READY means no usable snapshot has ever been published. Unlike ask, search is never billed, so 402 cannot occur here.

Folder

folder narrows ranking to one top-level source folder — the first path segment (e.g. contracts), not a nested path. Omitting it merges every folder’s statistics into one corpus-wide ranking. An unrecognized folder name is a 404.

Query length

query is 1 to 512 characters.

Limit

limit caps the number of hits, 1 to 50, default 10.

Errors

Authorizations

Authorization
string
header
required

API key issued from app.anyformat.ai/api-key. Send as Authorization: Bearer <key>.

Path Parameters

workflow_id
string
required

Query Parameters

query
string
required

Search query. 1 to 512 characters.

Required string length: 1 - 512
folder
string | null

Narrows to one top-level source folder (the first path segment, not a nested path). 404s when no such folder exists in this corpus.

limit
integer
default:10

Max hits to return, 1 to 50.

Required range: 1 <= x <= 50

Response

Successful Response

path
string
required

Document path inside the workflow's corpus.

folder
string
required

Parent folder of path.

title
string
required

Document title.

page_count
integer
required

Page count of the source document.

snippet
string
required

The text of the best-matching block, up to 600 characters.

rank
number
required

Full-text search score of the best-matching block; higher ranks first.

block_id
string | null

Anchor of the best-matching block, the block_id that read_knowledge content and citations use. Null on an older snapshot.

content_url
string | null

Presigned GET URL of the document's body text, valid for 900 seconds. Possession of the URL is read permission until it expires. Null on an older snapshot, or when the document changed after the snapshot was published.