Save a search.
POST/api/v1/saved-searchesdocuments:search
Needs Create Saved Document Searches and Execute Saved Document Searches; the saved search is shown with View Saved Document Searches, otherwise the answer is the write receipt. Saves a search under a name (up to 255 characters) and a description, and caches its result set in the background: the saved search is pending until list_saved_searches shows it completed. The search takes the members of POST /documents/search that its Search app engine reads.
| Scope | documents:search |
| Asynchronous | No |
| MCP tool | create_saved_search |
| Portal permissions | create_saved_document_searches, execute_saved_document_searches |
| Company capability | search |
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Docwize-Version | header | string (date) | Optional | |
Idempotency-Key | header | string | Optional | max 255 |
Request body
| Content type | Type |
|---|---|
application/json | SavedSearchCreateInput |
Responses
| Status | Description | Body |
|---|---|---|
201 | Success. | application/json SavedSearch or object |
400 | invalid_version, malformed_json | application/problem+json Problem |
401 | token_expired, unauthenticated | application/problem+json Problem |
403 | forbidden, insufficient_scope, token_owner_inactive | application/problem+json Problem |
405 | method_not_allowed | application/problem+json Problem |
406 | not_acceptable | application/problem+json Problem |
409 | idempotency_in_progress | application/problem+json Problem |
413 | payload_too_large | application/problem+json Problem |
415 | unsupported_media_type | application/problem+json Problem |
421 | wrong_region | application/problem+json Problem |
422 | idempotency_key_reused, unsupported_for_tenant, validation_failed | application/problem+json Problem |
500 | internal_error | application/problem+json Problem |
503 | tenant_unavailable, unavailable | application/problem+json Problem |
504 | timeout | application/problem+json Problem |
Errors
The problem codes this operation can answer with. Each code links to its page.
Schemas
SavedSearch
| Field | Type | Required | Description |
|---|---|---|---|
cached_hit_count | integer | Required | The documents cached so far while the run is pending. ≥ -2147483648; ≤ 2147483647 |
created_at | string (date-time) or null | Required | |
description | string | Required | |
name | string | Required | |
needs_rerun | boolean | Required | Saved before result sets were cached: run it again to read its result. |
needs_resaving | boolean | Required | The stored search cannot be run as it was stored: save it again. |
reason | string or null | Required | Why the search needs re-saving. |
saved_search_id | string | Required | |
search | SavedSearchSpec or null | Required | The search; null when it needs re-saving. |
status | string | Required | pending, completed, failed, needs_rerun or needs_resaving. |
summary | string or null | Required | The plain-language summary written when the search was saved. |
total_hit_count | integer | Required | The documents the last run matched. ≥ -2147483648; ≤ 2147483647 |
SavedSearchCreateInput
| Field | Type | Required | Description |
|---|---|---|---|
description | string or null | Optional | Up to 255 characters. |
name | string | Required | Up to 255 characters. |
search | SavedSearchSpecInput | Required | What to search for. |
SavedSearchSpec
| Field | Type | Required | Description |
|---|---|---|---|
date_ranges | array of SearchDateRange | Required | Keep the documents whose dates fall in every range. |
document_number_prefixes | array of string | Required | Keep the documents whose number starts with one of these, ignoring case. |
exclude_duplicates | boolean or null | Required | Hide the documents that duplicate another document's number. |
facet_filters | array of SearchFacetFilter | Required | 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. |
query | string or null | Required | Full text, as in POST /documents/search. |
reference_numbers | array of string | Required | Keep the documents whose reference number contains one of these, ignoring case. |
weights | SearchWeights or null | Required | How much each field counts towards the score of a match of the query. 0 leaves a field out. |
SavedSearchSpecInput
| 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. |
query | string or null | Optional | Full text, as in POST /documents/search. |
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. |
SearchDateRange
| Field | Type | Required | Description |
|---|---|---|---|
field | string | Required | One of document_date, created_at, file_created_at, file_modified_at. |
from | string (date) or null | Required | The first day; open when left out. |
to | string (date) or null | Required | The last day; open when left out. |
SearchDateRangeInput
| 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. |
SearchFacetFilter
| 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 SearchFacetValue | Required | Alternatives: a document is kept when its facet holds any of them. |
SearchFacetFilterInput
| 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. |
SearchFacetValue
| Field | Type | Required | Description |
|---|---|---|---|
include_children | boolean | Required | 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 | Required | 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. |
SearchFacetValueInput
| 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. |
SearchWeights
| Field | Type | Required | Description |
|---|---|---|---|
ccs | integer or null | Required | |
content | integer or null | Required | |
description | integer or null | Required | |
document_number | integer or null | Required | |
folders | integer or null | Required | |
from | integer or null | Required | |
other_number | integer or null | Required | |
reference_number | integer or null | Required | |
to | integer or null | Required |
SearchWeightsInput
| 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 |