Skip to content
AACSearch

Update documents with conditional query

The filter_by query parameter is used to filter to specify a condition against which the documents are matched. The request body contains the fields that should be updated for any documents that match the filter condition. This endpoint is only available if the AACSearch node is version `0.25.0.rc12` or later.

Full-key operation

Requires a full key; a search key or a browser key gets a 403. See Keys and credits.
PATCH
/collections/{collectionName}/documents

The filter_by query parameter is used to filter to specify a condition against which the documents are matched. The request body contains the fields that should be updated for any documents that match the filter condition. This endpoint is only available if the AACSearch node is version 0.25.0.rc12 or later.

Authorization

api_key_header
X-NOVA-API-KEY<token>

Every request carries an organization API key. A key has one of two scopes. A full key reaches every operation in this document and belongs on your server. A search key is the one to ship in a browser widget or a storefront page: it reaches only the operations marked x-nova-key-scope: search — searching, federated search, recommendations, event ingestion, and the visitor-facing AI operations (semantic and image search, voice transcription and voice search, assistant chat, and the visitor's own conversation). It cannot write documents or read or change configuration; any other operation answers 403. AI operations are paid in credits from the organization's wallet whichever key calls them (402 when the balance runs out), and a search key needs X-NOVA-SESSION-ID on them: the session is what a conversation belongs to, and what the per-session allowance (429) is counted against. A key of either scope may additionally carry restrictions set in the console: an allowlist of collections (403 elsewhere), a forced filter_by per collection that is ANDed into every search (document-level access control), an allowlist of fields (include_fields is limited to it and a request naming any other field in query_by, facet_by, sort_by, filter_by or highlight_fields answers 400), an IP/CIDR allowlist and an Origin/Referer allowlist (403), and a per-key rate limit (429 with Retry-After).

In: header

Path Parameters

collectionName*string

The name of the collection to update documents in

Query Parameters

updateDocumentsParameters?

Request Body

application/json

The document fields to be updated

TypeScript Definitions

Use the request body type in TypeScript.

Can be any key-value pair

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://example.com/collections/string/documents" \  -H "Content-Type: application/json" \  -d '{}'
{  "num_updated": 1}