Forget session memories

Base URL
https://{kibana_url}
  • POST /api/context_engine/memory/_forget
  • POST /s/{space_id}/api/context_engine/memory/_forget
Auth

Forgets session memories by ID for the target user. The route reports a memory of another user or another space as not_found, so it does not reveal whether the memory exists.

Requires the contextEngine:write privilege. Without user_id, the route forgets the caller's own memories, and a caller without a user profile gets a 403. Naming another user in user_id also requires contextEngine:manage_memory.

Forgetting writes a tombstone so reads stop returning the memory after the next Elasticsearch refresh, while Elasticsearch keeps its revisions until retention removes them. A read immediately after forgetting can still return the memory, and forgetting a memory right after writing it can return not_found until that write is visible. If Elasticsearch rejects a tombstone, the route returns failed with error and the caller can retry that ID.

After authorization, validation, and feature-flag checks pass, the route writes one memory_forget audit event per unique memory ID. Forgetting still works when memory is turned off.

Returns a 404 response when Context Engine is turned off in this space (contextEngine:enabled).

For more information, refer to the Context Engine documentation.

Required privileges

contextEngine:write. Extended privileges (optional, expand functionality when granted): contextEngine:manage_memory

Path parameters

space_id string optional

An identifier for the space. If space_id is not provided in the URL, the default space is used. Refer to Spaces for more information.

Header parameters

kbn-xsrf string required

A required header to protect against CSRF attacks

Request body

ids string[] · min items: 1 · max items: 100 required

The ids of the memories to forget. The route collapses duplicates.

user_id string · min length: 1 · max length: 1024

The Kibana user profile UID that the memories belong to. Omit this field to use the caller's user profile. Naming another user requires contextEngine:manage_memory.

Responses

The outcome for every requested memory.

application/json
results object[] · max items: 100 required

One result per unique id, in request order.

error string

Why the tombstone failed when outcome is failed.

id string required

The memory id.

outcome enum required

What happened to the memory: forgotten if a tombstone was written, already_forgotten if it was already tombstoned, not_found if it does not exist or belongs to another user or space, or failed if Elasticsearch rejected the tombstone.

Values: forgotten already_forgotten not_found failed
Base URL
https://{kibana_url}