Skip to main content

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.

Scopedocuments:search
AsynchronousNo
MCP toolcreate_saved_search
Portal permissionscreate_saved_document_searches, execute_saved_document_searches
Company capabilitysearch

Parameters​

NameInTypeRequiredDescription
Docwize-Versionheaderstring (date)Optional
Idempotency-KeyheaderstringOptionalmax 255

Request body​

Content typeType
application/jsonSavedSearchCreateInput

Responses​

StatusDescriptionBody
201Success.application/json SavedSearch or object
400invalid_version, malformed_jsonapplication/problem+json Problem
401token_expired, unauthenticatedapplication/problem+json Problem
403forbidden, insufficient_scope, token_owner_inactiveapplication/problem+json Problem
405method_not_allowedapplication/problem+json Problem
406not_acceptableapplication/problem+json Problem
409idempotency_in_progressapplication/problem+json Problem
413payload_too_largeapplication/problem+json Problem
415unsupported_media_typeapplication/problem+json Problem
421wrong_regionapplication/problem+json Problem
422idempotency_key_reused, unsupported_for_tenant, validation_failedapplication/problem+json Problem
500internal_errorapplication/problem+json Problem
503tenant_unavailable, unavailableapplication/problem+json Problem
504timeoutapplication/problem+json Problem

Errors​

The problem codes this operation can answer with. Each code links to its page.

Schemas​

SavedSearch​

FieldTypeRequiredDescription
cached_hit_countintegerRequiredThe documents cached so far while the run is pending. ≥ -2147483648; ≤ 2147483647
created_atstring (date-time) or nullRequired
descriptionstringRequired
namestringRequired
needs_rerunbooleanRequiredSaved before result sets were cached: run it again to read its result.
needs_resavingbooleanRequiredThe stored search cannot be run as it was stored: save it again.
reasonstring or nullRequiredWhy the search needs re-saving.
saved_search_idstringRequired
searchSavedSearchSpec or nullRequiredThe search; null when it needs re-saving.
statusstringRequiredpending, completed, failed, needs_rerun or needs_resaving.
summarystring or nullRequiredThe plain-language summary written when the search was saved.
total_hit_countintegerRequiredThe documents the last run matched. ≥ -2147483648; ≤ 2147483647

SavedSearchCreateInput​

FieldTypeRequiredDescription
descriptionstring or nullOptionalUp to 255 characters.
namestringRequiredUp to 255 characters.
searchSavedSearchSpecInputRequiredWhat to search for.

SavedSearchSpec​

FieldTypeRequiredDescription
date_rangesarray of SearchDateRangeRequiredKeep the documents whose dates fall in every range.
document_number_prefixesarray of stringRequiredKeep the documents whose number starts with one of these, ignoring case.
exclude_duplicatesboolean or nullRequiredHide the documents that duplicate another document's number.
facet_filtersarray of SearchFacetFilterRequiredKeep 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.
querystring or nullRequiredFull text, as in POST /documents/search.
reference_numbersarray of stringRequiredKeep the documents whose reference number contains one of these, ignoring case.
weightsSearchWeights or nullRequiredHow much each field counts towards the score of a match of the query. 0 leaves a field out.

SavedSearchSpecInput​

FieldTypeRequiredDescription
date_rangesarray of SearchDateRangeInputOptionalKeep the documents whose dates fall in every range.
document_number_prefixesarray of stringOptionalKeep the documents whose number starts with one of these, ignoring case.
exclude_duplicatesboolean or nullOptionalHide the documents that duplicate another document's number.
facet_filtersarray of SearchFacetFilterInputOptionalKeep 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.
querystring or nullOptionalFull text, as in POST /documents/search.
reference_numbersarray of stringOptionalKeep the documents whose reference number contains one of these, ignoring case.
weightsSearchWeightsInput or nullOptionalHow much each field counts towards the score of a match of the query. 0 leaves a field out.

SearchDateRange​

FieldTypeRequiredDescription
fieldstringRequiredOne of document_date, created_at, file_created_at, file_modified_at.
fromstring (date) or nullRequiredThe first day; open when left out.
tostring (date) or nullRequiredThe last day; open when left out.

SearchDateRangeInput​

FieldTypeRequiredDescription
fieldstringRequiredOne of document_date, created_at, file_created_at, file_modified_at.
fromstring (date) or nullOptionalThe first day; open when left out.
tostring (date) or nullOptionalThe last day; open when left out.

SearchFacetFilter​

FieldTypeRequiredDescription
facetstringRequiredOne 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.
valuesarray of SearchFacetValueRequiredAlternatives: a document is kept when its facet holds any of them.

SearchFacetFilterInput​

FieldTypeRequiredDescription
facetstringRequiredOne 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.
valuesarray of SearchFacetValueInputRequiredAlternatives: a document is kept when its facet holds any of them.

SearchFacetValue​

FieldTypeRequiredDescription
include_childrenbooleanRequiredWith match exact, also select the values under this one in a hierarchy (a folder's subfolders): the facet starts with the value, ignoring case.
matchstring or nullRequiredexact (the default: the facet equals the value) or contains (the facet contains the text, ignoring case).
valuestringRequiredA value as the facet lists it. An empty string selects the documents with no value.

SearchFacetValueInput​

FieldTypeRequiredDescription
include_childrenbooleanOptionalWith match exact, also select the values under this one in a hierarchy (a folder's subfolders): the facet starts with the value, ignoring case.
matchstring or nullOptionalexact (the default: the facet equals the value) or contains (the facet contains the text, ignoring case).
valuestringRequiredA value as the facet lists it. An empty string selects the documents with no value.

SearchWeights​

FieldTypeRequiredDescription
ccsinteger or nullRequired
contentinteger or nullRequired
descriptioninteger or nullRequired
document_numberinteger or nullRequired
foldersinteger or nullRequired
frominteger or nullRequired
other_numberinteger or nullRequired
reference_numberinteger or nullRequired
tointeger or nullRequired

SearchWeightsInput​

FieldTypeRequiredDescription
ccsinteger or nullOptional
contentinteger or nullOptional
descriptioninteger or nullOptional
document_numberinteger or nullOptional
foldersinteger or nullOptional
frominteger or nullOptional
other_numberinteger or nullOptional
reference_numberinteger or nullOptional
tointeger or nullOptional