Searches the documents the caller can read, as the Portal's Search app or by precise filters. query is full text (words are ANDed, OR, "exact phrase", -exclude). Two engines answer, chosen by the members sent. The precise engine reads meaning (a search by meaning; needs the organisation's document embeddings) and filter (a tree of and, or, not and {field, op, value} leaves over the document fields, ops eq, ne, in, gt, gte, lt, lte, contains, starts_with, is_null; lookup-backed fields are named <field>_id). The Search app's engine reads weights, facet_filters (folder, tag, location, document type, from, to, project, file author and so on), document_number_prefixes, reference_numbers, date_ranges (document, entry and file dates), exclude_duplicates and highlight (passages with their pages). One search cannot hold members of both. Each hit carries its score. Relevance pages by the engine's order; sort=document_id orders by document ID.
filter and meaning are not available for every organisation. A call that uses them where they are unavailable is refused with 422 unsupported_for_tenant, unless it also sends a member that the Search app's engine reads; that call is refused with 422 validation_failed.
| |
|---|
| Scope | documents:search |
| Asynchronous | No |
| MCP tool | search_documents |
| Portal permissions | search_documents |
| Company capability | search |
| Paging | snapshot |
| Default order | -relevance, document_id |
| Sort fields | relevance, document_id |
Parameters
| Name | In | Type | Required | Description |
|---|
limit | query | integer | Optional | Default: 50; ≥ 1 |
cursor | query | string | Optional | |
sort | query | string | Optional | Comma-separated sort fields, - for descending. |
Docwize-Version | header | string (date) | Optional | |
Request body
Responses
200 body
| Field | Type | Required | Description |
|---|
items | array of DocumentSearchHit | Required | |
next_cursor | string or null | Required | |
warnings | array of object | Required | |
Errors
The problem codes this operation can answer with. Each code links to its page.
Schemas
AdditionalField
| Field | Type | Required | Description |
|---|
label | string or null | Required | |
value | string or null | Required | |
AdditionalFields
CarbonCopy
| Field | Type | Required | Description |
|---|
cc_id | string | Required | |
contact | object or null | Required | The contact of the organisation the copy names; null for the organisation on its own. |
organisation | object or null | Required | |
DocumentFile
| Field | Type | Required | Description |
|---|
content_type | string or null | Required | |
file_hash | string or null | Required | The hash the Portal stored for the file's content; null when none was recorded. |
file_name | string | Required | |
has_pdf | boolean | Required | Whether a PDF rendition of the file is ready (an Office file converts on demand, so false only means not yet). |
is_indexed | boolean | Required | Whether the file's text has been indexed for search. |
page_count | integer or null | Required | The pages the file has, once the Portal has counted them; null before. |
size_bytes | string or null | Required | |
version_id | string | Required | |
DocumentFolder
| Field | Type | Required | Description |
|---|
folder_id | string | Required | |
path | string or null | Required | |
DocumentSearchHit
| Field | Type | Required | Description |
|---|
actual_submission_date | string or null | Required | |
additional_fields | AdditionalFields | Required | |
attachment_state | string or null | Required | none, has_attachments or is_attachment (the document is an attachment of another); null unless include names attachment_state. |
carbon_copies | array of CarbonCopy | Required | The organisations and contacts the document is copied to; empty unless include names carbon_copies. |
created_at | string (date-time) or null | Required | |
created_by | UserRef or null | Required | |
description | string or null | Required | |
document_date | string or null | Required | |
document_id | string | Required | |
document_number | string or null | Required | |
document_status | object or null | Required | The status shown as Status in the Portal (lookup_actionstatus). |
document_sub_type | object or null | Required | |
document_type | object or null | Required | |
duplicate_of | string or null | Required | The number of the document this one duplicates (the Portal's Duplicate Of). |
file | DocumentFile or null | Required | The current file (name, type, size), as GET /documents/{document_id} shows it; null when the document has none or include leaves file out. |
folders | array of DocumentFolder | Required | The folders the document is filed in that the caller can see, as GET /documents/{document_id} lists them; empty unless include names folders. |
from_contact | object or null | Required | |
from_organisation | object or null | Required | |
highlights | array of SearchHighlight | Required | Passages that matched the query, with their pages; empty unless the search asked for highlight, and for the precise engine (filter, meaning). |
is_latest_revision | boolean | Required | |
is_locked | boolean | Required | |
is_privileged | boolean | Required | |
locations | array of SearchHitLocation | Required | The locations the document is filed in; empty unless include names locations. |
main_document_date | string or null | Required | |
owner | UserRef or null | Required | |
page_end | number or null | Required | Last page of the range this document covers in its file. |
page_start | number or null | Required | First page of the range this document covers in its file. |
post_review_status | object or null | Required | |
project | object or null | Required | The stored project number text, with the project's ID when one matches. |
project_organisation | object or null | Required | |
reference_number | string or null | Required | |
relevance | number or null | Required | 1 is relevant (the default), 0 is irrelevant (the Portal's Irrelevant switch). |
responded_with | string or null | Required | The reference of the document that responded to this one (the Portal's Responded With). |
response_date | string or null | Required | |
response_due_date | string or null | Required | |
revision_number | string or null | Required | |
score | number | Required | How well the document matches the query, higher first. 0 when the search has no query. |
tags | array of SearchHitTag | Required | The document's tags that are open to the caller; empty unless include names tags. |
to_contact | object or null | Required | |
to_organisation | object or null | Required | |
| Field | Type | Required | Description |
|---|
date_ranges | array of SearchDateRangeInput | Optional | Keep the documents whose dates fall in every range. |
document_number_prefixes | array of string | Optional | Keep the documents whose number starts with one of these, ignoring case. |
exclude_duplicates | boolean or null | Optional | Hide the documents that duplicate another document's number. |
facet_filters | array of SearchFacetFilterInput | Optional | Keep the documents whose folder, tag, location, file author and so on hold one of the values. The values are the ones POST /documents/aggregate lists. |
filter | object or null | Optional | A tree of and, or, not and {field, op, value} leaves over the document fields (precise engine). |
highlight | SearchHighlightOptionsInput or null | Optional | Return the passages of each hit that hold the query's words, with their pages (Search app's engine). |
include | array of string | Optional | Columns to add to each hit, as the Search app's results grid shows them: folders, tags, locations, carbon_copies, attachment_state, file. None when left out. |
meaning | string or null | Optional | A search by meaning (needs the organisation's document embeddings; precise engine). |
query | string or null | Optional | Full text: words are ANDed; OR, "exact phrase" and -exclude work. The Search app's engine also reads parentheses, NOT, AND, a trailing * and field:term, and matches the fields weights names, not only the content. |
reference_numbers | array of string | Optional | Keep the documents whose reference number contains one of these, ignoring case. |
weights | SearchWeightsInput or null | Optional | How much each field counts towards the score of a match of the query. 0 leaves a field out. |
| Field | Type | Required | Description |
|---|
field | string | Required | One of document_date, created_at, file_created_at, file_modified_at. |
from | string (date) or null | Optional | The first day; open when left out. |
to | string (date) or null | Optional | The last day; open when left out. |
| Field | Type | Required | Description |
|---|
facet | string | Required | One of document_type, document_sub_type, from, to, project, folder, location, tag, created_by, file_content_type, file_author, file_last_author, file_producer, file_title. |
values | array of SearchFacetValueInput | Required | Alternatives: a document is kept when its facet holds any of them. |
| Field | Type | Required | Description |
|---|
include_children | boolean | Optional | With match exact, also select the values under this one in a hierarchy (a folder's subfolders): the facet starts with the value, ignoring case. |
match | string or null | Optional | exact (the default: the facet equals the value) or contains (the facet contains the text, ignoring case). |
value | string | Required | A value as the facet lists it. An empty string selects the documents with no value. |
SearchHighlight
| Field | Type | Required | Description |
|---|
field | string | Required | The field the passage comes from: content, document_number, description, reference_number, from, to, ccs, other_number or folders. |
html | string | Required | The passage with the matched words in <b>; everything else is HTML-escaped. |
page | integer or null | Required | The 1-based page of the document the passage is on; null when the text has no pages. |
| Field | Type | Required | Description |
|---|
fragment_size | integer or null | Optional | Characters per passage, 20 to 2000 (default 150). |
fragments | integer or null | Optional | Passages per field and hit, 1 to 20 (default 3). |
SearchHitLocation
| Field | Type | Required | Description |
|---|
location_id | string | Required | |
path | string or null | Required | |
SearchHitTag
| Field | Type | Required | Description |
|---|
name | string | Required | |
tag_id | string | Required | |
| Field | Type | Required | Description |
|---|
ccs | integer or null | Optional | |
content | integer or null | Optional | |
description | integer or null | Optional | |
document_number | integer or null | Optional | |
folders | integer or null | Optional | |
from | integer or null | Optional | |
other_number | integer or null | Optional | |
reference_number | integer or null | Optional | |
to | integer or null | Optional | |
UserRef
| Field | Type | Required | Description |
|---|
display_name | string | Required | |
kind | string: user, system, integration or string | Required | |
user_id | string or null | Required | |