# Agentic memory service

> Agentic memory service - Endpoints for managing agentic memory spaces, sessions, and events.

This Markdown file sits beside the HTML page at the same path (with a `.md` suffix). It summarizes the topic and lists links for tools and LLM context.

Companion generated at `2026-07-23T18:01:59.433122+00:00` (UTC).

## Primary page

- [Agentic memory service](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md): Full documentation for this topic (Markdown sidecar).

## Sections on this page

- [List memory spaces](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#list-memory-spaces): In-page section heading.
- [Parameters](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#list_memory_spaces__get-parameters): In-page section heading.
- [Example responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#example-responses): In-page section heading.
- [Responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#responses): In-page section heading.
- [Response Headers](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#response-headers): In-page section heading.
- [Create memory space](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#create-memory-space): In-page section heading.
- [Body parameter](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#body-parameter): In-page section heading.
- [Parameters](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#create_memory_space_new__post-parameters): In-page section heading.
- [Example responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#example-responses_1): In-page section heading.
- [Responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#responses_1): In-page section heading.
- [Response Headers](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#response-headers_1): In-page section heading.
- [Delete memory space by memory_space_ ID](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#delete-memory-space-by-memory_space_-id): In-page section heading.
- [Parameters](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#delete_memory_space__memory_space_id___delete-parameters): In-page section heading.
- [Example responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#example-responses_2): In-page section heading.
- [Responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#responses_2): In-page section heading.
- [Get memory space by memory_space_ ID](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#get-memory-space-by-memory_space_-id): In-page section heading.
- [Parameters](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#get_memory_space__memory_space_id___get-parameters): In-page section heading.
- [Example responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#example-responses_3): In-page section heading.
- [Responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#responses_3): In-page section heading.
- [Response Headers](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#response-headers_2): In-page section heading.
- [Update memory space by memory_space_ ID](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#update-memory-space-by-memory_space_-id): In-page section heading.
- [Body parameter](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#body-parameter_1): In-page section heading.
- [Parameters](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#update_memory_space__memory_space_id___patch-parameters): In-page section heading.
- [Example responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#example-responses_4): In-page section heading.
- [Responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#responses_4): In-page section heading.
- [Response Headers](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#response-headers_3): In-page section heading.
- [List sessions by memory_space_ ID](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#list-sessions-by-memory_space_-id): In-page section heading.
- [Parameters](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#list_sessions__memory_space_id__sessions__get-parameters): In-page section heading.
- [Example responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#example-responses_5): In-page section heading.
- [Responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#responses_5): In-page section heading.
- [Response Headers](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#response-headers_4): In-page section heading.
- [Create session by memory_space_ ID](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#create-session-by-memory_space_-id): In-page section heading.
- [Body parameter](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#body-parameter_2): In-page section heading.
- [Parameters](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#create_session__memory_space_id__sessions__post-parameters): In-page section heading.
- [Example responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#example-responses_6): In-page section heading.
- [Responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#responses_6): In-page section heading.
- [Response Headers](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#response-headers_5): In-page section heading.
- [Delete session by memory_space_ ID](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#delete-session-by-memory_space_-id): In-page section heading.
- [Parameters](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#delete_session__memory_space_id__sessions__session_id___delete-parameters): In-page section heading.
- [Example responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#example-responses_7): In-page section heading.
- [Responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#responses_7): In-page section heading.
- [Get session by memory_space_ ID](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#get-session-by-memory_space_-id): In-page section heading.
- [Parameters](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#get_session__memory_space_id__sessions__session_id___get-parameters): In-page section heading.
- [Example responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#example-responses_8): In-page section heading.
- [Responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#responses_8): In-page section heading.
- [Response Headers](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#response-headers_6): In-page section heading.
- [Update session by memory_space_ ID](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#update-session-by-memory_space_-id): In-page section heading.
- [Body parameter](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#body-parameter_3): In-page section heading.
- [Parameters](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#update_session__memory_space_id__sessions__session_id___patch-parameters): In-page section heading.
- [Example responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#example-responses_9): In-page section heading.
- [Responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#responses_9): In-page section heading.
- [Response Headers](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#response-headers_7): In-page section heading.
- [List events by memory_space_ ID](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#list-events-by-memory_space_-id): In-page section heading.
- [Parameters](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#list_events__memory_space_id__sessions__session_id__events__get-parameters): In-page section heading.
- [Example responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#example-responses_10): In-page section heading.
- [Responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#responses_10): In-page section heading.
- [Response Headers](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#response-headers_8): In-page section heading.
- [Create event by memory_space_ ID](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#create-event-by-memory_space_-id): In-page section heading.
- [Body parameter](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#body-parameter_4): In-page section heading.
- [Parameters](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#create_event__memory_space_id__sessions__session_id__events__post-parameters): In-page section heading.
- [Example responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#example-responses_11): In-page section heading.
- [Responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#responses_11): In-page section heading.
- [Response Headers](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#response-headers_9): In-page section heading.
- [Update events batch by memory_space_ ID](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#update-events-batch-by-memory_space_-id): In-page section heading.
- [Body parameter](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#body-parameter_5): In-page section heading.
- [Parameters](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#update_events_batch__memory_space_id__sessions__session_id__events_batch__patch-parameters): In-page section heading.
- [Example responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#example-responses_12): In-page section heading.
- [Responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#responses_12): In-page section heading.
- [Response Headers](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#response-headers_10): In-page section heading.
- [Create events batch by memory_space_ ID](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#create-events-batch-by-memory_space_-id): In-page section heading.
- [Body parameter](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#body-parameter_6): In-page section heading.
- [Parameters](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#create_events_batch__memory_space_id__sessions__session_id__events_batch__post-parameters): In-page section heading.
- [Example responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#example-responses_13): In-page section heading.
- [Responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#responses_13): In-page section heading.
- [Response Headers](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#response-headers_11): In-page section heading.
- [Delete event by memory_space_ ID](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#delete-event-by-memory_space_-id): In-page section heading.
- [Parameters](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#delete_event__memory_space_id__sessions__session_id__events__sequence_id___delete-parameters): In-page section heading.
- [Example responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#example-responses_14): In-page section heading.
- [Responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#responses_14): In-page section heading.
- [Update event by memory_space_ ID](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#update-event-by-memory_space_-id): In-page section heading.
- [Body parameter](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#body-parameter_7): In-page section heading.
- [Parameters](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#update_event__memory_space_id__sessions__session_id__events__sequence_id___patch-parameters): In-page section heading.
- [Example responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#example-responses_15): In-page section heading.
- [Responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#responses_15): In-page section heading.
- [Response Headers](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#response-headers_12): In-page section heading.
- [Delete all memories by memory_space_ ID](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#delete-all-memories-by-memory_space_-id): In-page section heading.
- [Parameters](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#delete_all_memories__memory_space_id__v1_memories__delete-parameters): In-page section heading.
- [Example responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#example-responses_16): In-page section heading.
- [Responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#responses_16): In-page section heading.
- [Response Schema](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#response-schema): In-page section heading.
- [Get all memories v1 by memory_space_ ID](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#get-all-memories-v1-by-memory_space_-id): In-page section heading.
- [Parameters](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#get_all_memories_v1__memory_space_id__v1_memories__get-parameters): In-page section heading.
- [Example responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#example-responses_17): In-page section heading.
- [Responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#responses_17): In-page section heading.
- [Response Schema](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#response-schema_1): In-page section heading.
- [Response Headers](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#response-headers_13): In-page section heading.
- [Post memories by memory_space_ ID](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#post-memories-by-memory_space_-id): In-page section heading.
- [Body parameter](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#body-parameter_8): In-page section heading.
- [Parameters](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#post_memories__memory_space_id__v1_memories__post-parameters): In-page section heading.
- [Example responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#example-responses_18): In-page section heading.
- [Responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#responses_18): In-page section heading.
- [Response Schema](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#response-schema_2): In-page section heading.
- [Response Headers](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#response-headers_14): In-page section heading.
- [Search memories v1 by memory_space_ ID](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#search-memories-v1-by-memory_space_-id): In-page section heading.
- [Body parameter](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#body-parameter_9): In-page section heading.
- [Parameters](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#search_memories_v1__memory_space_id__v1_memories_search__post-parameters): In-page section heading.
- [Example responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#example-responses_19): In-page section heading.
- [Responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#responses_19): In-page section heading.
- [Response Schema](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#response-schema_3): In-page section heading.
- [Response Headers](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#response-headers_15): In-page section heading.
- [Delete memory by memory_space_ ID](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#delete-memory-by-memory_space_-id): In-page section heading.
- [Parameters](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#delete_memory__memory_space_id__v1_memories__memory_id___delete-parameters): In-page section heading.
- [Example responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#example-responses_20): In-page section heading.
- [Responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#responses_20): In-page section heading.
- [Response Schema](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#response-schema_4): In-page section heading.
- [Get memory by memory_space_ ID](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#get-memory-by-memory_space_-id): In-page section heading.
- [Parameters](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#get_memory__memory_space_id__v1_memories__memory_id___get-parameters): In-page section heading.
- [Example responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#example-responses_21): In-page section heading.
- [Responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#responses_21): In-page section heading.
- [Response Schema](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#response-schema_5): In-page section heading.
- [Response Headers](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#response-headers_16): In-page section heading.
- [Put memory by memory_space_ ID](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#put-memory-by-memory_space_-id): In-page section heading.
- [Body parameter](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#body-parameter_10): In-page section heading.
- [Parameters](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#put_memory__memory_space_id__v1_memories__memory_id___put-parameters): In-page section heading.
- [Example responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#example-responses_22): In-page section heading.
- [Responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#responses_22): In-page section heading.
- [Response Schema](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#response-schema_6): In-page section heading.
- [Response Headers](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#response-headers_17): In-page section heading.
- [Get memory history by memory_space_ ID](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#get-memory-history-by-memory_space_-id): In-page section heading.
- [Parameters](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#get_memory_history__memory_space_id__v1_memories__memory_id__history__get-parameters): In-page section heading.
- [Example responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#example-responses_23): In-page section heading.
- [Responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#responses_23): In-page section heading.
- [Response Schema](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#response-schema_7): In-page section heading.
- [Response Headers](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#response-headers_18): In-page section heading.
- [ping by memory_space_ ID](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#ping-by-memory_space_-id): In-page section heading.
- [Parameters](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#ping__memory_space_id__v1_ping__get-parameters): In-page section heading.
- [Example responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#example-responses_24): In-page section heading.
- [Responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#responses_24): In-page section heading.
- [Response Schema](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#response-schema_8): In-page section heading.
- [Reset memories by memory_space_ ID](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#reset-memories-by-memory_space_-id): In-page section heading.
- [Parameters](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#reset_memories__memory_space_id__v1_reset__post-parameters): In-page section heading.
- [Example responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#example-responses_25): In-page section heading.
- [Responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#responses_25): In-page section heading.
- [Response Schema](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#response-schema_9): In-page section heading.
- [Get all memories v2 by memory_space_ ID](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#get-all-memories-v2-by-memory_space_-id): In-page section heading.
- [Body parameter](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#body-parameter_11): In-page section heading.
- [Parameters](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#get_all_memories_v2__memory_space_id__v2_memories__post-parameters): In-page section heading.
- [Example responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#example-responses_26): In-page section heading.
- [Responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#responses_26): In-page section heading.
- [Response Schema](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#response-schema_10): In-page section heading.
- [Response Headers](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#response-headers_19): In-page section heading.
- [Search memories v2 by memory_space_ ID](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#search-memories-v2-by-memory_space_-id): In-page section heading.
- [Body parameter](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#body-parameter_12): In-page section heading.
- [Parameters](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#search_memories_v2__memory_space_id__v2_memories_search__post-parameters): In-page section heading.
- [Example responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#example-responses_27): In-page section heading.
- [Responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#responses_27): In-page section heading.
- [Response Schema](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#response-schema_11): In-page section heading.
- [Response Headers](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#response-headers_20): In-page section heading.
- [Create memories by ID by memory_space_ ID](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#create-memories-by-id-by-memory_space_-id): In-page section heading.
- [Body parameter](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#body-parameter_13): In-page section heading.
- [Parameters](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#get_all_memories_v2__memory_space_id__v3_memories__post-parameters): In-page section heading.
- [Example responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#example-responses_28): In-page section heading.
- [Responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#responses_28): In-page section heading.
- [Response Schema](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#response-schema_12): In-page section heading.
- [Response Headers](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#response-headers_21): In-page section heading.
- [Create add by ID by memory_space_ ID](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#create-add-by-id-by-memory_space_-id): In-page section heading.
- [Body parameter](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#body-parameter_14): In-page section heading.
- [Parameters](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#post_memories__memory_space_id__v3_memories_add__post-parameters): In-page section heading.
- [Example responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#example-responses_29): In-page section heading.
- [Responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#responses_29): In-page section heading.
- [Response Schema](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#response-schema_13): In-page section heading.
- [Response Headers](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#response-headers_22): In-page section heading.
- [Create search by ID by memory_space_ ID](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#create-search-by-id-by-memory_space_-id): In-page section heading.
- [Body parameter](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#body-parameter_15): In-page section heading.
- [Parameters](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#search_memories_v2__memory_space_id__v3_memories_search__post-parameters): In-page section heading.
- [Example responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#example-responses_30): In-page section heading.
- [Responses](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#responses_30): In-page section heading.
- [Response Schema](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#response-schema_14): In-page section heading.
- [Response Headers](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#response-headers_23): In-page section heading.
- [BatchCreateEventRequest](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#tocS_BatchCreateEventRequest): In-page section heading.
- [Properties](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#properties): In-page section heading.
- [BatchEventResponse](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#tocS_BatchEventResponse): In-page section heading.
- [Properties](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#properties_1): In-page section heading.
- [BatchUpdateEventItem](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#tocS_BatchUpdateEventItem): In-page section heading.
- [Properties](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#properties_2): In-page section heading.
- [BatchUpdateEventRequest](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#tocS_BatchUpdateEventRequest): In-page section heading.
- [Properties](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#properties_3): In-page section heading.
- [CreateEventRequest](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#tocS_CreateEventRequest): In-page section heading.
- [Properties](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#properties_4): In-page section heading.
- [CreateMemorySpaceRequest](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#tocS_CreateMemorySpaceRequest): In-page section heading.
- [Properties](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#properties_5): In-page section heading.
- [CreateSessionRequest](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#tocS_CreateSessionRequest): In-page section heading.
- [Properties](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#properties_6): In-page section heading.
- [EmitterDataModel](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#tocS_EmitterDataModel): In-page section heading.
- [Properties](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#properties_7): In-page section heading.
- [Enumerated Values](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#enumerated-values): In-page section heading.
- [EventBody](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#tocS_EventBody): In-page section heading.
- [Properties](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#properties_8): In-page section heading.
- [EventCountTrigger](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#tocS_EventCountTrigger): In-page section heading.
- [Properties](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#properties_9): In-page section heading.
- [EventResponse](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#tocS_EventResponse): In-page section heading.
- [Properties](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#properties_10): In-page section heading.
- [EventType](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#tocS_EventType): In-page section heading.
- [Properties](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#properties_11): In-page section heading.
- [Enumerated Values](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#enumerated-values_1): In-page section heading.
- [HTTPValidationError](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#tocS_HTTPValidationError): In-page section heading.
- [Properties](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#properties_12): In-page section heading.
- [IdleTimeoutTrigger](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#tocS_IdleTimeoutTrigger): In-page section heading.
- [Properties](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#properties_13): In-page section heading.
- [LifecycleStrategiesDataModel](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#tocS_LifecycleStrategiesDataModel): In-page section heading.
- [Properties](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#properties_14): In-page section heading.
- [Enumerated Values](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#enumerated-values_2): In-page section heading.
- [LifecycleStrategyResponse](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#tocS_LifecycleStrategyResponse): In-page section heading.
- [Properties](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#properties_15): In-page section heading.
- [Enumerated Values](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#enumerated-values_3): In-page section heading.
- [MemoryCreate](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#tocS_MemoryCreate): In-page section heading.
- [Properties](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#properties_16): In-page section heading.
- [MemoryGetAll](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#tocS_MemoryGetAll): In-page section heading.
- [Properties](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#properties_17): In-page section heading.
- [MemorySearch](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#tocS_MemorySearch): In-page section heading.
- [Properties](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#properties_18): In-page section heading.
- [MemorySpaceDeduplicationErrorResponse](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#tocS_MemorySpaceDeduplicationErrorResponse): In-page section heading.
- [Properties](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#properties_19): In-page section heading.
- [MemorySpaceResponse](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#tocS_MemorySpaceResponse): In-page section heading.
- [Properties](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#properties_20): In-page section heading.
- [MemoryUpdate](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#tocS_MemoryUpdate): In-page section heading.
- [Properties](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#properties_21): In-page section heading.
- [Message](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#tocS_Message): In-page section heading.
- [Properties](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#properties_22): In-page section heading.
- [Enumerated Values](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#enumerated-values_4): In-page section heading.
- [PaginatedResponse_EventResponse_](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#tocS_PaginatedResponse_EventResponse_): In-page section heading.
- [Properties](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#properties_23): In-page section heading.
- [PaginatedResponse_MemorySpaceResponse_](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#tocS_PaginatedResponse_MemorySpaceResponse_): In-page section heading.
- [Properties](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#properties_24): In-page section heading.
- [PaginatedResponse_SessionResponse_](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#tocS_PaginatedResponse_SessionResponse_): In-page section heading.
- [Properties](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#properties_25): In-page section heading.
- [SessionDeduplicationErrorResponse](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#tocS_SessionDeduplicationErrorResponse): In-page section heading.
- [Properties](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#properties_26): In-page section heading.
- [SessionResponse](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#tocS_SessionResponse): In-page section heading.
- [Properties](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#properties_27): In-page section heading.
- [TTLTrigger](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#tocS_TTLTrigger): In-page section heading.
- [Properties](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#properties_28): In-page section heading.
- [TokenCountTrigger](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#tocS_TokenCountTrigger): In-page section heading.
- [Properties](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#properties_29): In-page section heading.
- [UpdateEventRequest](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#tocS_UpdateEventRequest): In-page section heading.
- [Properties](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#properties_30): In-page section heading.
- [UpdateMemorySpaceRequest](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#tocS_UpdateMemorySpaceRequest): In-page section heading.
- [Properties](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#properties_31): In-page section heading.
- [UpdateSessionRequest](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#tocS_UpdateSessionRequest): In-page section heading.
- [Properties](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#properties_32): In-page section heading.
- [ValidationError](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#tocS_ValidationError): In-page section heading.
- [Properties](https://docs.datarobot.com/ja/docs/api/reference/public-api/agentic_memory.html.md#properties_33): In-page section heading.

## Documentation content

Endpoints for managing agentic memory spaces, sessions, and events.

## List memory spaces

Operation path: `GET /`

List all Memory Spaces accessible by the authenticated user

- Returns offset/limit pagination with a total count.
- Soft-deleted spaces are excluded.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| offset | query | integer | false | Skip the specified number of values. |
| limit | query | integer | false | Retrieve only the specified number of values. |
| deduplicationKey | query | any | false | Filter memory spaces by deduplication key (exact match). |

### Example responses

> 200 Response

```
{
  "properties": {
    "items": {
      "description": "List of items for the current page.",
      "items": {
        "description": "Response schema for a single memory space.",
        "properties": {
          "createdAt": {
            "description": "Memory space creation timestamp.",
            "format": "date-time",
            "title": "Createdat",
            "type": "string"
          },
          "customInstructions": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Custom prompt instructions used for fact extraction. null means the default mem0 extraction prompt is used.",
            "title": "Custominstructions"
          },
          "deduplicationKey": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Deduplication key, unique per user, if one was set.",
            "title": "Deduplicationkey"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Memory space description.",
            "title": "Description"
          },
          "llmBaseUrl": {
            "anyOf": [
              {
                "format": "uri",
                "maxLength": 2083,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Chat API url to use for memory extraction.",
            "title": "Llmbaseurl"
          },
          "llmModelName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "LLM model configured for memory extraction.",
            "title": "Llmmodelname"
          },
          "memorySpaceId": {
            "description": "Unique memory space identifier.",
            "format": "uuid",
            "title": "Memoryspaceid",
            "type": "string"
          },
          "tenantId": {
            "description": "Tenant identifier.",
            "format": "uuid",
            "title": "Tenantid",
            "type": "string"
          },
          "userId": {
            "description": "ID of the user who owns this memory space.",
            "title": "Userid",
            "type": "string"
          }
        },
        "required": [
          "memorySpaceId",
          "userId",
          "tenantId",
          "createdAt"
        ],
        "title": "MemorySpaceResponse",
        "type": "object"
      },
      "maxItems": 100,
      "title": "Items",
      "type": "array"
    },
    "limit": {
      "description": "Maximum number of returned items.",
      "exclusiveMinimum": 0,
      "title": "Limit",
      "type": "integer"
    },
    "offset": {
      "description": "Number of skipped items.",
      "minimum": 0,
      "title": "Offset",
      "type": "integer"
    },
    "total": {
      "description": "Total number of matching items.",
      "title": "Total",
      "type": "integer"
    }
  },
  "required": [
    "items",
    "offset",
    "limit",
    "total"
  ],
  "title": "PaginatedResponse[MemorySpaceResponse]",
  "type": "object"
}
```

### Responses

| Status | Meaning | Description | Schema |
| --- | --- | --- | --- |
| 200 | OK | Successful Response | PaginatedResponse_MemorySpaceResponse_ |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
| 429 | Too Many Requests | Trial usage limit reached: the tenant's monthly read/write request quota or its total storage cap is exhausted. Carries X-RateLimit-* headers; quota (not storage) responses also carry Retry-After. | None |

### Response Headers

| Status | Header | Type | Format | Description |
| --- | --- | --- | --- | --- |
| 429 | Retry-After | integer |  | Seconds until the monthly quota resets. Quota responses only. |
| 429 | X-RateLimit-Limit | integer |  | The applicable limit (monthly request quota, or storage cap). |
| 429 | X-RateLimit-Remaining | integer |  | Units remaining before the limit is reached. |
| 429 | X-RateLimit-Reset | integer |  | Epoch seconds at which the quota resets. Quota responses only. |

## Create memory space

Operation path: `POST /new/`

Create a new Memory Space

tenant_id is bound from the authenticated user's context; clients cannot set or override it.

### Body parameter

```
{
  "description": "Request body for creating a memory space.",
  "properties": {
    "customInstructions": {
      "anyOf": [
        {
          "maxLength": 10000,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Custom prompt instructions used for fact extraction null leaves mem0 on its default extraction prompt.",
      "title": "Custominstructions"
    },
    "deduplicationKey": {
      "anyOf": [
        {
          "maxLength": 72,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Optional key, unique per user, for idempotent memory space creation by coordinating ha agents. a second create with the same key returns 409.",
      "title": "Deduplicationkey"
    },
    "description": {
      "anyOf": [
        {
          "maxLength": 1000,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Optional description for the memory space.",
      "title": "Description"
    },
    "llmBaseUrl": {
      "anyOf": [
        {
          "format": "uri",
          "maxLength": 2083,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Chat API url to use for memory extraction.",
      "title": "Llmbaseurl"
    },
    "llmModelName": {
      "anyOf": [
        {
          "maxLength": 200,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Name of the LLM model to use for memory extraction. non-reasoning models such as ``gpt-4o`` are recommended. reasoning-capable models are significantly slower for fact extraction without producing meaningfully better results.",
      "title": "Llmmodelname"
    }
  },
  "title": "CreateMemorySpaceRequest",
  "type": "object"
}
```

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| body | body | CreateMemorySpaceRequest | false | none |

### Example responses

> 201 Response

```
{
  "description": "Response schema for a single memory space.",
  "properties": {
    "createdAt": {
      "description": "Memory space creation timestamp.",
      "format": "date-time",
      "title": "Createdat",
      "type": "string"
    },
    "customInstructions": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Custom prompt instructions used for fact extraction. null means the default mem0 extraction prompt is used.",
      "title": "Custominstructions"
    },
    "deduplicationKey": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Deduplication key, unique per user, if one was set.",
      "title": "Deduplicationkey"
    },
    "description": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Memory space description.",
      "title": "Description"
    },
    "llmBaseUrl": {
      "anyOf": [
        {
          "format": "uri",
          "maxLength": 2083,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Chat API url to use for memory extraction.",
      "title": "Llmbaseurl"
    },
    "llmModelName": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "LLM model configured for memory extraction.",
      "title": "Llmmodelname"
    },
    "memorySpaceId": {
      "description": "Unique memory space identifier.",
      "format": "uuid",
      "title": "Memoryspaceid",
      "type": "string"
    },
    "tenantId": {
      "description": "Tenant identifier.",
      "format": "uuid",
      "title": "Tenantid",
      "type": "string"
    },
    "userId": {
      "description": "ID of the user who owns this memory space.",
      "title": "Userid",
      "type": "string"
    }
  },
  "required": [
    "memorySpaceId",
    "userId",
    "tenantId",
    "createdAt"
  ],
  "title": "MemorySpaceResponse",
  "type": "object"
}
```

### Responses

| Status | Meaning | Description | Schema |
| --- | --- | --- | --- |
| 201 | Created | Successful Response | MemorySpaceResponse |
| 409 | Conflict | A memory space with this deduplicationKey already exists for the user. Body carries existingMemorySpaceId / existingMemorySpaceUrl when the live winner can be resolved; the response also sets a Location header to its absolute URL. | MemorySpaceDeduplicationErrorResponse |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
| 429 | Too Many Requests | Trial usage limit reached: the tenant's monthly read/write request quota or its total storage cap is exhausted. Carries X-RateLimit-* headers; quota (not storage) responses also carry Retry-After. | None |

### Response Headers

| Status | Header | Type | Format | Description |
| --- | --- | --- | --- | --- |
| 429 | Retry-After | integer |  | Seconds until the monthly quota resets. Quota responses only. |
| 429 | X-RateLimit-Limit | integer |  | The applicable limit (monthly request quota, or storage cap). |
| 429 | X-RateLimit-Remaining | integer |  | Units remaining before the limit is reached. |
| 429 | X-RateLimit-Reset | integer |  | Epoch seconds at which the quota resets. Quota responses only. |

## Delete memory space by memory_space_ ID

Operation path: `DELETE /{memory_space_id}/`

Delete a Memory Space

Returns 404 if already deleted or not accessible by the caller.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| memory_space_id | path | string | true | Memory Space ID |

### Example responses

> 422 Response

```
{
  "properties": {
    "detail": {
      "description": "List of validation errors.",
      "items": {
        "properties": {
          "ctx": {
            "description": "Additional context about the validation error.",
            "title": "Context",
            "type": "object"
          },
          "input": {
            "additionalProperties": true,
            "description": "The input value that caused the validation error.",
            "title": "Input",
            "type": "object"
          },
          "loc": {
            "description": "The location in the request where the validation error occurred.",
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "maxItems": 100,
            "title": "Location",
            "type": "array"
          },
          "msg": {
            "description": "A human-readable description of the validation error.",
            "title": "Message",
            "type": "string"
          },
          "type": {
            "description": "A machine-readable error type identifier.",
            "title": "Error Type",
            "type": "string"
          }
        },
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError",
        "type": "object"
      },
      "maxItems": 100,
      "title": "Detail",
      "type": "array"
    }
  },
  "title": "HTTPValidationError",
  "type": "object"
}
```

### Responses

| Status | Meaning | Description | Schema |
| --- | --- | --- | --- |
| 204 | No Content | Successful Response | None |
| 404 | Not Found | Memory Space not found | None |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |

## Get memory space by memory_space_ ID

Operation path: `GET /{memory_space_id}/`

Get a Memory Space by ID

Returns 404 if the space does not exist, is soft-deleted, or not accessible by a user.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| memory_space_id | path | string | true | Memory Space ID |

### Example responses

> 200 Response

```
{
  "description": "Response schema for a single memory space.",
  "properties": {
    "createdAt": {
      "description": "Memory space creation timestamp.",
      "format": "date-time",
      "title": "Createdat",
      "type": "string"
    },
    "customInstructions": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Custom prompt instructions used for fact extraction. null means the default mem0 extraction prompt is used.",
      "title": "Custominstructions"
    },
    "deduplicationKey": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Deduplication key, unique per user, if one was set.",
      "title": "Deduplicationkey"
    },
    "description": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Memory space description.",
      "title": "Description"
    },
    "llmBaseUrl": {
      "anyOf": [
        {
          "format": "uri",
          "maxLength": 2083,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Chat API url to use for memory extraction.",
      "title": "Llmbaseurl"
    },
    "llmModelName": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "LLM model configured for memory extraction.",
      "title": "Llmmodelname"
    },
    "memorySpaceId": {
      "description": "Unique memory space identifier.",
      "format": "uuid",
      "title": "Memoryspaceid",
      "type": "string"
    },
    "tenantId": {
      "description": "Tenant identifier.",
      "format": "uuid",
      "title": "Tenantid",
      "type": "string"
    },
    "userId": {
      "description": "ID of the user who owns this memory space.",
      "title": "Userid",
      "type": "string"
    }
  },
  "required": [
    "memorySpaceId",
    "userId",
    "tenantId",
    "createdAt"
  ],
  "title": "MemorySpaceResponse",
  "type": "object"
}
```

### Responses

| Status | Meaning | Description | Schema |
| --- | --- | --- | --- |
| 200 | OK | Successful Response | MemorySpaceResponse |
| 404 | Not Found | Memory Space not found | None |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
| 429 | Too Many Requests | Trial usage limit reached: the tenant's monthly read/write request quota or its total storage cap is exhausted. Carries X-RateLimit-* headers; quota (not storage) responses also carry Retry-After. | None |

### Response Headers

| Status | Header | Type | Format | Description |
| --- | --- | --- | --- | --- |
| 429 | Retry-After | integer |  | Seconds until the monthly quota resets. Quota responses only. |
| 429 | X-RateLimit-Limit | integer |  | The applicable limit (monthly request quota, or storage cap). |
| 429 | X-RateLimit-Remaining | integer |  | Units remaining before the limit is reached. |
| 429 | X-RateLimit-Reset | integer |  | Epoch seconds at which the quota resets. Quota responses only. |

## Update memory space by memory_space_ ID

Operation path: `PATCH /{memory_space_id}/`

Partially update a Memory Space.

### Body parameter

```
{
  "additionalProperties": false,
  "description": "Request body for partially updating a memory space.",
  "properties": {
    "customInstructions": {
      "anyOf": [
        {
          "maxLength": 10000,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Updated custom prompt instructions used for fact extraction. pass null to clear and revert to mem0's default extraction prompt.",
      "title": "Custominstructions"
    },
    "description": {
      "anyOf": [
        {
          "maxLength": 1000,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Updated description for the memory space.",
      "title": "Description"
    },
    "llmBaseUrl": {
      "anyOf": [
        {
          "format": "uri",
          "maxLength": 2083,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Chat API url to use for memory extraction.",
      "title": "Llmbaseurl"
    },
    "llmModelName": {
      "anyOf": [
        {
          "maxLength": 200,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Updated LLM model name. non-reasoning models such as ``gpt-4o`` are recommended. reasoning-capable models are significantly slower for fact extraction without producing meaningfully better results.",
      "title": "Llmmodelname"
    }
  },
  "title": "UpdateMemorySpaceRequest",
  "type": "object"
}
```

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| memory_space_id | path | string | true | Memory Space ID |
| body | body | UpdateMemorySpaceRequest | true | none |

### Example responses

> 200 Response

```
{
  "description": "Response schema for a single memory space.",
  "properties": {
    "createdAt": {
      "description": "Memory space creation timestamp.",
      "format": "date-time",
      "title": "Createdat",
      "type": "string"
    },
    "customInstructions": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Custom prompt instructions used for fact extraction. null means the default mem0 extraction prompt is used.",
      "title": "Custominstructions"
    },
    "deduplicationKey": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Deduplication key, unique per user, if one was set.",
      "title": "Deduplicationkey"
    },
    "description": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Memory space description.",
      "title": "Description"
    },
    "llmBaseUrl": {
      "anyOf": [
        {
          "format": "uri",
          "maxLength": 2083,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Chat API url to use for memory extraction.",
      "title": "Llmbaseurl"
    },
    "llmModelName": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "LLM model configured for memory extraction.",
      "title": "Llmmodelname"
    },
    "memorySpaceId": {
      "description": "Unique memory space identifier.",
      "format": "uuid",
      "title": "Memoryspaceid",
      "type": "string"
    },
    "tenantId": {
      "description": "Tenant identifier.",
      "format": "uuid",
      "title": "Tenantid",
      "type": "string"
    },
    "userId": {
      "description": "ID of the user who owns this memory space.",
      "title": "Userid",
      "type": "string"
    }
  },
  "required": [
    "memorySpaceId",
    "userId",
    "tenantId",
    "createdAt"
  ],
  "title": "MemorySpaceResponse",
  "type": "object"
}
```

### Responses

| Status | Meaning | Description | Schema |
| --- | --- | --- | --- |
| 200 | OK | Successful Response | MemorySpaceResponse |
| 404 | Not Found | Memory Space not found | None |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
| 429 | Too Many Requests | Trial usage limit reached: the tenant's monthly read/write request quota or its total storage cap is exhausted. Carries X-RateLimit-* headers; quota (not storage) responses also carry Retry-After. | None |

### Response Headers

| Status | Header | Type | Format | Description |
| --- | --- | --- | --- | --- |
| 429 | Retry-After | integer |  | Seconds until the monthly quota resets. Quota responses only. |
| 429 | X-RateLimit-Limit | integer |  | The applicable limit (monthly request quota, or storage cap). |
| 429 | X-RateLimit-Remaining | integer |  | Units remaining before the limit is reached. |
| 429 | X-RateLimit-Reset | integer |  | Epoch seconds at which the quota resets. Quota responses only. |

## List sessions by memory_space_ ID

Operation path: `GET /{memory_space_id}/sessions/`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| memory_space_id | path | string | true | Memory Space ID |
| offset | query | integer | false | Skip the specified number of values. |
| limit | query | integer | false | Retrieve only the specified number of values. |
| participants | query | any | false | Filter sessions by participant IDs (ObjectId format). |
| description | query | any | false | Filter sessions by description (case-insensitive substring match). Must be at least 3 characters. |
| deduplicationKey | query | any | false | Filter sessions by deduplication key (exact match). |

### Example responses

> 200 Response

```
{
  "properties": {
    "items": {
      "description": "List of items for the current page.",
      "items": {
        "description": "Schema for session response.",
        "properties": {
          "createdAt": {
            "description": "Session creation timestamp.",
            "format": "date-time",
            "title": "Createdat",
            "type": "string"
          },
          "deduplicationKey": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Deduplication key, unique within the memory space, if one was set.",
            "title": "Deduplicationkey"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Session description.",
            "title": "Description"
          },
          "id": {
            "description": "Session id.",
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "lifecycleStrategies": {
            "description": "Lifecycle strategies associated with this session.",
            "items": {
              "description": "Schema for lifecycle strategy in response. execution status is tracked in the strategy_executions table and can be queried separately if needed.",
              "properties": {
                "opts": {
                  "anyOf": [
                    {
                      "additionalProperties": true,
                      "type": "object"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Strategy-specific configuration parameters.",
                  "title": "Opts"
                },
                "trigger": {
                  "anyOf": [
                    {
                      "additionalProperties": false,
                      "description": "Trigger based on time-to-live (session age). fires when the session age exceeds the configured ttl threshold.",
                      "properties": {
                        "ttl": {
                          "description": "Time-to-live in seconds.",
                          "exclusiveMinimum": 0,
                          "maximum": 63072000,
                          "title": "Ttl",
                          "type": "integer"
                        }
                      },
                      "required": [
                        "ttl"
                      ],
                      "title": "TTLTrigger",
                      "type": "object"
                    },
                    {
                      "additionalProperties": false,
                      "description": "Trigger based on event count. fires when the session's event count reaches or exceeds the configured threshold.",
                      "properties": {
                        "eventCount": {
                          "description": "Event count threshold.",
                          "exclusiveMinimum": 0,
                          "maximum": 1000000,
                          "title": "Eventcount",
                          "type": "integer"
                        }
                      },
                      "required": [
                        "eventCount"
                      ],
                      "title": "EventCountTrigger",
                      "type": "object"
                    },
                    {
                      "additionalProperties": false,
                      "description": "Trigger based on token count. fires when the session's total token count reaches or exceeds the configured threshold. tokens are calculated from event message content using tiktoken.",
                      "properties": {
                        "tokenCount": {
                          "description": "Token count threshold.",
                          "exclusiveMinimum": 0,
                          "maximum": 100000000,
                          "title": "Tokencount",
                          "type": "integer"
                        }
                      },
                      "required": [
                        "tokenCount"
                      ],
                      "title": "TokenCountTrigger",
                      "type": "object"
                    },
                    {
                      "additionalProperties": false,
                      "description": "Trigger based on time since the last event in the session. fires when no new events were added to the session within the configured ttl.",
                      "properties": {
                        "idle": {
                          "description": "Time in seconds since last event.",
                          "exclusiveMinimum": 0,
                          "maximum": 63072000,
                          "title": "Idle",
                          "type": "integer"
                        }
                      },
                      "required": [
                        "idle"
                      ],
                      "title": "IdleTimeoutTrigger",
                      "type": "object"
                    }
                  ],
                  "description": "Trigger condition.",
                  "title": "Trigger"
                },
                "type": {
                  "description": "Strategy type.",
                  "enum": [
                    "soft_delete",
                    "extract_memories"
                  ],
                  "title": "Type",
                  "type": "string"
                }
              },
              "required": [
                "type",
                "trigger"
              ],
              "title": "LifecycleStrategyResponse",
              "type": "object"
            },
            "maxItems": 5,
            "title": "Lifecyclestrategies",
            "type": "array"
          },
          "metadata": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Custom metadata as key-value pairs for storing application-specific data.",
            "title": "Metadata"
          },
          "participants": {
            "description": "List of participant ids.",
            "items": {
              "type": "string"
            },
            "maxItems": 50,
            "title": "Participants",
            "type": "array"
          },
          "version": {
            "default": 1,
            "description": "Monotonic version for optimistic concurrency. echo back as `if-match: \"<version>\"` on patch to detect lost updates.",
            "minimum": 1,
            "title": "Version",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "participants",
          "createdAt"
        ],
        "title": "SessionResponse",
        "type": "object"
      },
      "maxItems": 100,
      "title": "Items",
      "type": "array"
    },
    "limit": {
      "description": "Maximum number of returned items.",
      "exclusiveMinimum": 0,
      "title": "Limit",
      "type": "integer"
    },
    "offset": {
      "description": "Number of skipped items.",
      "minimum": 0,
      "title": "Offset",
      "type": "integer"
    },
    "total": {
      "description": "Total number of matching items.",
      "title": "Total",
      "type": "integer"
    }
  },
  "required": [
    "items",
    "offset",
    "limit",
    "total"
  ],
  "title": "PaginatedResponse[SessionResponse]",
  "type": "object"
}
```

### Responses

| Status | Meaning | Description | Schema |
| --- | --- | --- | --- |
| 200 | OK | Successful Response | PaginatedResponse_SessionResponse_ |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
| 429 | Too Many Requests | Trial usage limit reached: the tenant's monthly read/write request quota or its total storage cap is exhausted. Carries X-RateLimit-* headers; quota (not storage) responses also carry Retry-After. | None |

### Response Headers

| Status | Header | Type | Format | Description |
| --- | --- | --- | --- | --- |
| 429 | Retry-After | integer |  | Seconds until the monthly quota resets. Quota responses only. |
| 429 | X-RateLimit-Limit | integer |  | The applicable limit (monthly request quota, or storage cap). |
| 429 | X-RateLimit-Remaining | integer |  | Units remaining before the limit is reached. |
| 429 | X-RateLimit-Reset | integer |  | Epoch seconds at which the quota resets. Quota responses only. |

## Create session by memory_space_ ID

Operation path: `POST /{memory_space_id}/sessions/`

### Body parameter

```
{
  "description": "Customer support conversation",
  "lifecycleStrategies": [
    {
      "trigger": {
        "ttl": 604800
      },
      "type": "soft_delete"
    }
  ],
  "metadata": {
    "department": "sales",
    "priority": "high",
    "region": "us-east"
  },
  "participants": [
    "507f1f77bcf86cd799439011"
  ]
}
```

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| memory_space_id | path | string | true | Memory Space ID |
| body | body | CreateSessionRequest | true | none |

### Example responses

> 201 Response

```
{
  "description": "Schema for session response.",
  "properties": {
    "createdAt": {
      "description": "Session creation timestamp.",
      "format": "date-time",
      "title": "Createdat",
      "type": "string"
    },
    "deduplicationKey": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Deduplication key, unique within the memory space, if one was set.",
      "title": "Deduplicationkey"
    },
    "description": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Session description.",
      "title": "Description"
    },
    "id": {
      "description": "Session id.",
      "format": "uuid",
      "title": "Id",
      "type": "string"
    },
    "lifecycleStrategies": {
      "description": "Lifecycle strategies associated with this session.",
      "items": {
        "description": "Schema for lifecycle strategy in response. execution status is tracked in the strategy_executions table and can be queried separately if needed.",
        "properties": {
          "opts": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Strategy-specific configuration parameters.",
            "title": "Opts"
          },
          "trigger": {
            "anyOf": [
              {
                "additionalProperties": false,
                "description": "Trigger based on time-to-live (session age). fires when the session age exceeds the configured ttl threshold.",
                "properties": {
                  "ttl": {
                    "description": "Time-to-live in seconds.",
                    "exclusiveMinimum": 0,
                    "maximum": 63072000,
                    "title": "Ttl",
                    "type": "integer"
                  }
                },
                "required": [
                  "ttl"
                ],
                "title": "TTLTrigger",
                "type": "object"
              },
              {
                "additionalProperties": false,
                "description": "Trigger based on event count. fires when the session's event count reaches or exceeds the configured threshold.",
                "properties": {
                  "eventCount": {
                    "description": "Event count threshold.",
                    "exclusiveMinimum": 0,
                    "maximum": 1000000,
                    "title": "Eventcount",
                    "type": "integer"
                  }
                },
                "required": [
                  "eventCount"
                ],
                "title": "EventCountTrigger",
                "type": "object"
              },
              {
                "additionalProperties": false,
                "description": "Trigger based on token count. fires when the session's total token count reaches or exceeds the configured threshold. tokens are calculated from event message content using tiktoken.",
                "properties": {
                  "tokenCount": {
                    "description": "Token count threshold.",
                    "exclusiveMinimum": 0,
                    "maximum": 100000000,
                    "title": "Tokencount",
                    "type": "integer"
                  }
                },
                "required": [
                  "tokenCount"
                ],
                "title": "TokenCountTrigger",
                "type": "object"
              },
              {
                "additionalProperties": false,
                "description": "Trigger based on time since the last event in the session. fires when no new events were added to the session within the configured ttl.",
                "properties": {
                  "idle": {
                    "description": "Time in seconds since last event.",
                    "exclusiveMinimum": 0,
                    "maximum": 63072000,
                    "title": "Idle",
                    "type": "integer"
                  }
                },
                "required": [
                  "idle"
                ],
                "title": "IdleTimeoutTrigger",
                "type": "object"
              }
            ],
            "description": "Trigger condition.",
            "title": "Trigger"
          },
          "type": {
            "description": "Strategy type.",
            "enum": [
              "soft_delete",
              "extract_memories"
            ],
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "type",
          "trigger"
        ],
        "title": "LifecycleStrategyResponse",
        "type": "object"
      },
      "maxItems": 5,
      "title": "Lifecyclestrategies",
      "type": "array"
    },
    "metadata": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "description": "Custom metadata as key-value pairs for storing application-specific data.",
      "title": "Metadata"
    },
    "participants": {
      "description": "List of participant ids.",
      "items": {
        "type": "string"
      },
      "maxItems": 50,
      "title": "Participants",
      "type": "array"
    },
    "version": {
      "default": 1,
      "description": "Monotonic version for optimistic concurrency. echo back as `if-match: \"<version>\"` on patch to detect lost updates.",
      "minimum": 1,
      "title": "Version",
      "type": "integer"
    }
  },
  "required": [
    "id",
    "participants",
    "createdAt"
  ],
  "title": "SessionResponse",
  "type": "object"
}
```

### Responses

| Status | Meaning | Description | Schema |
| --- | --- | --- | --- |
| 201 | Created | Successful Response | SessionResponse |
| 409 | Conflict | A session with this deduplicationKey already exists in the memory space. Body carries existingSessionId / existingSessionUrl when the live winner can be resolved; the response also sets a Location header to its absolute URL. | SessionDeduplicationErrorResponse |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
| 429 | Too Many Requests | Trial usage limit reached: the tenant's monthly read/write request quota or its total storage cap is exhausted. Carries X-RateLimit-* headers; quota (not storage) responses also carry Retry-After. | None |

### Response Headers

| Status | Header | Type | Format | Description |
| --- | --- | --- | --- | --- |
| 429 | Retry-After | integer |  | Seconds until the monthly quota resets. Quota responses only. |
| 429 | X-RateLimit-Limit | integer |  | The applicable limit (monthly request quota, or storage cap). |
| 429 | X-RateLimit-Remaining | integer |  | Units remaining before the limit is reached. |
| 429 | X-RateLimit-Reset | integer |  | Epoch seconds at which the quota resets. Quota responses only. |

## Delete session by memory_space_ ID

Operation path: `DELETE /{memory_space_id}/sessions/{session_id}/`

Delete a session.

Performs a soft-delete by setting the deleted_at timestamp.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| session_id | path | string(uuid) | true | Session ID |
| memory_space_id | path | string | true | Memory Space ID |

### Example responses

> 422 Response

```
{
  "properties": {
    "detail": {
      "description": "List of validation errors.",
      "items": {
        "properties": {
          "ctx": {
            "description": "Additional context about the validation error.",
            "title": "Context",
            "type": "object"
          },
          "input": {
            "additionalProperties": true,
            "description": "The input value that caused the validation error.",
            "title": "Input",
            "type": "object"
          },
          "loc": {
            "description": "The location in the request where the validation error occurred.",
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "maxItems": 100,
            "title": "Location",
            "type": "array"
          },
          "msg": {
            "description": "A human-readable description of the validation error.",
            "title": "Message",
            "type": "string"
          },
          "type": {
            "description": "A machine-readable error type identifier.",
            "title": "Error Type",
            "type": "string"
          }
        },
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError",
        "type": "object"
      },
      "maxItems": 100,
      "title": "Detail",
      "type": "array"
    }
  },
  "title": "HTTPValidationError",
  "type": "object"
}
```

### Responses

| Status | Meaning | Description | Schema |
| --- | --- | --- | --- |
| 204 | No Content | Successful Response | None |
| 404 | Not Found | Session not found | None |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |

## Get session by memory_space_ ID

Operation path: `GET /{memory_space_id}/sessions/{session_id}/`

Get a single session by ID.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| session_id | path | string(uuid) | true | Session ID |
| memory_space_id | path | string | true | Memory Space ID |

### Example responses

> 200 Response

```
{
  "description": "Schema for session response.",
  "properties": {
    "createdAt": {
      "description": "Session creation timestamp.",
      "format": "date-time",
      "title": "Createdat",
      "type": "string"
    },
    "deduplicationKey": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Deduplication key, unique within the memory space, if one was set.",
      "title": "Deduplicationkey"
    },
    "description": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Session description.",
      "title": "Description"
    },
    "id": {
      "description": "Session id.",
      "format": "uuid",
      "title": "Id",
      "type": "string"
    },
    "lifecycleStrategies": {
      "description": "Lifecycle strategies associated with this session.",
      "items": {
        "description": "Schema for lifecycle strategy in response. execution status is tracked in the strategy_executions table and can be queried separately if needed.",
        "properties": {
          "opts": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Strategy-specific configuration parameters.",
            "title": "Opts"
          },
          "trigger": {
            "anyOf": [
              {
                "additionalProperties": false,
                "description": "Trigger based on time-to-live (session age). fires when the session age exceeds the configured ttl threshold.",
                "properties": {
                  "ttl": {
                    "description": "Time-to-live in seconds.",
                    "exclusiveMinimum": 0,
                    "maximum": 63072000,
                    "title": "Ttl",
                    "type": "integer"
                  }
                },
                "required": [
                  "ttl"
                ],
                "title": "TTLTrigger",
                "type": "object"
              },
              {
                "additionalProperties": false,
                "description": "Trigger based on event count. fires when the session's event count reaches or exceeds the configured threshold.",
                "properties": {
                  "eventCount": {
                    "description": "Event count threshold.",
                    "exclusiveMinimum": 0,
                    "maximum": 1000000,
                    "title": "Eventcount",
                    "type": "integer"
                  }
                },
                "required": [
                  "eventCount"
                ],
                "title": "EventCountTrigger",
                "type": "object"
              },
              {
                "additionalProperties": false,
                "description": "Trigger based on token count. fires when the session's total token count reaches or exceeds the configured threshold. tokens are calculated from event message content using tiktoken.",
                "properties": {
                  "tokenCount": {
                    "description": "Token count threshold.",
                    "exclusiveMinimum": 0,
                    "maximum": 100000000,
                    "title": "Tokencount",
                    "type": "integer"
                  }
                },
                "required": [
                  "tokenCount"
                ],
                "title": "TokenCountTrigger",
                "type": "object"
              },
              {
                "additionalProperties": false,
                "description": "Trigger based on time since the last event in the session. fires when no new events were added to the session within the configured ttl.",
                "properties": {
                  "idle": {
                    "description": "Time in seconds since last event.",
                    "exclusiveMinimum": 0,
                    "maximum": 63072000,
                    "title": "Idle",
                    "type": "integer"
                  }
                },
                "required": [
                  "idle"
                ],
                "title": "IdleTimeoutTrigger",
                "type": "object"
              }
            ],
            "description": "Trigger condition.",
            "title": "Trigger"
          },
          "type": {
            "description": "Strategy type.",
            "enum": [
              "soft_delete",
              "extract_memories"
            ],
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "type",
          "trigger"
        ],
        "title": "LifecycleStrategyResponse",
        "type": "object"
      },
      "maxItems": 5,
      "title": "Lifecyclestrategies",
      "type": "array"
    },
    "metadata": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "description": "Custom metadata as key-value pairs for storing application-specific data.",
      "title": "Metadata"
    },
    "participants": {
      "description": "List of participant ids.",
      "items": {
        "type": "string"
      },
      "maxItems": 50,
      "title": "Participants",
      "type": "array"
    },
    "version": {
      "default": 1,
      "description": "Monotonic version for optimistic concurrency. echo back as `if-match: \"<version>\"` on patch to detect lost updates.",
      "minimum": 1,
      "title": "Version",
      "type": "integer"
    }
  },
  "required": [
    "id",
    "participants",
    "createdAt"
  ],
  "title": "SessionResponse",
  "type": "object"
}
```

### Responses

| Status | Meaning | Description | Schema |
| --- | --- | --- | --- |
| 200 | OK | Successful Response | SessionResponse |
| 404 | Not Found | Session not found | None |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
| 429 | Too Many Requests | Trial usage limit reached: the tenant's monthly read/write request quota or its total storage cap is exhausted. Carries X-RateLimit-* headers; quota (not storage) responses also carry Retry-After. | None |

### Response Headers

| Status | Header | Type | Format | Description |
| --- | --- | --- | --- | --- |
| 429 | Retry-After | integer |  | Seconds until the monthly quota resets. Quota responses only. |
| 429 | X-RateLimit-Limit | integer |  | The applicable limit (monthly request quota, or storage cap). |
| 429 | X-RateLimit-Remaining | integer |  | Units remaining before the limit is reached. |
| 429 | X-RateLimit-Reset | integer |  | Epoch seconds at which the quota resets. Quota responses only. |

## Update session by memory_space_ ID

Operation path: `PATCH /{memory_space_id}/sessions/{session_id}/`

Patch a session with new description and/or metadata.

Only fields explicitly included in the request body are modified others remain untouched.

### Body parameter

```
{
  "description": "Schema for session partial patch-updates.",
  "properties": {
    "description": {
      "anyOf": [
        {
          "maxLength": 1000,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "New session description.",
      "title": "Description"
    },
    "metadata": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "description": "Custom metadata as key-value pairs for storing application-specific data.",
      "title": "Metadata"
    }
  },
  "title": "UpdateSessionRequest",
  "type": "object"
}
```

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| session_id | path | string(uuid) | true | Session ID |
| memory_space_id | path | string | true | Memory Space ID |
| If-Match | header | any | false | Optional optimistic-concurrency precondition. Supply the version from the prior response (quoted or bare integer, e.g. "3" or 3). Returns 409 if the stored version no longer matches. |
| body | body | UpdateSessionRequest | true | none |

### Example responses

> 200 Response

```
{
  "description": "Schema for session response.",
  "properties": {
    "createdAt": {
      "description": "Session creation timestamp.",
      "format": "date-time",
      "title": "Createdat",
      "type": "string"
    },
    "deduplicationKey": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Deduplication key, unique within the memory space, if one was set.",
      "title": "Deduplicationkey"
    },
    "description": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Session description.",
      "title": "Description"
    },
    "id": {
      "description": "Session id.",
      "format": "uuid",
      "title": "Id",
      "type": "string"
    },
    "lifecycleStrategies": {
      "description": "Lifecycle strategies associated with this session.",
      "items": {
        "description": "Schema for lifecycle strategy in response. execution status is tracked in the strategy_executions table and can be queried separately if needed.",
        "properties": {
          "opts": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Strategy-specific configuration parameters.",
            "title": "Opts"
          },
          "trigger": {
            "anyOf": [
              {
                "additionalProperties": false,
                "description": "Trigger based on time-to-live (session age). fires when the session age exceeds the configured ttl threshold.",
                "properties": {
                  "ttl": {
                    "description": "Time-to-live in seconds.",
                    "exclusiveMinimum": 0,
                    "maximum": 63072000,
                    "title": "Ttl",
                    "type": "integer"
                  }
                },
                "required": [
                  "ttl"
                ],
                "title": "TTLTrigger",
                "type": "object"
              },
              {
                "additionalProperties": false,
                "description": "Trigger based on event count. fires when the session's event count reaches or exceeds the configured threshold.",
                "properties": {
                  "eventCount": {
                    "description": "Event count threshold.",
                    "exclusiveMinimum": 0,
                    "maximum": 1000000,
                    "title": "Eventcount",
                    "type": "integer"
                  }
                },
                "required": [
                  "eventCount"
                ],
                "title": "EventCountTrigger",
                "type": "object"
              },
              {
                "additionalProperties": false,
                "description": "Trigger based on token count. fires when the session's total token count reaches or exceeds the configured threshold. tokens are calculated from event message content using tiktoken.",
                "properties": {
                  "tokenCount": {
                    "description": "Token count threshold.",
                    "exclusiveMinimum": 0,
                    "maximum": 100000000,
                    "title": "Tokencount",
                    "type": "integer"
                  }
                },
                "required": [
                  "tokenCount"
                ],
                "title": "TokenCountTrigger",
                "type": "object"
              },
              {
                "additionalProperties": false,
                "description": "Trigger based on time since the last event in the session. fires when no new events were added to the session within the configured ttl.",
                "properties": {
                  "idle": {
                    "description": "Time in seconds since last event.",
                    "exclusiveMinimum": 0,
                    "maximum": 63072000,
                    "title": "Idle",
                    "type": "integer"
                  }
                },
                "required": [
                  "idle"
                ],
                "title": "IdleTimeoutTrigger",
                "type": "object"
              }
            ],
            "description": "Trigger condition.",
            "title": "Trigger"
          },
          "type": {
            "description": "Strategy type.",
            "enum": [
              "soft_delete",
              "extract_memories"
            ],
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "type",
          "trigger"
        ],
        "title": "LifecycleStrategyResponse",
        "type": "object"
      },
      "maxItems": 5,
      "title": "Lifecyclestrategies",
      "type": "array"
    },
    "metadata": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "description": "Custom metadata as key-value pairs for storing application-specific data.",
      "title": "Metadata"
    },
    "participants": {
      "description": "List of participant ids.",
      "items": {
        "type": "string"
      },
      "maxItems": 50,
      "title": "Participants",
      "type": "array"
    },
    "version": {
      "default": 1,
      "description": "Monotonic version for optimistic concurrency. echo back as `if-match: \"<version>\"` on patch to detect lost updates.",
      "minimum": 1,
      "title": "Version",
      "type": "integer"
    }
  },
  "required": [
    "id",
    "participants",
    "createdAt"
  ],
  "title": "SessionResponse",
  "type": "object"
}
```

### Responses

| Status | Meaning | Description | Schema |
| --- | --- | --- | --- |
| 200 | OK | Successful Response | SessionResponse |
| 404 | Not Found | Session not found | None |
| 409 | Conflict | Session version does not match If-Match precondition | None |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
| 429 | Too Many Requests | Trial usage limit reached: the tenant's monthly read/write request quota or its total storage cap is exhausted. Carries X-RateLimit-* headers; quota (not storage) responses also carry Retry-After. | None |

### Response Headers

| Status | Header | Type | Format | Description |
| --- | --- | --- | --- | --- |
| 429 | Retry-After | integer |  | Seconds until the monthly quota resets. Quota responses only. |
| 429 | X-RateLimit-Limit | integer |  | The applicable limit (monthly request quota, or storage cap). |
| 429 | X-RateLimit-Remaining | integer |  | Units remaining before the limit is reached. |
| 429 | X-RateLimit-Reset | integer |  | Epoch seconds at which the quota resets. Quota responses only. |

## List events by memory_space_ ID

Operation path: `GET /{memory_space_id}/sessions/{session_id}/events/`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| session_id | path | string(uuid) | true | Session ID |
| memory_space_id | path | string | true | Memory Space ID |
| offset | query | integer | false | Skip the specified number of values. |
| limit | query | integer | false | Retrieve only the specified number of values. |
| lastN | query | any | false | Return the last N events in chronological order. Mutually exclusive with offset |
| eventType | query | any | false | Filter session events by type. Omit to return events of all types. |

### Example responses

> 200 Response

```
{
  "properties": {
    "items": {
      "description": "List of items for the current page.",
      "items": {
        "description": "Schema for event response.",
        "properties": {
          "body": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Event body content.",
            "title": "Body"
          },
          "createdAt": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Event creation timestamp.",
            "title": "Createdat"
          },
          "emitterId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Emitter identifier.",
            "title": "Emitterid"
          },
          "emitterType": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Emitter type.",
            "title": "Emittertype"
          },
          "eventType": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Event type.",
            "title": "Eventtype"
          },
          "sequenceId": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Event sequence number within the session.",
            "title": "Sequenceid"
          }
        },
        "title": "EventResponse",
        "type": "object"
      },
      "maxItems": 100,
      "title": "Items",
      "type": "array"
    },
    "limit": {
      "description": "Maximum number of returned items.",
      "exclusiveMinimum": 0,
      "title": "Limit",
      "type": "integer"
    },
    "offset": {
      "description": "Number of skipped items.",
      "minimum": 0,
      "title": "Offset",
      "type": "integer"
    },
    "total": {
      "description": "Total number of matching items.",
      "title": "Total",
      "type": "integer"
    }
  },
  "required": [
    "items",
    "offset",
    "limit",
    "total"
  ],
  "title": "PaginatedResponse[EventResponse]",
  "type": "object"
}
```

### Responses

| Status | Meaning | Description | Schema |
| --- | --- | --- | --- |
| 200 | OK | Successful Response | PaginatedResponse_EventResponse_ |
| 404 | Not Found | Session not found | None |
| 422 | Unprocessable Entity | Validation error (e.g. lastN used together with offset) | None |
| 429 | Too Many Requests | Trial usage limit reached: the tenant's monthly read/write request quota or its total storage cap is exhausted. Carries X-RateLimit-* headers; quota (not storage) responses also carry Retry-After. | None |

### Response Headers

| Status | Header | Type | Format | Description |
| --- | --- | --- | --- | --- |
| 429 | Retry-After | integer |  | Seconds until the monthly quota resets. Quota responses only. |
| 429 | X-RateLimit-Limit | integer |  | The applicable limit (monthly request quota, or storage cap). |
| 429 | X-RateLimit-Remaining | integer |  | Units remaining before the limit is reached. |
| 429 | X-RateLimit-Reset | integer |  | Epoch seconds at which the quota resets. Quota responses only. |

## Create event by memory_space_ ID

Operation path: `POST /{memory_space_id}/sessions/{session_id}/events/`

### Body parameter

```
{
  "description": "Schema for create event request.",
  "properties": {
    "body": {
      "additionalProperties": true,
      "description": "Body for all event types. content field is mandatory, any additional fields are allowed.",
      "properties": {
        "content": {
          "description": "Event body content text.",
          "maxLength": 100000,
          "minLength": 1,
          "title": "Content",
          "type": "string"
        }
      },
      "required": [
        "content"
      ],
      "title": "EventBody",
      "type": "object"
    },
    "emitter": {
      "description": "Schema for emitter data.",
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Emitter identifier (objectid format).",
          "title": "Id"
        },
        "type": {
          "description": "Emitter type. one of: 'user', 'agent'.",
          "enum": [
            "user",
            "agent"
          ],
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "type"
      ],
      "title": "EmitterDataModel",
      "type": "object"
    },
    "type": {
      "enum": [
        "message",
        "tool_output",
        "status"
      ],
      "title": "EventType",
      "type": "string"
    }
  },
  "required": [
    "body",
    "emitter"
  ],
  "title": "CreateEventRequest",
  "type": "object"
}
```

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| session_id | path | string(uuid) | true | Session ID |
| memory_space_id | path | string | true | Memory Space ID |
| body | body | CreateEventRequest | true | none |

### Example responses

> 201 Response

```
{
  "description": "Schema for event response.",
  "properties": {
    "body": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "description": "Event body content.",
      "title": "Body"
    },
    "createdAt": {
      "anyOf": [
        {
          "format": "date-time",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Event creation timestamp.",
      "title": "Createdat"
    },
    "emitterId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Emitter identifier.",
      "title": "Emitterid"
    },
    "emitterType": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Emitter type.",
      "title": "Emittertype"
    },
    "eventType": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Event type.",
      "title": "Eventtype"
    },
    "sequenceId": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "description": "Event sequence number within the session.",
      "title": "Sequenceid"
    }
  },
  "title": "EventResponse",
  "type": "object"
}
```

### Responses

| Status | Meaning | Description | Schema |
| --- | --- | --- | --- |
| 201 | Created | Successful Response | EventResponse |
| 404 | Not Found | Session not found | None |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
| 429 | Too Many Requests | Trial usage limit reached: the tenant's monthly read/write request quota or its total storage cap is exhausted. Carries X-RateLimit-* headers; quota (not storage) responses also carry Retry-After. | None |

### Response Headers

| Status | Header | Type | Format | Description |
| --- | --- | --- | --- | --- |
| 429 | Retry-After | integer |  | Seconds until the monthly quota resets. Quota responses only. |
| 429 | X-RateLimit-Limit | integer |  | The applicable limit (monthly request quota, or storage cap). |
| 429 | X-RateLimit-Remaining | integer |  | Units remaining before the limit is reached. |
| 429 | X-RateLimit-Reset | integer |  | Epoch seconds at which the quota resets. Quota responses only. |

## Update events batch by memory_space_ ID

Operation path: `PATCH /{memory_space_id}/sessions/{session_id}/events/batch/`

Update up to MAX_BATCH_SIZE events atomically; any failure rolls back the batch.

### Body parameter

```
{
  "description": "Schema for batch event update.",
  "properties": {
    "events": {
      "description": "Events to update.",
      "items": {
        "description": "A single item of a batch update: identifies the target event by sequence_id. inherits the mutable body/type/emitter fields from updateeventrequest. the inherited \"at least one field present\" validator is overridden below because the always-present sequence_id would otherwise satisfy it vacuously.",
        "properties": {
          "body": {
            "anyOf": [
              {
                "additionalProperties": true,
                "description": "Body for all event types. content field is mandatory, any additional fields are allowed.",
                "properties": {
                  "content": {
                    "description": "Event body content text.",
                    "maxLength": 100000,
                    "minLength": 1,
                    "title": "Content",
                    "type": "string"
                  }
                },
                "required": [
                  "content"
                ],
                "title": "EventBody",
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Updated event body."
          },
          "createdAt": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional per-item version check: must match the target event's timestamp.",
            "title": "Createdat"
          },
          "emitter": {
            "anyOf": [
              {
                "description": "Schema for emitter data.",
                "properties": {
                  "id": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Emitter identifier (objectid format).",
                    "title": "Id"
                  },
                  "type": {
                    "description": "Emitter type. one of: 'user', 'agent'.",
                    "enum": [
                      "user",
                      "agent"
                    ],
                    "title": "Type",
                    "type": "string"
                  }
                },
                "required": [
                  "type"
                ],
                "title": "EmitterDataModel",
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Updated emitter information."
          },
          "sequenceId": {
            "description": "Target event sequence ID within the session.",
            "minimum": 0,
            "title": "Sequenceid",
            "type": "integer"
          },
          "type": {
            "anyOf": [
              {
                "enum": [
                  "message",
                  "tool_output",
                  "status"
                ],
                "title": "EventType",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Updated event type."
          }
        },
        "required": [
          "sequenceId"
        ],
        "title": "BatchUpdateEventItem",
        "type": "object"
      },
      "maxItems": 200,
      "minItems": 1,
      "title": "Events",
      "type": "array"
    }
  },
  "required": [
    "events"
  ],
  "title": "BatchUpdateEventRequest",
  "type": "object"
}
```

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| session_id | path | string(uuid) | true | Session ID |
| memory_space_id | path | string | true | Memory Space ID |
| body | body | BatchUpdateEventRequest | true | none |

### Example responses

> 200 Response

```
{
  "description": "Envelope wrapping a list of event responses for batch endpoints. per the datarobot API design policy enforced by adipose, every JSON response must be an object. the single-event endpoints already satisfy this; the batch endpoints wrap their list in this envelope so the same rule holds.",
  "properties": {
    "items": {
      "description": "Events processed by the batch operation.",
      "items": {
        "description": "Schema for event response.",
        "properties": {
          "body": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Event body content.",
            "title": "Body"
          },
          "createdAt": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Event creation timestamp.",
            "title": "Createdat"
          },
          "emitterId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Emitter identifier.",
            "title": "Emitterid"
          },
          "emitterType": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Emitter type.",
            "title": "Emittertype"
          },
          "eventType": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Event type.",
            "title": "Eventtype"
          },
          "sequenceId": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Event sequence number within the session.",
            "title": "Sequenceid"
          }
        },
        "title": "EventResponse",
        "type": "object"
      },
      "maxItems": 200,
      "title": "Items",
      "type": "array"
    }
  },
  "required": [
    "items"
  ],
  "title": "BatchEventResponse",
  "type": "object"
}
```

### Responses

| Status | Meaning | Description | Schema |
| --- | --- | --- | --- |
| 200 | OK | Successful Response | BatchEventResponse |
| 400 | Bad Request | An event emitter is not a session participant | None |
| 404 | Not Found | Session or one of the events was not found | None |
| 422 | Unprocessable Entity | Tried to update an outdated version of an event | None |
| 429 | Too Many Requests | Trial usage limit reached: the tenant's monthly read/write request quota or its total storage cap is exhausted. Carries X-RateLimit-* headers; quota (not storage) responses also carry Retry-After. | None |

### Response Headers

| Status | Header | Type | Format | Description |
| --- | --- | --- | --- | --- |
| 429 | Retry-After | integer |  | Seconds until the monthly quota resets. Quota responses only. |
| 429 | X-RateLimit-Limit | integer |  | The applicable limit (monthly request quota, or storage cap). |
| 429 | X-RateLimit-Remaining | integer |  | Units remaining before the limit is reached. |
| 429 | X-RateLimit-Reset | integer |  | Epoch seconds at which the quota resets. Quota responses only. |

## Create events batch by memory_space_ ID

Operation path: `POST /{memory_space_id}/sessions/{session_id}/events/batch/`

Append up to MAX_BATCH_SIZE events to a session atomically.

### Body parameter

```
{
  "description": "Schema for batch event creation. events are appended in list order.",
  "properties": {
    "events": {
      "description": "Events to append, in order.",
      "items": {
        "description": "Schema for create event request.",
        "properties": {
          "body": {
            "additionalProperties": true,
            "description": "Body for all event types. content field is mandatory, any additional fields are allowed.",
            "properties": {
              "content": {
                "description": "Event body content text.",
                "maxLength": 100000,
                "minLength": 1,
                "title": "Content",
                "type": "string"
              }
            },
            "required": [
              "content"
            ],
            "title": "EventBody",
            "type": "object"
          },
          "emitter": {
            "description": "Schema for emitter data.",
            "properties": {
              "id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Emitter identifier (objectid format).",
                "title": "Id"
              },
              "type": {
                "description": "Emitter type. one of: 'user', 'agent'.",
                "enum": [
                  "user",
                  "agent"
                ],
                "title": "Type",
                "type": "string"
              }
            },
            "required": [
              "type"
            ],
            "title": "EmitterDataModel",
            "type": "object"
          },
          "type": {
            "enum": [
              "message",
              "tool_output",
              "status"
            ],
            "title": "EventType",
            "type": "string"
          }
        },
        "required": [
          "body",
          "emitter"
        ],
        "title": "CreateEventRequest",
        "type": "object"
      },
      "maxItems": 200,
      "minItems": 1,
      "title": "Events",
      "type": "array"
    }
  },
  "required": [
    "events"
  ],
  "title": "BatchCreateEventRequest",
  "type": "object"
}
```

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| session_id | path | string(uuid) | true | Session ID |
| memory_space_id | path | string | true | Memory Space ID |
| body | body | BatchCreateEventRequest | true | none |

### Example responses

> 201 Response

```
{
  "description": "Envelope wrapping a list of event responses for batch endpoints. per the datarobot API design policy enforced by adipose, every JSON response must be an object. the single-event endpoints already satisfy this; the batch endpoints wrap their list in this envelope so the same rule holds.",
  "properties": {
    "items": {
      "description": "Events processed by the batch operation.",
      "items": {
        "description": "Schema for event response.",
        "properties": {
          "body": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Event body content.",
            "title": "Body"
          },
          "createdAt": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Event creation timestamp.",
            "title": "Createdat"
          },
          "emitterId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Emitter identifier.",
            "title": "Emitterid"
          },
          "emitterType": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Emitter type.",
            "title": "Emittertype"
          },
          "eventType": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Event type.",
            "title": "Eventtype"
          },
          "sequenceId": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Event sequence number within the session.",
            "title": "Sequenceid"
          }
        },
        "title": "EventResponse",
        "type": "object"
      },
      "maxItems": 200,
      "title": "Items",
      "type": "array"
    }
  },
  "required": [
    "items"
  ],
  "title": "BatchEventResponse",
  "type": "object"
}
```

### Responses

| Status | Meaning | Description | Schema |
| --- | --- | --- | --- |
| 201 | Created | Successful Response | BatchEventResponse |
| 400 | Bad Request | An event emitter is not a session participant | None |
| 404 | Not Found | Session not found | None |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
| 429 | Too Many Requests | Trial usage limit reached: the tenant's monthly read/write request quota or its total storage cap is exhausted. Carries X-RateLimit-* headers; quota (not storage) responses also carry Retry-After. | None |

### Response Headers

| Status | Header | Type | Format | Description |
| --- | --- | --- | --- | --- |
| 429 | Retry-After | integer |  | Seconds until the monthly quota resets. Quota responses only. |
| 429 | X-RateLimit-Limit | integer |  | The applicable limit (monthly request quota, or storage cap). |
| 429 | X-RateLimit-Remaining | integer |  | Units remaining before the limit is reached. |
| 429 | X-RateLimit-Reset | integer |  | Epoch seconds at which the quota resets. Quota responses only. |

## Delete event by memory_space_ ID

Operation path: `DELETE /{memory_space_id}/sessions/{session_id}/events/{sequence_id}/`

Soft-delete one session event by sequence id.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| sequence_id | path | integer | true | Event sequence ID |
| session_id | path | string(uuid) | true | Session ID |
| memory_space_id | path | string | true | Memory Space ID |

### Example responses

> 422 Response

```
{
  "properties": {
    "detail": {
      "description": "List of validation errors.",
      "items": {
        "properties": {
          "ctx": {
            "description": "Additional context about the validation error.",
            "title": "Context",
            "type": "object"
          },
          "input": {
            "additionalProperties": true,
            "description": "The input value that caused the validation error.",
            "title": "Input",
            "type": "object"
          },
          "loc": {
            "description": "The location in the request where the validation error occurred.",
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "maxItems": 100,
            "title": "Location",
            "type": "array"
          },
          "msg": {
            "description": "A human-readable description of the validation error.",
            "title": "Message",
            "type": "string"
          },
          "type": {
            "description": "A machine-readable error type identifier.",
            "title": "Error Type",
            "type": "string"
          }
        },
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError",
        "type": "object"
      },
      "maxItems": 100,
      "title": "Detail",
      "type": "array"
    }
  },
  "title": "HTTPValidationError",
  "type": "object"
}
```

### Responses

| Status | Meaning | Description | Schema |
| --- | --- | --- | --- |
| 204 | No Content | Successful Response | None |
| 404 | Not Found | Session not found or event not found | None |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |

## Update event by memory_space_ ID

Operation path: `PATCH /{memory_space_id}/sessions/{session_id}/events/{sequence_id}/`

### Body parameter

```
{
  "description": "Schema for create event request.",
  "properties": {
    "body": {
      "anyOf": [
        {
          "additionalProperties": true,
          "description": "Body for all event types. content field is mandatory, any additional fields are allowed.",
          "properties": {
            "content": {
              "description": "Event body content text.",
              "maxLength": 100000,
              "minLength": 1,
              "title": "Content",
              "type": "string"
            }
          },
          "required": [
            "content"
          ],
          "title": "EventBody",
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "description": "Updated event body."
    },
    "emitter": {
      "anyOf": [
        {
          "description": "Schema for emitter data.",
          "properties": {
            "id": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Emitter identifier (objectid format).",
              "title": "Id"
            },
            "type": {
              "description": "Emitter type. one of: 'user', 'agent'.",
              "enum": [
                "user",
                "agent"
              ],
              "title": "Type",
              "type": "string"
            }
          },
          "required": [
            "type"
          ],
          "title": "EmitterDataModel",
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "description": "Updated emitter information."
    },
    "type": {
      "anyOf": [
        {
          "enum": [
            "message",
            "tool_output",
            "status"
          ],
          "title": "EventType",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Updated event type."
    }
  },
  "title": "UpdateEventRequest",
  "type": "object"
}
```

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| sequence_id | path | integer | true | Event sequence ID |
| session_id | path | string(uuid) | true | Session ID |
| memory_space_id | path | string | true | Memory Space ID |
| createdAt | query | any | false | Verification of target version of event |
| body | body | UpdateEventRequest | true | none |

### Example responses

> 200 Response

```
{
  "description": "Schema for event response.",
  "properties": {
    "body": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "description": "Event body content.",
      "title": "Body"
    },
    "createdAt": {
      "anyOf": [
        {
          "format": "date-time",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Event creation timestamp.",
      "title": "Createdat"
    },
    "emitterId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Emitter identifier.",
      "title": "Emitterid"
    },
    "emitterType": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Emitter type.",
      "title": "Emittertype"
    },
    "eventType": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Event type.",
      "title": "Eventtype"
    },
    "sequenceId": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "description": "Event sequence number within the session.",
      "title": "Sequenceid"
    }
  },
  "title": "EventResponse",
  "type": "object"
}
```

### Responses

| Status | Meaning | Description | Schema |
| --- | --- | --- | --- |
| 200 | OK | Successful Response | EventResponse |
| 404 | Not Found | Session or event are not found | None |
| 422 | Unprocessable Entity | Try to update outdated version of event | None |
| 429 | Too Many Requests | Trial usage limit reached: the tenant's monthly read/write request quota or its total storage cap is exhausted. Carries X-RateLimit-* headers; quota (not storage) responses also carry Retry-After. | None |

### Response Headers

| Status | Header | Type | Format | Description |
| --- | --- | --- | --- | --- |
| 429 | Retry-After | integer |  | Seconds until the monthly quota resets. Quota responses only. |
| 429 | X-RateLimit-Limit | integer |  | The applicable limit (monthly request quota, or storage cap). |
| 429 | X-RateLimit-Remaining | integer |  | Units remaining before the limit is reached. |
| 429 | X-RateLimit-Reset | integer |  | Epoch seconds at which the quota resets. Quota responses only. |

## Delete all memories by memory_space_ ID

Operation path: `DELETE /{memory_space_id}/v1/memories/`

Delete all memories matching the given filter. At least one filter param is required
to prevent accidental deletion of all memories across all identities.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| memory_space_id | path | string | true | Memory Space ID |
| user_id | query | any | false | none |
| agent_id | query | any | false | none |
| run_id | query | any | false | none |
| app_id | query | any | false | none |

### Example responses

> 200 Response

```
{
  "additionalProperties": true,
  "type": "object"
}
```

### Responses

| Status | Meaning | Description | Schema |
| --- | --- | --- | --- |
| 200 | OK | Successful Response | Inline |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |

### Response Schema

## Get all memories v1 by memory_space_ ID

Operation path: `GET /{memory_space_id}/v1/memories/`

Retrieve all memories matching the given identity filters (v1 query-param interface).

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| memory_space_id | path | string | true | Memory Space ID |
| user_id | query | any | false | none |
| agent_id | query | any | false | none |
| run_id | query | any | false | none |
| app_id | query | any | false | none |
| top_k | query | any | false | none |

### Example responses

> 200 Response

```
{
  "additionalProperties": true,
  "type": "object"
}
```

### Responses

| Status | Meaning | Description | Schema |
| --- | --- | --- | --- |
| 200 | OK | Successful Response | Inline |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
| 429 | Too Many Requests | Trial usage limit reached: the tenant's monthly read/write request quota or its total storage cap is exhausted. Carries X-RateLimit-* headers; quota (not storage) responses also carry Retry-After. | None |

### Response Schema

### Response Headers

| Status | Header | Type | Format | Description |
| --- | --- | --- | --- | --- |
| 429 | Retry-After | integer |  | Seconds until the monthly quota resets. Quota responses only. |
| 429 | X-RateLimit-Limit | integer |  | The applicable limit (monthly request quota, or storage cap). |
| 429 | X-RateLimit-Remaining | integer |  | Units remaining before the limit is reached. |
| 429 | X-RateLimit-Reset | integer |  | Epoch seconds at which the quota resets. Quota responses only. |

## Post memories by memory_space_ ID

Operation path: `POST /{memory_space_id}/v1/memories/`

Extract facts from a conversation and persist them as memories.

### Body parameter

```
{
  "description": "Request body for post /v1/memories — extracts facts from a conversation.",
  "properties": {
    "agentId": {
      "anyOf": [
        {
          "maxLength": 64,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Agentid"
    },
    "appId": {
      "anyOf": [
        {
          "maxLength": 64,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Appid"
    },
    "expirationDate": {
      "anyOf": [
        {
          "maxLength": 40,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Expirationdate"
    },
    "infer": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Infer"
    },
    "messages": {
      "items": {
        "description": "A single conversation message passed to the post /v1/memory endpoint.",
        "properties": {
          "content": {
            "maxLength": 50000,
            "minLength": 1,
            "title": "Content",
            "type": "string"
          },
          "role": {
            "enum": [
              "user",
              "assistant",
              "system"
            ],
            "title": "Role",
            "type": "string"
          }
        },
        "required": [
          "role",
          "content"
        ],
        "title": "Message",
        "type": "object"
      },
      "maxItems": 100,
      "minItems": 1,
      "title": "Messages",
      "type": "array"
    },
    "metadata": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Metadata"
    },
    "runId": {
      "anyOf": [
        {
          "maxLength": 64,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Runid"
    },
    "userId": {
      "maxLength": 64,
      "minLength": 1,
      "title": "Userid",
      "type": "string"
    }
  },
  "required": [
    "userId",
    "messages"
  ],
  "title": "MemoryCreate",
  "type": "object"
}
```

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| memory_space_id | path | string | true | Memory Space ID |
| body | body | MemoryCreate | true | none |

### Example responses

> 200 Response

```
{
  "additionalProperties": true,
  "type": "object"
}
```

### Responses

| Status | Meaning | Description | Schema |
| --- | --- | --- | --- |
| 200 | OK | Successful Response | Inline |
| 409 | Conflict | Immutable memory with the same content already exists. | None |
| 422 | Unprocessable Entity | Validation error (request body) or domain conflict (content mismatch). | Inline |
| 429 | Too Many Requests | Trial usage limit reached: the tenant's monthly read/write request quota or its total storage cap is exhausted. Carries X-RateLimit-* headers; quota (not storage) responses also carry Retry-After. | None |
| 503 | Service Unavailable | Transient condition (insert conflict or upstream LLM rate limit); retry advised. | None |

### Response Schema

### Response Headers

| Status | Header | Type | Format | Description |
| --- | --- | --- | --- | --- |
| 429 | Retry-After | integer |  | Seconds until the monthly quota resets. Quota responses only. |
| 429 | X-RateLimit-Limit | integer |  | The applicable limit (monthly request quota, or storage cap). |
| 429 | X-RateLimit-Remaining | integer |  | Units remaining before the limit is reached. |
| 429 | X-RateLimit-Reset | integer |  | Epoch seconds at which the quota resets. Quota responses only. |
| 503 | Retry-After | integer |  | none |

## Search memories v1 by memory_space_ ID

Operation path: `POST /{memory_space_id}/v1/memories/search/`

Search memories by semantic similarity to a query string.

### Body parameter

```
{
  "description": "Request body for post /v2/memories/search/ extra=\"ignore\" is set because the mem0 client injects org_id/project_id fields that are not relevant for datarobot.",
  "properties": {
    "agentId": {
      "anyOf": [
        {
          "maxLength": 64,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Agentid"
    },
    "appId": {
      "anyOf": [
        {
          "maxLength": 64,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Appid"
    },
    "filters": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Filters"
    },
    "query": {
      "maxLength": 2000,
      "minLength": 1,
      "title": "Query",
      "type": "string"
    },
    "rerank": {
      "default": true,
      "title": "Rerank",
      "type": "boolean"
    },
    "runId": {
      "anyOf": [
        {
          "maxLength": 64,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Runid"
    },
    "threshold": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Threshold"
    },
    "topK": {
      "anyOf": [
        {
          "maximum": 50,
          "minimum": 1,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Topk"
    },
    "userId": {
      "anyOf": [
        {
          "maxLength": 64,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Userid"
    }
  },
  "required": [
    "query"
  ],
  "title": "MemorySearch",
  "type": "object"
}
```

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| memory_space_id | path | string | true | Memory Space ID |
| body | body | MemorySearch | true | none |

### Example responses

> 200 Response

```
{
  "additionalProperties": true,
  "type": "object"
}
```

### Responses

| Status | Meaning | Description | Schema |
| --- | --- | --- | --- |
| 200 | OK | Successful Response | Inline |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
| 429 | Too Many Requests | Trial usage limit reached: the tenant's monthly read/write request quota or its total storage cap is exhausted. Carries X-RateLimit-* headers; quota (not storage) responses also carry Retry-After. | None |

### Response Schema

### Response Headers

| Status | Header | Type | Format | Description |
| --- | --- | --- | --- | --- |
| 429 | Retry-After | integer |  | Seconds until the monthly quota resets. Quota responses only. |
| 429 | X-RateLimit-Limit | integer |  | The applicable limit (monthly request quota, or storage cap). |
| 429 | X-RateLimit-Remaining | integer |  | Units remaining before the limit is reached. |
| 429 | X-RateLimit-Reset | integer |  | Epoch seconds at which the quota resets. Quota responses only. |

## Delete memory by memory_space_ ID

Operation path: `DELETE /{memory_space_id}/v1/memories/{memory_id}/`

Delete a single memory by its ID.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| memory_id | path | string(uuid) | true | none |
| memory_space_id | path | string | true | Memory Space ID |

### Example responses

> 200 Response

```
{
  "additionalProperties": true,
  "type": "object"
}
```

### Responses

| Status | Meaning | Description | Schema |
| --- | --- | --- | --- |
| 200 | OK | Successful Response | Inline |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |

### Response Schema

## Get memory by memory_space_ ID

Operation path: `GET /{memory_space_id}/v1/memories/{memory_id}/`

Retrieve a single memory by its ID. Returns null if the memory does not exist.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| memory_id | path | string(uuid) | true | none |
| memory_space_id | path | string | true | Memory Space ID |

### Example responses

> 200 Response

```
{
  "additionalProperties": true,
  "type": "object"
}
```

### Responses

| Status | Meaning | Description | Schema |
| --- | --- | --- | --- |
| 200 | OK | Successful Response | Inline |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
| 429 | Too Many Requests | Trial usage limit reached: the tenant's monthly read/write request quota or its total storage cap is exhausted. Carries X-RateLimit-* headers; quota (not storage) responses also carry Retry-After. | None |

### Response Schema

### Response Headers

| Status | Header | Type | Format | Description |
| --- | --- | --- | --- | --- |
| 429 | Retry-After | integer |  | Seconds until the monthly quota resets. Quota responses only. |
| 429 | X-RateLimit-Limit | integer |  | The applicable limit (monthly request quota, or storage cap). |
| 429 | X-RateLimit-Remaining | integer |  | Units remaining before the limit is reached. |
| 429 | X-RateLimit-Reset | integer |  | Epoch seconds at which the quota resets. Quota responses only. |

## Put memory by memory_space_ ID

Operation path: `PUT /{memory_space_id}/v1/memories/{memory_id}/`

Replace the text of an existing memory.
Returns 404 if the memory does not exist.
Returns 409 if the memory is immutable.

### Body parameter

```
{
  "description": "Request body for put /v1/memories/{memory_id}. metadata and timestamp are accepted for mem0 client compatibility but not forwarded.",
  "properties": {
    "metadata": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Metadata"
    },
    "text": {
      "maxLength": 10000,
      "minLength": 1,
      "title": "Text",
      "type": "string"
    },
    "timestamp": {
      "anyOf": [
        {
          "maxLength": 40,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Timestamp"
    }
  },
  "required": [
    "text"
  ],
  "title": "MemoryUpdate",
  "type": "object"
}
```

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| memory_id | path | string(uuid) | true | none |
| memory_space_id | path | string | true | Memory Space ID |
| body | body | MemoryUpdate | true | none |

### Example responses

> 200 Response

```
{
  "additionalProperties": true,
  "type": "object"
}
```

### Responses

| Status | Meaning | Description | Schema |
| --- | --- | --- | --- |
| 200 | OK | Successful Response | Inline |
| 404 | Not Found | Memory not found. | None |
| 409 | Conflict | Memory is immutable and cannot be updated. | None |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
| 429 | Too Many Requests | Trial usage limit reached: the tenant's monthly read/write request quota or its total storage cap is exhausted. Carries X-RateLimit-* headers; quota (not storage) responses also carry Retry-After. | None |

### Response Schema

### Response Headers

| Status | Header | Type | Format | Description |
| --- | --- | --- | --- | --- |
| 429 | Retry-After | integer |  | Seconds until the monthly quota resets. Quota responses only. |
| 429 | X-RateLimit-Limit | integer |  | The applicable limit (monthly request quota, or storage cap). |
| 429 | X-RateLimit-Remaining | integer |  | Units remaining before the limit is reached. |
| 429 | X-RateLimit-Reset | integer |  | Epoch seconds at which the quota resets. Quota responses only. |

## Get memory history by memory_space_ ID

Operation path: `GET /{memory_space_id}/v1/memories/{memory_id}/history/`

Retrieve the mutation history (audit trail) for a single memory.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| memory_id | path | string(uuid) | true | none |
| memory_space_id | path | string | true | Memory Space ID |
| limit | query | integer | false | none |

### Example responses

> 200 Response

```
{
  "additionalProperties": true,
  "type": "object"
}
```

### Responses

| Status | Meaning | Description | Schema |
| --- | --- | --- | --- |
| 200 | OK | Successful Response | Inline |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
| 429 | Too Many Requests | Trial usage limit reached: the tenant's monthly read/write request quota or its total storage cap is exhausted. Carries X-RateLimit-* headers; quota (not storage) responses also carry Retry-After. | None |

### Response Schema

### Response Headers

| Status | Header | Type | Format | Description |
| --- | --- | --- | --- | --- |
| 429 | Retry-After | integer |  | Seconds until the monthly quota resets. Quota responses only. |
| 429 | X-RateLimit-Limit | integer |  | The applicable limit (monthly request quota, or storage cap). |
| 429 | X-RateLimit-Remaining | integer |  | Units remaining before the limit is reached. |
| 429 | X-RateLimit-Reset | integer |  | Epoch seconds at which the quota resets. Quota responses only. |

## ping by memory_space_ ID

Operation path: `GET /{memory_space_id}/v1/ping/`

Health check endpoint returning fake user context for mem0.MemoryClient compatibility.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| memory_space_id | path | string | true | Memory Space ID |

### Example responses

> 200 Response

```
{
  "additionalProperties": true,
  "type": "object"
}
```

### Responses

| Status | Meaning | Description | Schema |
| --- | --- | --- | --- |
| 200 | OK | Successful Response | Inline |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |

### Response Schema

## Reset memories by memory_space_ ID

Operation path: `POST /{memory_space_id}/v1/reset/`

Delete all memories in the current memory space.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| memory_space_id | path | string | true | Memory Space ID |

### Example responses

> 200 Response

```
{
  "additionalProperties": true,
  "type": "object"
}
```

### Responses

| Status | Meaning | Description | Schema |
| --- | --- | --- | --- |
| 200 | OK | Successful Response | Inline |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |

### Response Schema

## Get all memories v2 by memory_space_ ID

Operation path: `POST /{memory_space_id}/v2/memories/`

Retrieve all memories matching the given filters.

At least one of user_id, agent_id, or run_id is required (as enforced by mem0's AsyncMemory).

### Body parameter

```
{
  "description": "Request body for post /v2/memories extra=\"ignore\" is set because the mem0 client injects org_id/project_id fields that are not relevant for datarobot.",
  "properties": {
    "agentId": {
      "anyOf": [
        {
          "maxLength": 64,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Agentid"
    },
    "appId": {
      "anyOf": [
        {
          "maxLength": 64,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Appid"
    },
    "filters": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Filters"
    },
    "pageSize": {
      "anyOf": [
        {
          "maximum": 50,
          "minimum": 1,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Pagesize"
    },
    "runId": {
      "anyOf": [
        {
          "maxLength": 64,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Runid"
    },
    "topK": {
      "anyOf": [
        {
          "maximum": 50,
          "minimum": 1,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Topk"
    },
    "userId": {
      "anyOf": [
        {
          "maxLength": 64,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Userid"
    }
  },
  "title": "MemoryGetAll",
  "type": "object"
}
```

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| memory_space_id | path | string | true | Memory Space ID |
| page_size | query | any | false | none |
| body | body | MemoryGetAll | true | none |

### Example responses

> 200 Response

```
{
  "additionalProperties": true,
  "type": "object"
}
```

### Responses

| Status | Meaning | Description | Schema |
| --- | --- | --- | --- |
| 200 | OK | Successful Response | Inline |
| 400 | Bad Request | At least one of user_id, agent_id, or run_id must be provided. | None |
| 422 | Unprocessable Entity | Validation error (request body) or domain conflict (content mismatch). | Inline |
| 429 | Too Many Requests | Trial usage limit reached: the tenant's monthly read/write request quota or its total storage cap is exhausted. Carries X-RateLimit-* headers; quota (not storage) responses also carry Retry-After. | None |

### Response Schema

### Response Headers

| Status | Header | Type | Format | Description |
| --- | --- | --- | --- | --- |
| 429 | Retry-After | integer |  | Seconds until the monthly quota resets. Quota responses only. |
| 429 | X-RateLimit-Limit | integer |  | The applicable limit (monthly request quota, or storage cap). |
| 429 | X-RateLimit-Remaining | integer |  | Units remaining before the limit is reached. |
| 429 | X-RateLimit-Reset | integer |  | Epoch seconds at which the quota resets. Quota responses only. |

## Search memories v2 by memory_space_ ID

Operation path: `POST /{memory_space_id}/v2/memories/search/`

Search memories by semantic similarity to a query string.

At least one of user_id, agent_id, or run_id is required to scope the search.

### Body parameter

```
{
  "description": "Request body for post /v2/memories/search/ extra=\"ignore\" is set because the mem0 client injects org_id/project_id fields that are not relevant for datarobot.",
  "properties": {
    "agentId": {
      "anyOf": [
        {
          "maxLength": 64,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Agentid"
    },
    "appId": {
      "anyOf": [
        {
          "maxLength": 64,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Appid"
    },
    "filters": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Filters"
    },
    "query": {
      "maxLength": 2000,
      "minLength": 1,
      "title": "Query",
      "type": "string"
    },
    "rerank": {
      "default": true,
      "title": "Rerank",
      "type": "boolean"
    },
    "runId": {
      "anyOf": [
        {
          "maxLength": 64,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Runid"
    },
    "threshold": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Threshold"
    },
    "topK": {
      "anyOf": [
        {
          "maximum": 50,
          "minimum": 1,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Topk"
    },
    "userId": {
      "anyOf": [
        {
          "maxLength": 64,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Userid"
    }
  },
  "required": [
    "query"
  ],
  "title": "MemorySearch",
  "type": "object"
}
```

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| memory_space_id | path | string | true | Memory Space ID |
| body | body | MemorySearch | true | none |

### Example responses

> 200 Response

```
{
  "additionalProperties": true,
  "type": "object"
}
```

### Responses

| Status | Meaning | Description | Schema |
| --- | --- | --- | --- |
| 200 | OK | Successful Response | Inline |
| 400 | Bad Request | At least one of user_id, agent_id, or run_id must be provided. | None |
| 422 | Unprocessable Entity | Validation error (request body) or domain conflict (content mismatch). | Inline |
| 429 | Too Many Requests | Trial usage limit reached: the tenant's monthly read/write request quota or its total storage cap is exhausted. Carries X-RateLimit-* headers; quota (not storage) responses also carry Retry-After. | None |

### Response Schema

### Response Headers

| Status | Header | Type | Format | Description |
| --- | --- | --- | --- | --- |
| 429 | Retry-After | integer |  | Seconds until the monthly quota resets. Quota responses only. |
| 429 | X-RateLimit-Limit | integer |  | The applicable limit (monthly request quota, or storage cap). |
| 429 | X-RateLimit-Remaining | integer |  | Units remaining before the limit is reached. |
| 429 | X-RateLimit-Reset | integer |  | Epoch seconds at which the quota resets. Quota responses only. |

## Create memories by ID by memory_space_ ID

Operation path: `POST /{memory_space_id}/v3/memories/`

Retrieve all memories matching the given filters.

At least one of user_id, agent_id, or run_id is required (as enforced by mem0's AsyncMemory).

### Body parameter

```
{
  "description": "Request body for post /v2/memories extra=\"ignore\" is set because the mem0 client injects org_id/project_id fields that are not relevant for datarobot.",
  "properties": {
    "agentId": {
      "anyOf": [
        {
          "maxLength": 64,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Agentid"
    },
    "appId": {
      "anyOf": [
        {
          "maxLength": 64,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Appid"
    },
    "filters": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Filters"
    },
    "pageSize": {
      "anyOf": [
        {
          "maximum": 50,
          "minimum": 1,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Pagesize"
    },
    "runId": {
      "anyOf": [
        {
          "maxLength": 64,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Runid"
    },
    "topK": {
      "anyOf": [
        {
          "maximum": 50,
          "minimum": 1,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Topk"
    },
    "userId": {
      "anyOf": [
        {
          "maxLength": 64,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Userid"
    }
  },
  "title": "MemoryGetAll",
  "type": "object"
}
```

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| memory_space_id | path | string | true | Memory Space ID |
| page_size | query | any | false | none |
| body | body | MemoryGetAll | true | none |

### Example responses

> 200 Response

```
{
  "additionalProperties": true,
  "type": "object"
}
```

### Responses

| Status | Meaning | Description | Schema |
| --- | --- | --- | --- |
| 200 | OK | Successful Response | Inline |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
| 429 | Too Many Requests | Trial usage limit reached: the tenant's monthly read/write request quota or its total storage cap is exhausted. Carries X-RateLimit-* headers; quota (not storage) responses also carry Retry-After. | None |

### Response Schema

### Response Headers

| Status | Header | Type | Format | Description |
| --- | --- | --- | --- | --- |
| 429 | Retry-After | integer |  | Seconds until the monthly quota resets. Quota responses only. |
| 429 | X-RateLimit-Limit | integer |  | The applicable limit (monthly request quota, or storage cap). |
| 429 | X-RateLimit-Remaining | integer |  | Units remaining before the limit is reached. |
| 429 | X-RateLimit-Reset | integer |  | Epoch seconds at which the quota resets. Quota responses only. |

## Create add by ID by memory_space_ ID

Operation path: `POST /{memory_space_id}/v3/memories/add/`

Extract facts from a conversation and persist them as memories.

### Body parameter

```
{
  "description": "Request body for post /v1/memories — extracts facts from a conversation.",
  "properties": {
    "agentId": {
      "anyOf": [
        {
          "maxLength": 64,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Agentid"
    },
    "appId": {
      "anyOf": [
        {
          "maxLength": 64,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Appid"
    },
    "expirationDate": {
      "anyOf": [
        {
          "maxLength": 40,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Expirationdate"
    },
    "infer": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Infer"
    },
    "messages": {
      "items": {
        "description": "A single conversation message passed to the post /v1/memory endpoint.",
        "properties": {
          "content": {
            "maxLength": 50000,
            "minLength": 1,
            "title": "Content",
            "type": "string"
          },
          "role": {
            "enum": [
              "user",
              "assistant",
              "system"
            ],
            "title": "Role",
            "type": "string"
          }
        },
        "required": [
          "role",
          "content"
        ],
        "title": "Message",
        "type": "object"
      },
      "maxItems": 100,
      "minItems": 1,
      "title": "Messages",
      "type": "array"
    },
    "metadata": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Metadata"
    },
    "runId": {
      "anyOf": [
        {
          "maxLength": 64,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Runid"
    },
    "userId": {
      "maxLength": 64,
      "minLength": 1,
      "title": "Userid",
      "type": "string"
    }
  },
  "required": [
    "userId",
    "messages"
  ],
  "title": "MemoryCreate",
  "type": "object"
}
```

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| memory_space_id | path | string | true | Memory Space ID |
| body | body | MemoryCreate | true | none |

### Example responses

> 200 Response

```
{
  "additionalProperties": true,
  "type": "object"
}
```

### Responses

| Status | Meaning | Description | Schema |
| --- | --- | --- | --- |
| 200 | OK | Successful Response | Inline |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
| 429 | Too Many Requests | Trial usage limit reached: the tenant's monthly read/write request quota or its total storage cap is exhausted. Carries X-RateLimit-* headers; quota (not storage) responses also carry Retry-After. | None |

### Response Schema

### Response Headers

| Status | Header | Type | Format | Description |
| --- | --- | --- | --- | --- |
| 429 | Retry-After | integer |  | Seconds until the monthly quota resets. Quota responses only. |
| 429 | X-RateLimit-Limit | integer |  | The applicable limit (monthly request quota, or storage cap). |
| 429 | X-RateLimit-Remaining | integer |  | Units remaining before the limit is reached. |
| 429 | X-RateLimit-Reset | integer |  | Epoch seconds at which the quota resets. Quota responses only. |

## Create search by ID by memory_space_ ID

Operation path: `POST /{memory_space_id}/v3/memories/search/`

Search memories by semantic similarity to a query string.

At least one of user_id, agent_id, or run_id is required to scope the search.

### Body parameter

```
{
  "description": "Request body for post /v2/memories/search/ extra=\"ignore\" is set because the mem0 client injects org_id/project_id fields that are not relevant for datarobot.",
  "properties": {
    "agentId": {
      "anyOf": [
        {
          "maxLength": 64,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Agentid"
    },
    "appId": {
      "anyOf": [
        {
          "maxLength": 64,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Appid"
    },
    "filters": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Filters"
    },
    "query": {
      "maxLength": 2000,
      "minLength": 1,
      "title": "Query",
      "type": "string"
    },
    "rerank": {
      "default": true,
      "title": "Rerank",
      "type": "boolean"
    },
    "runId": {
      "anyOf": [
        {
          "maxLength": 64,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Runid"
    },
    "threshold": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Threshold"
    },
    "topK": {
      "anyOf": [
        {
          "maximum": 50,
          "minimum": 1,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Topk"
    },
    "userId": {
      "anyOf": [
        {
          "maxLength": 64,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Userid"
    }
  },
  "required": [
    "query"
  ],
  "title": "MemorySearch",
  "type": "object"
}
```

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| memory_space_id | path | string | true | Memory Space ID |
| body | body | MemorySearch | true | none |

### Example responses

> 200 Response

```
{
  "additionalProperties": true,
  "type": "object"
}
```

### Responses

| Status | Meaning | Description | Schema |
| --- | --- | --- | --- |
| 200 | OK | Successful Response | Inline |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
| 429 | Too Many Requests | Trial usage limit reached: the tenant's monthly read/write request quota or its total storage cap is exhausted. Carries X-RateLimit-* headers; quota (not storage) responses also carry Retry-After. | None |

### Response Schema

### Response Headers

| Status | Header | Type | Format | Description |
| --- | --- | --- | --- | --- |
| 429 | Retry-After | integer |  | Seconds until the monthly quota resets. Quota responses only. |
| 429 | X-RateLimit-Limit | integer |  | The applicable limit (monthly request quota, or storage cap). |
| 429 | X-RateLimit-Remaining | integer |  | Units remaining before the limit is reached. |
| 429 | X-RateLimit-Reset | integer |  | Epoch seconds at which the quota resets. Quota responses only. |

# Schemas

## BatchCreateEventRequest

```
{
  "description": "Schema for batch event creation. events are appended in list order.",
  "properties": {
    "events": {
      "description": "Events to append, in order.",
      "items": {
        "description": "Schema for create event request.",
        "properties": {
          "body": {
            "additionalProperties": true,
            "description": "Body for all event types. content field is mandatory, any additional fields are allowed.",
            "properties": {
              "content": {
                "description": "Event body content text.",
                "maxLength": 100000,
                "minLength": 1,
                "title": "Content",
                "type": "string"
              }
            },
            "required": [
              "content"
            ],
            "title": "EventBody",
            "type": "object"
          },
          "emitter": {
            "description": "Schema for emitter data.",
            "properties": {
              "id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Emitter identifier (objectid format).",
                "title": "Id"
              },
              "type": {
                "description": "Emitter type. one of: 'user', 'agent'.",
                "enum": [
                  "user",
                  "agent"
                ],
                "title": "Type",
                "type": "string"
              }
            },
            "required": [
              "type"
            ],
            "title": "EmitterDataModel",
            "type": "object"
          },
          "type": {
            "enum": [
              "message",
              "tool_output",
              "status"
            ],
            "title": "EventType",
            "type": "string"
          }
        },
        "required": [
          "body",
          "emitter"
        ],
        "title": "CreateEventRequest",
        "type": "object"
      },
      "maxItems": 200,
      "minItems": 1,
      "title": "Events",
      "type": "array"
    }
  },
  "required": [
    "events"
  ],
  "title": "BatchCreateEventRequest",
  "type": "object"
}
```

BatchCreateEventRequest

### Properties

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| events | [CreateEventRequest] | true | maxItems: 200minItems: 1 | Events to append, in order. |

## BatchEventResponse

```
{
  "description": "Envelope wrapping a list of event responses for batch endpoints. per the datarobot API design policy enforced by adipose, every JSON response must be an object. the single-event endpoints already satisfy this; the batch endpoints wrap their list in this envelope so the same rule holds.",
  "properties": {
    "items": {
      "description": "Events processed by the batch operation.",
      "items": {
        "description": "Schema for event response.",
        "properties": {
          "body": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Event body content.",
            "title": "Body"
          },
          "createdAt": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Event creation timestamp.",
            "title": "Createdat"
          },
          "emitterId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Emitter identifier.",
            "title": "Emitterid"
          },
          "emitterType": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Emitter type.",
            "title": "Emittertype"
          },
          "eventType": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Event type.",
            "title": "Eventtype"
          },
          "sequenceId": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Event sequence number within the session.",
            "title": "Sequenceid"
          }
        },
        "title": "EventResponse",
        "type": "object"
      },
      "maxItems": 200,
      "title": "Items",
      "type": "array"
    }
  },
  "required": [
    "items"
  ],
  "title": "BatchEventResponse",
  "type": "object"
}
```

BatchEventResponse

### Properties

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| items | [EventResponse] | true | maxItems: 200 | Events processed by the batch operation. |

## BatchUpdateEventItem

```
{
  "description": "A single item of a batch update: identifies the target event by sequence_id. inherits the mutable body/type/emitter fields from updateeventrequest. the inherited \"at least one field present\" validator is overridden below because the always-present sequence_id would otherwise satisfy it vacuously.",
  "properties": {
    "body": {
      "anyOf": [
        {
          "additionalProperties": true,
          "description": "Body for all event types. content field is mandatory, any additional fields are allowed.",
          "properties": {
            "content": {
              "description": "Event body content text.",
              "maxLength": 100000,
              "minLength": 1,
              "title": "Content",
              "type": "string"
            }
          },
          "required": [
            "content"
          ],
          "title": "EventBody",
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "description": "Updated event body."
    },
    "createdAt": {
      "anyOf": [
        {
          "format": "date-time",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Optional per-item version check: must match the target event's timestamp.",
      "title": "Createdat"
    },
    "emitter": {
      "anyOf": [
        {
          "description": "Schema for emitter data.",
          "properties": {
            "id": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Emitter identifier (objectid format).",
              "title": "Id"
            },
            "type": {
              "description": "Emitter type. one of: 'user', 'agent'.",
              "enum": [
                "user",
                "agent"
              ],
              "title": "Type",
              "type": "string"
            }
          },
          "required": [
            "type"
          ],
          "title": "EmitterDataModel",
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "description": "Updated emitter information."
    },
    "sequenceId": {
      "description": "Target event sequence ID within the session.",
      "minimum": 0,
      "title": "Sequenceid",
      "type": "integer"
    },
    "type": {
      "anyOf": [
        {
          "enum": [
            "message",
            "tool_output",
            "status"
          ],
          "title": "EventType",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Updated event type."
    }
  },
  "required": [
    "sequenceId"
  ],
  "title": "BatchUpdateEventItem",
  "type": "object"
}
```

BatchUpdateEventItem

### Properties

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| body | any | false |  | Updated event body. |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | EventBody | false |  | Body for all event types. content field is mandatory, any additional fields are allowed. |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| createdAt | any | false |  | Optional per-item version check: must match the target event's timestamp. |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | string(date-time) | false |  | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| emitter | any | false |  | Updated emitter information. |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | EmitterDataModel | false |  | Schema for emitter data. |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| sequenceId | integer | true | minimum: 0 | Target event sequence ID within the session. |
| type | any | false |  | Updated event type. |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | EventType | false |  | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

## BatchUpdateEventRequest

```
{
  "description": "Schema for batch event update.",
  "properties": {
    "events": {
      "description": "Events to update.",
      "items": {
        "description": "A single item of a batch update: identifies the target event by sequence_id. inherits the mutable body/type/emitter fields from updateeventrequest. the inherited \"at least one field present\" validator is overridden below because the always-present sequence_id would otherwise satisfy it vacuously.",
        "properties": {
          "body": {
            "anyOf": [
              {
                "additionalProperties": true,
                "description": "Body for all event types. content field is mandatory, any additional fields are allowed.",
                "properties": {
                  "content": {
                    "description": "Event body content text.",
                    "maxLength": 100000,
                    "minLength": 1,
                    "title": "Content",
                    "type": "string"
                  }
                },
                "required": [
                  "content"
                ],
                "title": "EventBody",
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Updated event body."
          },
          "createdAt": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional per-item version check: must match the target event's timestamp.",
            "title": "Createdat"
          },
          "emitter": {
            "anyOf": [
              {
                "description": "Schema for emitter data.",
                "properties": {
                  "id": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Emitter identifier (objectid format).",
                    "title": "Id"
                  },
                  "type": {
                    "description": "Emitter type. one of: 'user', 'agent'.",
                    "enum": [
                      "user",
                      "agent"
                    ],
                    "title": "Type",
                    "type": "string"
                  }
                },
                "required": [
                  "type"
                ],
                "title": "EmitterDataModel",
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Updated emitter information."
          },
          "sequenceId": {
            "description": "Target event sequence ID within the session.",
            "minimum": 0,
            "title": "Sequenceid",
            "type": "integer"
          },
          "type": {
            "anyOf": [
              {
                "enum": [
                  "message",
                  "tool_output",
                  "status"
                ],
                "title": "EventType",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Updated event type."
          }
        },
        "required": [
          "sequenceId"
        ],
        "title": "BatchUpdateEventItem",
        "type": "object"
      },
      "maxItems": 200,
      "minItems": 1,
      "title": "Events",
      "type": "array"
    }
  },
  "required": [
    "events"
  ],
  "title": "BatchUpdateEventRequest",
  "type": "object"
}
```

BatchUpdateEventRequest

### Properties

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| events | [BatchUpdateEventItem] | true | maxItems: 200minItems: 1 | Events to update. |

## CreateEventRequest

```
{
  "description": "Schema for create event request.",
  "properties": {
    "body": {
      "additionalProperties": true,
      "description": "Body for all event types. content field is mandatory, any additional fields are allowed.",
      "properties": {
        "content": {
          "description": "Event body content text.",
          "maxLength": 100000,
          "minLength": 1,
          "title": "Content",
          "type": "string"
        }
      },
      "required": [
        "content"
      ],
      "title": "EventBody",
      "type": "object"
    },
    "emitter": {
      "description": "Schema for emitter data.",
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Emitter identifier (objectid format).",
          "title": "Id"
        },
        "type": {
          "description": "Emitter type. one of: 'user', 'agent'.",
          "enum": [
            "user",
            "agent"
          ],
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "type"
      ],
      "title": "EmitterDataModel",
      "type": "object"
    },
    "type": {
      "enum": [
        "message",
        "tool_output",
        "status"
      ],
      "title": "EventType",
      "type": "string"
    }
  },
  "required": [
    "body",
    "emitter"
  ],
  "title": "CreateEventRequest",
  "type": "object"
}
```

CreateEventRequest

### Properties

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| body | EventBody | true |  | Event body. |
| emitter | EmitterDataModel | true |  | Emitter information. |
| type | EventType | false |  | Event type. |

## CreateMemorySpaceRequest

```
{
  "description": "Request body for creating a memory space.",
  "properties": {
    "customInstructions": {
      "anyOf": [
        {
          "maxLength": 10000,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Custom prompt instructions used for fact extraction null leaves mem0 on its default extraction prompt.",
      "title": "Custominstructions"
    },
    "deduplicationKey": {
      "anyOf": [
        {
          "maxLength": 72,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Optional key, unique per user, for idempotent memory space creation by coordinating ha agents. a second create with the same key returns 409.",
      "title": "Deduplicationkey"
    },
    "description": {
      "anyOf": [
        {
          "maxLength": 1000,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Optional description for the memory space.",
      "title": "Description"
    },
    "llmBaseUrl": {
      "anyOf": [
        {
          "format": "uri",
          "maxLength": 2083,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Chat API url to use for memory extraction.",
      "title": "Llmbaseurl"
    },
    "llmModelName": {
      "anyOf": [
        {
          "maxLength": 200,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Name of the LLM model to use for memory extraction. non-reasoning models such as ``gpt-4o`` are recommended. reasoning-capable models are significantly slower for fact extraction without producing meaningfully better results.",
      "title": "Llmmodelname"
    }
  },
  "title": "CreateMemorySpaceRequest",
  "type": "object"
}
```

CreateMemorySpaceRequest

### Properties

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| customInstructions | any | false |  | Custom prompt instructions used for fact extraction null leaves mem0 on its default extraction prompt. |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | string | false | maxLength: 10000 | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| deduplicationKey | any | false |  | Optional key, unique per user, for idempotent memory space creation by coordinating ha agents. a second create with the same key returns 409. |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | string | false | maxLength: 72minLength: 1minLength: 1 | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| description | any | false |  | Optional description for the memory space. |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | string | false | maxLength: 1000 | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| llmBaseUrl | any | false |  | Chat API url to use for memory extraction. |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | string(uri) | false | maxLength: 2083minLength: 1minLength: 1 | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| llmModelName | any | false |  | Name of the LLM model to use for memory extraction. non-reasoning models such as gpt-4o are recommended. reasoning-capable models are significantly slower for fact extraction without producing meaningfully better results. |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | string | false | maxLength: 200 | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

## CreateSessionRequest

```
{
  "description": "Customer support conversation",
  "lifecycleStrategies": [
    {
      "trigger": {
        "ttl": 604800
      },
      "type": "soft_delete"
    }
  ],
  "metadata": {
    "department": "sales",
    "priority": "high",
    "region": "us-east"
  },
  "participants": [
    "507f1f77bcf86cd799439011"
  ]
}
```

CreateSessionRequest

### Properties

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| deduplicationKey | any | false |  | Optional key, unique within the memory space, for idempotent session creation by coordinating ha agents. a second create with the same key returns 409. |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | string | false | maxLength: 72minLength: 1minLength: 1 | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| description | any | false |  | Optional session description. |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | string | false | maxLength: 1000 | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| lifecycleStrategies | [LifecycleStrategiesDataModel] | true | maxItems: 5 | Lifecycle strategies that automatically manage session lifecycle. |
| metadata | any | false |  | Custom metadata as key-value pairs for storing application-specific data. |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | object | false |  | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| participants | [string] | true | maxItems: 50minItems: 1 | List of participant ids (objectid format). |

## EmitterDataModel

```
{
  "description": "Schema for emitter data.",
  "properties": {
    "id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Emitter identifier (objectid format).",
      "title": "Id"
    },
    "type": {
      "description": "Emitter type. one of: 'user', 'agent'.",
      "enum": [
        "user",
        "agent"
      ],
      "title": "Type",
      "type": "string"
    }
  },
  "required": [
    "type"
  ],
  "title": "EmitterDataModel",
  "type": "object"
}
```

EmitterDataModel

### Properties

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| id | any | false |  | Emitter identifier (objectid format). |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | string | false |  | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| type | string | true |  | Emitter type. one of: 'user', 'agent'. |

### Enumerated Values

| Property | Value |
| --- | --- |
| type | [user, agent] |

## EventBody

```
{
  "additionalProperties": true,
  "description": "Body for all event types. content field is mandatory, any additional fields are allowed.",
  "properties": {
    "content": {
      "description": "Event body content text.",
      "maxLength": 100000,
      "minLength": 1,
      "title": "Content",
      "type": "string"
    }
  },
  "required": [
    "content"
  ],
  "title": "EventBody",
  "type": "object"
}
```

EventBody

### Properties

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| content | string | true | maxLength: 100000minLength: 1minLength: 1 | Event body content text. |

## EventCountTrigger

```
{
  "additionalProperties": false,
  "description": "Trigger based on event count. fires when the session's event count reaches or exceeds the configured threshold.",
  "properties": {
    "eventCount": {
      "description": "Event count threshold.",
      "exclusiveMinimum": 0,
      "maximum": 1000000,
      "title": "Eventcount",
      "type": "integer"
    }
  },
  "required": [
    "eventCount"
  ],
  "title": "EventCountTrigger",
  "type": "object"
}
```

EventCountTrigger

### Properties

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| eventCount | integer | true | maximum: 1000000 | Event count threshold. |

## EventResponse

```
{
  "description": "Schema for event response.",
  "properties": {
    "body": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "description": "Event body content.",
      "title": "Body"
    },
    "createdAt": {
      "anyOf": [
        {
          "format": "date-time",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Event creation timestamp.",
      "title": "Createdat"
    },
    "emitterId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Emitter identifier.",
      "title": "Emitterid"
    },
    "emitterType": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Emitter type.",
      "title": "Emittertype"
    },
    "eventType": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Event type.",
      "title": "Eventtype"
    },
    "sequenceId": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "description": "Event sequence number within the session.",
      "title": "Sequenceid"
    }
  },
  "title": "EventResponse",
  "type": "object"
}
```

EventResponse

### Properties

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| body | any | false |  | Event body content. |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | object | false |  | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| createdAt | any | false |  | Event creation timestamp. |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | string(date-time) | false |  | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| emitterId | any | false |  | Emitter identifier. |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | string | false |  | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| emitterType | any | false |  | Emitter type. |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | string | false |  | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| eventType | any | false |  | Event type. |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | string | false |  | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| sequenceId | any | false |  | Event sequence number within the session. |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | integer | false |  | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

## EventType

```
{
  "enum": [
    "message",
    "tool_output",
    "status"
  ],
  "title": "EventType",
  "type": "string"
}
```

EventType

### Properties

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| EventType | string | false |  | none |

### Enumerated Values

| Property | Value |
| --- | --- |
| EventType | [message, tool_output, status] |

## HTTPValidationError

```
{
  "properties": {
    "detail": {
      "description": "List of validation errors.",
      "items": {
        "properties": {
          "ctx": {
            "description": "Additional context about the validation error.",
            "title": "Context",
            "type": "object"
          },
          "input": {
            "additionalProperties": true,
            "description": "The input value that caused the validation error.",
            "title": "Input",
            "type": "object"
          },
          "loc": {
            "description": "The location in the request where the validation error occurred.",
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "maxItems": 100,
            "title": "Location",
            "type": "array"
          },
          "msg": {
            "description": "A human-readable description of the validation error.",
            "title": "Message",
            "type": "string"
          },
          "type": {
            "description": "A machine-readable error type identifier.",
            "title": "Error Type",
            "type": "string"
          }
        },
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError",
        "type": "object"
      },
      "maxItems": 100,
      "title": "Detail",
      "type": "array"
    }
  },
  "title": "HTTPValidationError",
  "type": "object"
}
```

HTTPValidationError

### Properties

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| detail | [ValidationError] | false | maxItems: 100 | List of validation errors. |

## IdleTimeoutTrigger

```
{
  "additionalProperties": false,
  "description": "Trigger based on time since the last event in the session. fires when no new events were added to the session within the configured ttl.",
  "properties": {
    "idle": {
      "description": "Time in seconds since last event.",
      "exclusiveMinimum": 0,
      "maximum": 63072000,
      "title": "Idle",
      "type": "integer"
    }
  },
  "required": [
    "idle"
  ],
  "title": "IdleTimeoutTrigger",
  "type": "object"
}
```

IdleTimeoutTrigger

### Properties

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| idle | integer | true | maximum: 63072000 | Time in seconds since last event. |

## LifecycleStrategiesDataModel

```
{
  "trigger": {
    "ttl": 86400
  },
  "type": "soft_delete"
}
```

LifecycleStrategiesDataModel

### Properties

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| opts | any | false |  | Optional strategy-specific configuration parameters. |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | object | false |  | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| trigger | any | true |  | Trigger condition. available: 'ttl' (time in seconds), 'eventcount', 'tokencount', 'idle'. |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | TTLTrigger | false |  | Trigger based on time-to-live (session age). fires when the session age exceeds the configured ttl threshold. |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | EventCountTrigger | false |  | Trigger based on event count. fires when the session's event count reaches or exceeds the configured threshold. |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | TokenCountTrigger | false |  | Trigger based on token count. fires when the session's total token count reaches or exceeds the configured threshold. tokens are calculated from event message content using tiktoken. |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | IdleTimeoutTrigger | false |  | Trigger based on time since the last event in the session. fires when no new events were added to the session within the configured ttl. |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| type | string | true |  | Strategy type. available: 'soft_delete'. |

### Enumerated Values

| Property | Value |
| --- | --- |
| type | [soft_delete, extract_memories] |

## LifecycleStrategyResponse

```
{
  "description": "Schema for lifecycle strategy in response. execution status is tracked in the strategy_executions table and can be queried separately if needed.",
  "properties": {
    "opts": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "description": "Strategy-specific configuration parameters.",
      "title": "Opts"
    },
    "trigger": {
      "anyOf": [
        {
          "additionalProperties": false,
          "description": "Trigger based on time-to-live (session age). fires when the session age exceeds the configured ttl threshold.",
          "properties": {
            "ttl": {
              "description": "Time-to-live in seconds.",
              "exclusiveMinimum": 0,
              "maximum": 63072000,
              "title": "Ttl",
              "type": "integer"
            }
          },
          "required": [
            "ttl"
          ],
          "title": "TTLTrigger",
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "Trigger based on event count. fires when the session's event count reaches or exceeds the configured threshold.",
          "properties": {
            "eventCount": {
              "description": "Event count threshold.",
              "exclusiveMinimum": 0,
              "maximum": 1000000,
              "title": "Eventcount",
              "type": "integer"
            }
          },
          "required": [
            "eventCount"
          ],
          "title": "EventCountTrigger",
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "Trigger based on token count. fires when the session's total token count reaches or exceeds the configured threshold. tokens are calculated from event message content using tiktoken.",
          "properties": {
            "tokenCount": {
              "description": "Token count threshold.",
              "exclusiveMinimum": 0,
              "maximum": 100000000,
              "title": "Tokencount",
              "type": "integer"
            }
          },
          "required": [
            "tokenCount"
          ],
          "title": "TokenCountTrigger",
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "Trigger based on time since the last event in the session. fires when no new events were added to the session within the configured ttl.",
          "properties": {
            "idle": {
              "description": "Time in seconds since last event.",
              "exclusiveMinimum": 0,
              "maximum": 63072000,
              "title": "Idle",
              "type": "integer"
            }
          },
          "required": [
            "idle"
          ],
          "title": "IdleTimeoutTrigger",
          "type": "object"
        }
      ],
      "description": "Trigger condition.",
      "title": "Trigger"
    },
    "type": {
      "description": "Strategy type.",
      "enum": [
        "soft_delete",
        "extract_memories"
      ],
      "title": "Type",
      "type": "string"
    }
  },
  "required": [
    "type",
    "trigger"
  ],
  "title": "LifecycleStrategyResponse",
  "type": "object"
}
```

LifecycleStrategyResponse

### Properties

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| opts | any | false |  | Strategy-specific configuration parameters. |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | object | false |  | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| trigger | any | true |  | Trigger condition. |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | TTLTrigger | false |  | Trigger based on time-to-live (session age). fires when the session age exceeds the configured ttl threshold. |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | EventCountTrigger | false |  | Trigger based on event count. fires when the session's event count reaches or exceeds the configured threshold. |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | TokenCountTrigger | false |  | Trigger based on token count. fires when the session's total token count reaches or exceeds the configured threshold. tokens are calculated from event message content using tiktoken. |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | IdleTimeoutTrigger | false |  | Trigger based on time since the last event in the session. fires when no new events were added to the session within the configured ttl. |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| type | string | true |  | Strategy type. |

### Enumerated Values

| Property | Value |
| --- | --- |
| type | [soft_delete, extract_memories] |

## MemoryCreate

```
{
  "description": "Request body for post /v1/memories — extracts facts from a conversation.",
  "properties": {
    "agentId": {
      "anyOf": [
        {
          "maxLength": 64,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Agentid"
    },
    "appId": {
      "anyOf": [
        {
          "maxLength": 64,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Appid"
    },
    "expirationDate": {
      "anyOf": [
        {
          "maxLength": 40,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Expirationdate"
    },
    "infer": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Infer"
    },
    "messages": {
      "items": {
        "description": "A single conversation message passed to the post /v1/memory endpoint.",
        "properties": {
          "content": {
            "maxLength": 50000,
            "minLength": 1,
            "title": "Content",
            "type": "string"
          },
          "role": {
            "enum": [
              "user",
              "assistant",
              "system"
            ],
            "title": "Role",
            "type": "string"
          }
        },
        "required": [
          "role",
          "content"
        ],
        "title": "Message",
        "type": "object"
      },
      "maxItems": 100,
      "minItems": 1,
      "title": "Messages",
      "type": "array"
    },
    "metadata": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Metadata"
    },
    "runId": {
      "anyOf": [
        {
          "maxLength": 64,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Runid"
    },
    "userId": {
      "maxLength": 64,
      "minLength": 1,
      "title": "Userid",
      "type": "string"
    }
  },
  "required": [
    "userId",
    "messages"
  ],
  "title": "MemoryCreate",
  "type": "object"
}
```

MemoryCreate

### Properties

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| agentId | any | false |  | none |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | string | false | maxLength: 64minLength: 1minLength: 1 | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| appId | any | false |  | none |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | string | false | maxLength: 64minLength: 1minLength: 1 | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| expirationDate | any | false |  | none |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | string | false | maxLength: 40 | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| infer | any | false |  | none |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | boolean | false |  | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| messages | [Message] | true | maxItems: 100minItems: 1 | [A single conversation message passed to the post /v1/memory endpoint.] |
| metadata | any | false |  | none |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | object | false |  | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| runId | any | false |  | none |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | string | false | maxLength: 64minLength: 1minLength: 1 | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| userId | string | true | maxLength: 64minLength: 1minLength: 1 | none |

## MemoryGetAll

```
{
  "description": "Request body for post /v2/memories extra=\"ignore\" is set because the mem0 client injects org_id/project_id fields that are not relevant for datarobot.",
  "properties": {
    "agentId": {
      "anyOf": [
        {
          "maxLength": 64,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Agentid"
    },
    "appId": {
      "anyOf": [
        {
          "maxLength": 64,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Appid"
    },
    "filters": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Filters"
    },
    "pageSize": {
      "anyOf": [
        {
          "maximum": 50,
          "minimum": 1,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Pagesize"
    },
    "runId": {
      "anyOf": [
        {
          "maxLength": 64,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Runid"
    },
    "topK": {
      "anyOf": [
        {
          "maximum": 50,
          "minimum": 1,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Topk"
    },
    "userId": {
      "anyOf": [
        {
          "maxLength": 64,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Userid"
    }
  },
  "title": "MemoryGetAll",
  "type": "object"
}
```

MemoryGetAll

### Properties

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| agentId | any | false |  | none |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | string | false | maxLength: 64minLength: 1minLength: 1 | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| appId | any | false |  | none |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | string | false | maxLength: 64minLength: 1minLength: 1 | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| filters | any | false |  | none |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | object | false |  | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| pageSize | any | false |  | none |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | integer | false | maximum: 50minimum: 1 | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| runId | any | false |  | none |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | string | false | maxLength: 64minLength: 1minLength: 1 | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| topK | any | false |  | none |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | integer | false | maximum: 50minimum: 1 | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| userId | any | false |  | none |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | string | false | maxLength: 64minLength: 1minLength: 1 | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

## MemorySearch

```
{
  "description": "Request body for post /v2/memories/search/ extra=\"ignore\" is set because the mem0 client injects org_id/project_id fields that are not relevant for datarobot.",
  "properties": {
    "agentId": {
      "anyOf": [
        {
          "maxLength": 64,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Agentid"
    },
    "appId": {
      "anyOf": [
        {
          "maxLength": 64,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Appid"
    },
    "filters": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Filters"
    },
    "query": {
      "maxLength": 2000,
      "minLength": 1,
      "title": "Query",
      "type": "string"
    },
    "rerank": {
      "default": true,
      "title": "Rerank",
      "type": "boolean"
    },
    "runId": {
      "anyOf": [
        {
          "maxLength": 64,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Runid"
    },
    "threshold": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Threshold"
    },
    "topK": {
      "anyOf": [
        {
          "maximum": 50,
          "minimum": 1,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Topk"
    },
    "userId": {
      "anyOf": [
        {
          "maxLength": 64,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Userid"
    }
  },
  "required": [
    "query"
  ],
  "title": "MemorySearch",
  "type": "object"
}
```

MemorySearch

### Properties

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| agentId | any | false |  | none |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | string | false | maxLength: 64minLength: 1minLength: 1 | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| appId | any | false |  | none |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | string | false | maxLength: 64minLength: 1minLength: 1 | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| filters | any | false |  | none |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | object | false |  | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| query | string | true | maxLength: 2000minLength: 1minLength: 1 | none |
| rerank | boolean | false |  | none |
| runId | any | false |  | none |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | string | false | maxLength: 64minLength: 1minLength: 1 | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| threshold | any | false |  | none |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | number | false |  | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| topK | any | false |  | none |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | integer | false | maximum: 50minimum: 1 | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| userId | any | false |  | none |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | string | false | maxLength: 64minLength: 1minLength: 1 | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

## MemorySpaceDeduplicationErrorResponse

```
{
  "description": "Body returned with HTTP 409 when a memory space create collides on `deduplicationkey`. carries enough context for an ha-replica caller to adopt the existing winner without a second round-trip: the live space's ID and a path to it.",
  "properties": {
    "deduplicationKey": {
      "description": "The deduplication key that triggered the conflict.",
      "title": "Deduplicationkey",
      "type": "string"
    },
    "detail": {
      "description": "Human-readable explanation of the conflict.",
      "title": "Detail",
      "type": "string"
    },
    "errorName": {
      "const": "MemorySpaceDeduplicationConflict",
      "default": "MemorySpaceDeduplicationConflict",
      "description": "Stable machine-readable error name. clients should switch on this, not detail.",
      "title": "Errorname",
      "type": "string"
    },
    "existingMemorySpaceId": {
      "anyOf": [
        {
          "format": "uuid",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "ID of the live memory space already holding the key, or null if it could not be resolved (e.g. concurrently soft-deleted).",
      "title": "Existingmemoryspaceid"
    },
    "existingMemorySpaceUrl": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Path to get the existing memory space. null when `existingmemoryspaceid` is null. mirrors the `location` response header (which is absolute).",
      "title": "Existingmemoryspaceurl"
    }
  },
  "required": [
    "detail",
    "deduplicationKey"
  ],
  "title": "MemorySpaceDeduplicationErrorResponse",
  "type": "object"
}
```

MemorySpaceDeduplicationErrorResponse

### Properties

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| deduplicationKey | string | true |  | The deduplication key that triggered the conflict. |
| detail | string | true |  | Human-readable explanation of the conflict. |
| errorName | string | false |  | Stable machine-readable error name. clients should switch on this, not detail. |
| existingMemorySpaceId | any | false |  | ID of the live memory space already holding the key, or null if it could not be resolved (e.g. concurrently soft-deleted). |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | string(uuid) | false |  | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| existingMemorySpaceUrl | any | false |  | Path to get the existing memory space. null when existingmemoryspaceid is null. mirrors the location response header (which is absolute). |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | string | false |  | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

## MemorySpaceResponse

```
{
  "description": "Response schema for a single memory space.",
  "properties": {
    "createdAt": {
      "description": "Memory space creation timestamp.",
      "format": "date-time",
      "title": "Createdat",
      "type": "string"
    },
    "customInstructions": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Custom prompt instructions used for fact extraction. null means the default mem0 extraction prompt is used.",
      "title": "Custominstructions"
    },
    "deduplicationKey": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Deduplication key, unique per user, if one was set.",
      "title": "Deduplicationkey"
    },
    "description": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Memory space description.",
      "title": "Description"
    },
    "llmBaseUrl": {
      "anyOf": [
        {
          "format": "uri",
          "maxLength": 2083,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Chat API url to use for memory extraction.",
      "title": "Llmbaseurl"
    },
    "llmModelName": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "LLM model configured for memory extraction.",
      "title": "Llmmodelname"
    },
    "memorySpaceId": {
      "description": "Unique memory space identifier.",
      "format": "uuid",
      "title": "Memoryspaceid",
      "type": "string"
    },
    "tenantId": {
      "description": "Tenant identifier.",
      "format": "uuid",
      "title": "Tenantid",
      "type": "string"
    },
    "userId": {
      "description": "ID of the user who owns this memory space.",
      "title": "Userid",
      "type": "string"
    }
  },
  "required": [
    "memorySpaceId",
    "userId",
    "tenantId",
    "createdAt"
  ],
  "title": "MemorySpaceResponse",
  "type": "object"
}
```

MemorySpaceResponse

### Properties

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| createdAt | string(date-time) | true |  | Memory space creation timestamp. |
| customInstructions | any | false |  | Custom prompt instructions used for fact extraction. null means the default mem0 extraction prompt is used. |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | string | false |  | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| deduplicationKey | any | false |  | Deduplication key, unique per user, if one was set. |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | string | false |  | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| description | any | false |  | Memory space description. |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | string | false |  | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| llmBaseUrl | any | false |  | Chat API url to use for memory extraction. |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | string(uri) | false | maxLength: 2083minLength: 1minLength: 1 | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| llmModelName | any | false |  | LLM model configured for memory extraction. |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | string | false |  | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| memorySpaceId | string(uuid) | true |  | Unique memory space identifier. |
| tenantId | string(uuid) | true |  | Tenant identifier. |
| userId | string | true |  | ID of the user who owns this memory space. |

## MemoryUpdate

```
{
  "description": "Request body for put /v1/memories/{memory_id}. metadata and timestamp are accepted for mem0 client compatibility but not forwarded.",
  "properties": {
    "metadata": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Metadata"
    },
    "text": {
      "maxLength": 10000,
      "minLength": 1,
      "title": "Text",
      "type": "string"
    },
    "timestamp": {
      "anyOf": [
        {
          "maxLength": 40,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Timestamp"
    }
  },
  "required": [
    "text"
  ],
  "title": "MemoryUpdate",
  "type": "object"
}
```

MemoryUpdate

### Properties

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| metadata | any | false |  | none |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | object | false |  | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| text | string | true | maxLength: 10000minLength: 1minLength: 1 | none |
| timestamp | any | false |  | none |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | string | false | maxLength: 40 | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

## Message

```
{
  "description": "A single conversation message passed to the post /v1/memory endpoint.",
  "properties": {
    "content": {
      "maxLength": 50000,
      "minLength": 1,
      "title": "Content",
      "type": "string"
    },
    "role": {
      "enum": [
        "user",
        "assistant",
        "system"
      ],
      "title": "Role",
      "type": "string"
    }
  },
  "required": [
    "role",
    "content"
  ],
  "title": "Message",
  "type": "object"
}
```

Message

### Properties

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| content | string | true | maxLength: 50000minLength: 1minLength: 1 | none |
| role | string | true |  | none |

### Enumerated Values

| Property | Value |
| --- | --- |
| role | [user, assistant, system] |

## PaginatedResponse_EventResponse_

```
{
  "properties": {
    "items": {
      "description": "List of items for the current page.",
      "items": {
        "description": "Schema for event response.",
        "properties": {
          "body": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Event body content.",
            "title": "Body"
          },
          "createdAt": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Event creation timestamp.",
            "title": "Createdat"
          },
          "emitterId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Emitter identifier.",
            "title": "Emitterid"
          },
          "emitterType": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Emitter type.",
            "title": "Emittertype"
          },
          "eventType": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Event type.",
            "title": "Eventtype"
          },
          "sequenceId": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Event sequence number within the session.",
            "title": "Sequenceid"
          }
        },
        "title": "EventResponse",
        "type": "object"
      },
      "maxItems": 100,
      "title": "Items",
      "type": "array"
    },
    "limit": {
      "description": "Maximum number of returned items.",
      "exclusiveMinimum": 0,
      "title": "Limit",
      "type": "integer"
    },
    "offset": {
      "description": "Number of skipped items.",
      "minimum": 0,
      "title": "Offset",
      "type": "integer"
    },
    "total": {
      "description": "Total number of matching items.",
      "title": "Total",
      "type": "integer"
    }
  },
  "required": [
    "items",
    "offset",
    "limit",
    "total"
  ],
  "title": "PaginatedResponse[EventResponse]",
  "type": "object"
}
```

PaginatedResponse[EventResponse]

### Properties

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| items | [EventResponse] | true | maxItems: 100 | List of items for the current page. |
| limit | integer | true |  | Maximum number of returned items. |
| offset | integer | true | minimum: 0 | Number of skipped items. |
| total | integer | true |  | Total number of matching items. |

## PaginatedResponse_MemorySpaceResponse_

```
{
  "properties": {
    "items": {
      "description": "List of items for the current page.",
      "items": {
        "description": "Response schema for a single memory space.",
        "properties": {
          "createdAt": {
            "description": "Memory space creation timestamp.",
            "format": "date-time",
            "title": "Createdat",
            "type": "string"
          },
          "customInstructions": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Custom prompt instructions used for fact extraction. null means the default mem0 extraction prompt is used.",
            "title": "Custominstructions"
          },
          "deduplicationKey": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Deduplication key, unique per user, if one was set.",
            "title": "Deduplicationkey"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Memory space description.",
            "title": "Description"
          },
          "llmBaseUrl": {
            "anyOf": [
              {
                "format": "uri",
                "maxLength": 2083,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Chat API url to use for memory extraction.",
            "title": "Llmbaseurl"
          },
          "llmModelName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "LLM model configured for memory extraction.",
            "title": "Llmmodelname"
          },
          "memorySpaceId": {
            "description": "Unique memory space identifier.",
            "format": "uuid",
            "title": "Memoryspaceid",
            "type": "string"
          },
          "tenantId": {
            "description": "Tenant identifier.",
            "format": "uuid",
            "title": "Tenantid",
            "type": "string"
          },
          "userId": {
            "description": "ID of the user who owns this memory space.",
            "title": "Userid",
            "type": "string"
          }
        },
        "required": [
          "memorySpaceId",
          "userId",
          "tenantId",
          "createdAt"
        ],
        "title": "MemorySpaceResponse",
        "type": "object"
      },
      "maxItems": 100,
      "title": "Items",
      "type": "array"
    },
    "limit": {
      "description": "Maximum number of returned items.",
      "exclusiveMinimum": 0,
      "title": "Limit",
      "type": "integer"
    },
    "offset": {
      "description": "Number of skipped items.",
      "minimum": 0,
      "title": "Offset",
      "type": "integer"
    },
    "total": {
      "description": "Total number of matching items.",
      "title": "Total",
      "type": "integer"
    }
  },
  "required": [
    "items",
    "offset",
    "limit",
    "total"
  ],
  "title": "PaginatedResponse[MemorySpaceResponse]",
  "type": "object"
}
```

PaginatedResponse[MemorySpaceResponse]

### Properties

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| items | [MemorySpaceResponse] | true | maxItems: 100 | List of items for the current page. |
| limit | integer | true |  | Maximum number of returned items. |
| offset | integer | true | minimum: 0 | Number of skipped items. |
| total | integer | true |  | Total number of matching items. |

## PaginatedResponse_SessionResponse_

```
{
  "properties": {
    "items": {
      "description": "List of items for the current page.",
      "items": {
        "description": "Schema for session response.",
        "properties": {
          "createdAt": {
            "description": "Session creation timestamp.",
            "format": "date-time",
            "title": "Createdat",
            "type": "string"
          },
          "deduplicationKey": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Deduplication key, unique within the memory space, if one was set.",
            "title": "Deduplicationkey"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Session description.",
            "title": "Description"
          },
          "id": {
            "description": "Session id.",
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "lifecycleStrategies": {
            "description": "Lifecycle strategies associated with this session.",
            "items": {
              "description": "Schema for lifecycle strategy in response. execution status is tracked in the strategy_executions table and can be queried separately if needed.",
              "properties": {
                "opts": {
                  "anyOf": [
                    {
                      "additionalProperties": true,
                      "type": "object"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Strategy-specific configuration parameters.",
                  "title": "Opts"
                },
                "trigger": {
                  "anyOf": [
                    {
                      "additionalProperties": false,
                      "description": "Trigger based on time-to-live (session age). fires when the session age exceeds the configured ttl threshold.",
                      "properties": {
                        "ttl": {
                          "description": "Time-to-live in seconds.",
                          "exclusiveMinimum": 0,
                          "maximum": 63072000,
                          "title": "Ttl",
                          "type": "integer"
                        }
                      },
                      "required": [
                        "ttl"
                      ],
                      "title": "TTLTrigger",
                      "type": "object"
                    },
                    {
                      "additionalProperties": false,
                      "description": "Trigger based on event count. fires when the session's event count reaches or exceeds the configured threshold.",
                      "properties": {
                        "eventCount": {
                          "description": "Event count threshold.",
                          "exclusiveMinimum": 0,
                          "maximum": 1000000,
                          "title": "Eventcount",
                          "type": "integer"
                        }
                      },
                      "required": [
                        "eventCount"
                      ],
                      "title": "EventCountTrigger",
                      "type": "object"
                    },
                    {
                      "additionalProperties": false,
                      "description": "Trigger based on token count. fires when the session's total token count reaches or exceeds the configured threshold. tokens are calculated from event message content using tiktoken.",
                      "properties": {
                        "tokenCount": {
                          "description": "Token count threshold.",
                          "exclusiveMinimum": 0,
                          "maximum": 100000000,
                          "title": "Tokencount",
                          "type": "integer"
                        }
                      },
                      "required": [
                        "tokenCount"
                      ],
                      "title": "TokenCountTrigger",
                      "type": "object"
                    },
                    {
                      "additionalProperties": false,
                      "description": "Trigger based on time since the last event in the session. fires when no new events were added to the session within the configured ttl.",
                      "properties": {
                        "idle": {
                          "description": "Time in seconds since last event.",
                          "exclusiveMinimum": 0,
                          "maximum": 63072000,
                          "title": "Idle",
                          "type": "integer"
                        }
                      },
                      "required": [
                        "idle"
                      ],
                      "title": "IdleTimeoutTrigger",
                      "type": "object"
                    }
                  ],
                  "description": "Trigger condition.",
                  "title": "Trigger"
                },
                "type": {
                  "description": "Strategy type.",
                  "enum": [
                    "soft_delete",
                    "extract_memories"
                  ],
                  "title": "Type",
                  "type": "string"
                }
              },
              "required": [
                "type",
                "trigger"
              ],
              "title": "LifecycleStrategyResponse",
              "type": "object"
            },
            "maxItems": 5,
            "title": "Lifecyclestrategies",
            "type": "array"
          },
          "metadata": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Custom metadata as key-value pairs for storing application-specific data.",
            "title": "Metadata"
          },
          "participants": {
            "description": "List of participant ids.",
            "items": {
              "type": "string"
            },
            "maxItems": 50,
            "title": "Participants",
            "type": "array"
          },
          "version": {
            "default": 1,
            "description": "Monotonic version for optimistic concurrency. echo back as `if-match: \"<version>\"` on patch to detect lost updates.",
            "minimum": 1,
            "title": "Version",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "participants",
          "createdAt"
        ],
        "title": "SessionResponse",
        "type": "object"
      },
      "maxItems": 100,
      "title": "Items",
      "type": "array"
    },
    "limit": {
      "description": "Maximum number of returned items.",
      "exclusiveMinimum": 0,
      "title": "Limit",
      "type": "integer"
    },
    "offset": {
      "description": "Number of skipped items.",
      "minimum": 0,
      "title": "Offset",
      "type": "integer"
    },
    "total": {
      "description": "Total number of matching items.",
      "title": "Total",
      "type": "integer"
    }
  },
  "required": [
    "items",
    "offset",
    "limit",
    "total"
  ],
  "title": "PaginatedResponse[SessionResponse]",
  "type": "object"
}
```

PaginatedResponse[SessionResponse]

### Properties

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| items | [SessionResponse] | true | maxItems: 100 | List of items for the current page. |
| limit | integer | true |  | Maximum number of returned items. |
| offset | integer | true | minimum: 0 | Number of skipped items. |
| total | integer | true |  | Total number of matching items. |

## SessionDeduplicationErrorResponse

```
{
  "description": "Body returned with HTTP 409 when a session create collides on `deduplicationkey`. carries enough context for an ha-replica caller to adopt the existing winner without a second round-trip: the live session's ID and a path to it.",
  "properties": {
    "deduplicationKey": {
      "description": "The deduplication key that triggered the conflict.",
      "title": "Deduplicationkey",
      "type": "string"
    },
    "detail": {
      "description": "Human-readable explanation of the conflict.",
      "title": "Detail",
      "type": "string"
    },
    "errorName": {
      "const": "SessionDeduplicationConflict",
      "default": "SessionDeduplicationConflict",
      "description": "Stable machine-readable error name. clients should switch on this, not detail.",
      "title": "Errorname",
      "type": "string"
    },
    "existingSessionId": {
      "anyOf": [
        {
          "format": "uuid",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "ID of the live session already holding the key, or null if it could not be resolved (e.g. concurrently soft-deleted).",
      "title": "Existingsessionid"
    },
    "existingSessionUrl": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Path to get the existing session. null when `existingsessionid` is null. mirrors the `location` response header (which is absolute).",
      "title": "Existingsessionurl"
    }
  },
  "required": [
    "detail",
    "deduplicationKey"
  ],
  "title": "SessionDeduplicationErrorResponse",
  "type": "object"
}
```

SessionDeduplicationErrorResponse

### Properties

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| deduplicationKey | string | true |  | The deduplication key that triggered the conflict. |
| detail | string | true |  | Human-readable explanation of the conflict. |
| errorName | string | false |  | Stable machine-readable error name. clients should switch on this, not detail. |
| existingSessionId | any | false |  | ID of the live session already holding the key, or null if it could not be resolved (e.g. concurrently soft-deleted). |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | string(uuid) | false |  | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| existingSessionUrl | any | false |  | Path to get the existing session. null when existingsessionid is null. mirrors the location response header (which is absolute). |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | string | false |  | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

## SessionResponse

```
{
  "description": "Schema for session response.",
  "properties": {
    "createdAt": {
      "description": "Session creation timestamp.",
      "format": "date-time",
      "title": "Createdat",
      "type": "string"
    },
    "deduplicationKey": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Deduplication key, unique within the memory space, if one was set.",
      "title": "Deduplicationkey"
    },
    "description": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Session description.",
      "title": "Description"
    },
    "id": {
      "description": "Session id.",
      "format": "uuid",
      "title": "Id",
      "type": "string"
    },
    "lifecycleStrategies": {
      "description": "Lifecycle strategies associated with this session.",
      "items": {
        "description": "Schema for lifecycle strategy in response. execution status is tracked in the strategy_executions table and can be queried separately if needed.",
        "properties": {
          "opts": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Strategy-specific configuration parameters.",
            "title": "Opts"
          },
          "trigger": {
            "anyOf": [
              {
                "additionalProperties": false,
                "description": "Trigger based on time-to-live (session age). fires when the session age exceeds the configured ttl threshold.",
                "properties": {
                  "ttl": {
                    "description": "Time-to-live in seconds.",
                    "exclusiveMinimum": 0,
                    "maximum": 63072000,
                    "title": "Ttl",
                    "type": "integer"
                  }
                },
                "required": [
                  "ttl"
                ],
                "title": "TTLTrigger",
                "type": "object"
              },
              {
                "additionalProperties": false,
                "description": "Trigger based on event count. fires when the session's event count reaches or exceeds the configured threshold.",
                "properties": {
                  "eventCount": {
                    "description": "Event count threshold.",
                    "exclusiveMinimum": 0,
                    "maximum": 1000000,
                    "title": "Eventcount",
                    "type": "integer"
                  }
                },
                "required": [
                  "eventCount"
                ],
                "title": "EventCountTrigger",
                "type": "object"
              },
              {
                "additionalProperties": false,
                "description": "Trigger based on token count. fires when the session's total token count reaches or exceeds the configured threshold. tokens are calculated from event message content using tiktoken.",
                "properties": {
                  "tokenCount": {
                    "description": "Token count threshold.",
                    "exclusiveMinimum": 0,
                    "maximum": 100000000,
                    "title": "Tokencount",
                    "type": "integer"
                  }
                },
                "required": [
                  "tokenCount"
                ],
                "title": "TokenCountTrigger",
                "type": "object"
              },
              {
                "additionalProperties": false,
                "description": "Trigger based on time since the last event in the session. fires when no new events were added to the session within the configured ttl.",
                "properties": {
                  "idle": {
                    "description": "Time in seconds since last event.",
                    "exclusiveMinimum": 0,
                    "maximum": 63072000,
                    "title": "Idle",
                    "type": "integer"
                  }
                },
                "required": [
                  "idle"
                ],
                "title": "IdleTimeoutTrigger",
                "type": "object"
              }
            ],
            "description": "Trigger condition.",
            "title": "Trigger"
          },
          "type": {
            "description": "Strategy type.",
            "enum": [
              "soft_delete",
              "extract_memories"
            ],
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "type",
          "trigger"
        ],
        "title": "LifecycleStrategyResponse",
        "type": "object"
      },
      "maxItems": 5,
      "title": "Lifecyclestrategies",
      "type": "array"
    },
    "metadata": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "description": "Custom metadata as key-value pairs for storing application-specific data.",
      "title": "Metadata"
    },
    "participants": {
      "description": "List of participant ids.",
      "items": {
        "type": "string"
      },
      "maxItems": 50,
      "title": "Participants",
      "type": "array"
    },
    "version": {
      "default": 1,
      "description": "Monotonic version for optimistic concurrency. echo back as `if-match: \"<version>\"` on patch to detect lost updates.",
      "minimum": 1,
      "title": "Version",
      "type": "integer"
    }
  },
  "required": [
    "id",
    "participants",
    "createdAt"
  ],
  "title": "SessionResponse",
  "type": "object"
}
```

SessionResponse

### Properties

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| createdAt | string(date-time) | true |  | Session creation timestamp. |
| deduplicationKey | any | false |  | Deduplication key, unique within the memory space, if one was set. |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | string | false |  | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| description | any | false |  | Session description. |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | string | false |  | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| id | string(uuid) | true |  | Session id. |
| lifecycleStrategies | [LifecycleStrategyResponse] | false | maxItems: 5 | Lifecycle strategies associated with this session. |
| metadata | any | false |  | Custom metadata as key-value pairs for storing application-specific data. |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | object | false |  | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| participants | [string] | true | maxItems: 50 | List of participant ids. |
| version | integer | false | minimum: 1 | Monotonic version for optimistic concurrency. echo back as if-match: "<version>" on patch to detect lost updates. |

## TTLTrigger

```
{
  "additionalProperties": false,
  "description": "Trigger based on time-to-live (session age). fires when the session age exceeds the configured ttl threshold.",
  "properties": {
    "ttl": {
      "description": "Time-to-live in seconds.",
      "exclusiveMinimum": 0,
      "maximum": 63072000,
      "title": "Ttl",
      "type": "integer"
    }
  },
  "required": [
    "ttl"
  ],
  "title": "TTLTrigger",
  "type": "object"
}
```

TTLTrigger

### Properties

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| ttl | integer | true | maximum: 63072000 | Time-to-live in seconds. |

## TokenCountTrigger

```
{
  "additionalProperties": false,
  "description": "Trigger based on token count. fires when the session's total token count reaches or exceeds the configured threshold. tokens are calculated from event message content using tiktoken.",
  "properties": {
    "tokenCount": {
      "description": "Token count threshold.",
      "exclusiveMinimum": 0,
      "maximum": 100000000,
      "title": "Tokencount",
      "type": "integer"
    }
  },
  "required": [
    "tokenCount"
  ],
  "title": "TokenCountTrigger",
  "type": "object"
}
```

TokenCountTrigger

### Properties

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| tokenCount | integer | true | maximum: 100000000 | Token count threshold. |

## UpdateEventRequest

```
{
  "description": "Schema for create event request.",
  "properties": {
    "body": {
      "anyOf": [
        {
          "additionalProperties": true,
          "description": "Body for all event types. content field is mandatory, any additional fields are allowed.",
          "properties": {
            "content": {
              "description": "Event body content text.",
              "maxLength": 100000,
              "minLength": 1,
              "title": "Content",
              "type": "string"
            }
          },
          "required": [
            "content"
          ],
          "title": "EventBody",
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "description": "Updated event body."
    },
    "emitter": {
      "anyOf": [
        {
          "description": "Schema for emitter data.",
          "properties": {
            "id": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Emitter identifier (objectid format).",
              "title": "Id"
            },
            "type": {
              "description": "Emitter type. one of: 'user', 'agent'.",
              "enum": [
                "user",
                "agent"
              ],
              "title": "Type",
              "type": "string"
            }
          },
          "required": [
            "type"
          ],
          "title": "EmitterDataModel",
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "description": "Updated emitter information."
    },
    "type": {
      "anyOf": [
        {
          "enum": [
            "message",
            "tool_output",
            "status"
          ],
          "title": "EventType",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Updated event type."
    }
  },
  "title": "UpdateEventRequest",
  "type": "object"
}
```

UpdateEventRequest

### Properties

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| body | any | false |  | Updated event body. |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | EventBody | false |  | Body for all event types. content field is mandatory, any additional fields are allowed. |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| emitter | any | false |  | Updated emitter information. |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | EmitterDataModel | false |  | Schema for emitter data. |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| type | any | false |  | Updated event type. |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | EventType | false |  | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

## UpdateMemorySpaceRequest

```
{
  "additionalProperties": false,
  "description": "Request body for partially updating a memory space.",
  "properties": {
    "customInstructions": {
      "anyOf": [
        {
          "maxLength": 10000,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Updated custom prompt instructions used for fact extraction. pass null to clear and revert to mem0's default extraction prompt.",
      "title": "Custominstructions"
    },
    "description": {
      "anyOf": [
        {
          "maxLength": 1000,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Updated description for the memory space.",
      "title": "Description"
    },
    "llmBaseUrl": {
      "anyOf": [
        {
          "format": "uri",
          "maxLength": 2083,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Chat API url to use for memory extraction.",
      "title": "Llmbaseurl"
    },
    "llmModelName": {
      "anyOf": [
        {
          "maxLength": 200,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Updated LLM model name. non-reasoning models such as ``gpt-4o`` are recommended. reasoning-capable models are significantly slower for fact extraction without producing meaningfully better results.",
      "title": "Llmmodelname"
    }
  },
  "title": "UpdateMemorySpaceRequest",
  "type": "object"
}
```

UpdateMemorySpaceRequest

### Properties

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| customInstructions | any | false |  | Updated custom prompt instructions used for fact extraction. pass null to clear and revert to mem0's default extraction prompt. |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | string | false | maxLength: 10000 | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| description | any | false |  | Updated description for the memory space. |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | string | false | maxLength: 1000 | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| llmBaseUrl | any | false |  | Chat API url to use for memory extraction. |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | string(uri) | false | maxLength: 2083minLength: 1minLength: 1 | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| llmModelName | any | false |  | Updated LLM model name. non-reasoning models such as gpt-4o are recommended. reasoning-capable models are significantly slower for fact extraction without producing meaningfully better results. |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | string | false | maxLength: 200 | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

## UpdateSessionRequest

```
{
  "description": "Schema for session partial patch-updates.",
  "properties": {
    "description": {
      "anyOf": [
        {
          "maxLength": 1000,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "New session description.",
      "title": "Description"
    },
    "metadata": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "description": "Custom metadata as key-value pairs for storing application-specific data.",
      "title": "Metadata"
    }
  },
  "title": "UpdateSessionRequest",
  "type": "object"
}
```

UpdateSessionRequest

### Properties

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| description | any | false |  | New session description. |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | string | false | maxLength: 1000 | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| metadata | any | false |  | Custom metadata as key-value pairs for storing application-specific data. |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | object | false |  | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | null | false |  | none |

## ValidationError

```
{
  "properties": {
    "ctx": {
      "description": "Additional context about the validation error.",
      "title": "Context",
      "type": "object"
    },
    "input": {
      "additionalProperties": true,
      "description": "The input value that caused the validation error.",
      "title": "Input",
      "type": "object"
    },
    "loc": {
      "description": "The location in the request where the validation error occurred.",
      "items": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "integer"
          }
        ]
      },
      "maxItems": 100,
      "title": "Location",
      "type": "array"
    },
    "msg": {
      "description": "A human-readable description of the validation error.",
      "title": "Message",
      "type": "string"
    },
    "type": {
      "description": "A machine-readable error type identifier.",
      "title": "Error Type",
      "type": "string"
    }
  },
  "required": [
    "loc",
    "msg",
    "type"
  ],
  "title": "ValidationError",
  "type": "object"
}
```

ValidationError

### Properties

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| ctx | object | false |  | Additional context about the validation error. |
| input | object | false |  | The input value that caused the validation error. |
| loc | [anyOf] | true | maxItems: 100 | The location in the request where the validation error occurred. |

anyOf

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | string | false |  | none |

or

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| » anonymous | integer | false |  | none |

continued

| Name | Type | Required | Restrictions | Description |
| --- | --- | --- | --- | --- |
| msg | string | true |  | A human-readable description of the validation error. |
| type | string | true |  | A machine-readable error type identifier. |
