Docs Open org

API reference

Search API

Search, and find and replace across pages

GET /orgs/{org}/search

Searches the org as the caller: pages, entries, comments, attachment text and actors, ranked by hybrid fusion, filtered by permission.

Parameters

NameInTypeDescription
org requiredpathstringThe org slug.
qquerystringThe query (§9.1): words, "phrases", -exclusions and operators.
typequerystringComma-separated types: page, entry, comment, attachment, actor (the same as type: in q).
modequerystringhybrid (default), fts, fuzzy or semantic.
limitqueryinteger (int64)Page size (default 50, at most 200).
cursorquerystringnext_cursor from the previous page.

Responses

200
OK. SearchResults application/json
422
invalid_query

GET /orgs/{org}/search/replace

Every match of a text across the pages the caller can read.

Parameters

NameInTypeDescription
org requiredpathstringThe org slug.
find requiredquerystringThe text to find.
case_sensitivequerybooleanMatch case.
whole_wordquerybooleanWhole words only.
scopequerystringA space slug or page reference to limit to.

Responses

200
OK. Preview application/json

POST /orgs/{org}/search/replace

Replaces the selected matches: one commit per page in one transaction, with an undo receipt.

Parameters

NameInTypeDescription
org requiredpathstringThe org slug.

Request body

application/json, ApplySpec.

Responses

200
OK. Applied application/json
409
revision_conflict

GET /search

Searches every hat under each org's own authorisation, merged by score.

Parameters

NameInTypeDescription
qquerystringThe query (§9.1): words, "phrases", -exclusions and operators.
typequerystringComma-separated types: page, entry, comment, attachment, actor (the same as type: in q).
modequerystringhybrid (default), fts, fuzzy or semantic.
limitqueryinteger (int64)Page size (default 50, at most 200).
cursorquerystringnext_cursor from the previous page.

Responses

200
OK. SearchResults application/json