documents

listDocuments

List AND grep documents in a project, workspace, or folder. query does a full-content search across each document's body (not just the title) and returns the matching lines — like grep across your docs. Each returned document includes contentMatches: [{line, text, context?}] and matchCount; the text is anchor-ready (paste it straight into editDocument's oldText). Use isRegex:true for regular-expression search (e.g. "TODO(.*)", "ACME-\d+"), caseSensitive for exact case, and contextLines for surrounding lines (grep -C). versionTimestamp is returned per document so you can edit straight from the results without a getDocument round-trip. Also supports date filtering. SCOPE HONESTY — read this before concluding something is absent: only documents that actually matched are returned (a document is never listed with matchCount 0 just because it was in scope), and the grep block reports scannedDocuments against totalDocumentsInScope. When truncated is true the search covered only part of the scope, so an absence is NOT proof; repeat with scanOffset set to the returned nextScanOffset until that field is gone, and union the results. A document too large to read is returned with contentSearchSkipped: true and NO matchCount, because its body was never searched.

post/tools/listDocuments

Request

  • Base URL: https://api.stablebaseline.io/functions/v1/cloud-serve/api/v1
  • URL: https://api.stablebaseline.io/functions/v1/cloud-serve/api/v1/tools/listDocuments
  • Auth: HTTP bearer

Request body

projectIdstring
workspaceIdstring
folderIdstring
querystring

Search text. Matched against title, friendlyId AND full document content. Returns the matching lines per document (grep). Case-insensitive unless caseSensitive:true; treated as a regex if isRegex:true.

isRegexboolean

Treat query as a JavaScript regular expression (grep -E). Default false (literal substring). Regex search requires a project/workspace/folder scope and scans a bounded window of documents.

caseSensitiveboolean

Case-sensitive matching. Default false.

contextLinesnumber

Lines of surrounding context to include with each match (grep -C). 0-5, default 0.

maxMatchesPerDocumentnumber

Cap on matching lines returned per document. 1-20, default 5.

limitnumber
offsetnumber

Pagination offset over the MATCHES. When searching, use scanOffset (not this) to reach documents the scan has not covered.

scanOffsetnumber

Search-only. Where to start the document scan within the scope. One call examines a bounded window; when the response reports truncated:true it also returns nextScanOffset — repeat with scanOffset set to that value until nextScanOffset is absent, and union the results, to search a scope larger than one window exhaustively.

fromDatestring

ISO 8601 date filter (from).

toDatestring

ISO 8601 date filter (to).

dateFieldstring

Date field to filter. Default: updated_at.

fieldsstring[]

Field projection for the document metadata. Valid fields: id, title, friendlyId, friendlyIdNumber, projectId, folderId, createdAt, updatedAt, href. (contentMatches/matchCount are always included when query is set.)

Response

Tool result (shape varies per tool — refer to the tool's docs for the exact return value).

object required

Changes

No recorded changes to this operation across all 1 revision of this API.