Documents

Update document

Changed on

Update mutable fields on a document without re-processing its content.

Tags (tags): The array REPLACES the document's tags, it is not merged into them — send the complete set you want the document to end up with, and any tag you leave out is dropped. An empty array ([]) therefore clears every tag.

Partial tag change (add_tags, remove_tags): adds or removes only the listed tags and keeps the rest, e.g. {"add_tags": ["team-c"], "remove_tags": ["team-a"]}. Removals apply first. Cannot be combined with tags (422). A request with none of tags, add_tags, remove_tags or observation_scopes is rejected (422).

The new tags are propagated to all associated memory units.

Observation scopes (observation_scopes): Replaces how the document's memories are scoped during consolidation, with the same values retain accepts. Use it to move a bank whose documents were retained under per-session tags to shared without re-extracting anything. It is also what a later reprocess of the document retains with.

A memory is re-consolidated only when the change moves the observation scopes it resolves to: its observations are deleted and it is queued again, along with co-source memories from other documents that shared those observations. A change that resolves to the same scopes (a tag change under shared, combined over one tag vs [[that tag]], re-sending the current values) keeps every observation and queues nothing.

patch/v1/default/banks/{bank_id}/documents/{document_id}

Request

Path parameters

bank_idstring required
document_idstring required

Headers

authorizationstring nullable

Request body

tagsstring[] nullable

The complete new set of tags for the document and its memory units — this REPLACES the existing tags rather than adding to them, so omitting a tag drops it and [] clears them all. Triggers observation invalidation and re-consolidation. To change only some tags, use add_tags / remove_tags instead.

add_tagsstring[] nullable

Tags to add to the document, keeping the ones it has. Cannot be combined with tags.

remove_tagsstring[] nullable

Tags to remove from the document, keeping the rest (applied before add_tags). Cannot be combined with tags. Tags a memory carries from an entity label group with tag: true stay on that memory.

Example request

{
  "tags": [
    "team-a",
    "team-b"
  ]
}

Response

Successful Response

successboolean

Changes

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • warning

      removed the optional property // from the response with the status