---
title: "Update Memory V1"
method: PUT
path: "/v1/memory/{memory_id}"
tags: ["v1", "Memory"]
---

# Update Memory V1

`PUT /v1/memory/{memory_id}`

Update an existing memory item by ID.
    
    **Authentication Required**:
    One of the following authentication methods must be used:
    - Bearer token in `Authorization` header
    - API Key in `X-API-Key` header
    - Session token in `X-Session-Token` header
    
    **Required Headers**:
    - Content-Type: application/json
    - X-Client-Type: (e.g., 'papr_plugin', 'browser_extension')
    
    The API validates content size against MAX_CONTENT_LENGTH environment variable (defaults to 15000 bytes).

## Path parameters

- `memory_id` string, required

## Request body

- UpdateMemoryRequest — Request model for updating an existing memory
  - `content` string, nullable — The new content of the memory item
  - `type` 'text' | 'code_snippet' | 'document' — Valid memory types
  - `metadata` MemoryMetadata — Metadata for memory request
    - `hierarchical_structures` string, nullable — Hierarchical structures to enable navigation from broad topics to specific ones
    - `createdAt` string, nullable — ISO datetime when the memory was created
    - `location` string, nullable
    - `topics` string[], nullable
    - `emoji tags` string[], nullable
    - `emotion tags` string[], nullable
    - `conversationId` string, nullable
    - `sourceUrl` string, nullable
    - `role` 'user' | 'assistant' — Role of the message sender
    - `category` union — Memory category based on role. For users: preference, task, goal, fact, context. For assistants: skills, learning, task, goal, fact, context.
      - 'preference' | 'task' | 'goal' | 'fact' | 'context' — Memory categories for user messages
      - 'skills' | 'learning' | 'task' | 'goal' | 'fact' | 'context' — Memory categories for assistant messages
    - `user_id` string, nullable
    - `external_user_id` string, nullable
    - `external_user_read_access` string[], nullable
    - `external_user_write_access` string[], nullable
    - `user_read_access` string[], nullable
    - `user_write_access` string[], nullable
    - `workspace_read_access` string[], nullable
    - `workspace_write_access` string[], nullable
    - `role_read_access` string[], nullable
    - `role_write_access` string[], nullable
    - `namespace_read_access` string[], nullable
    - `namespace_write_access` string[], nullable
    - `organization_read_access` string[], nullable
    - `organization_write_access` string[], nullable
    - `pageId` string, nullable
    - `sourceType` string, nullable
    - `workspace_id` string, nullable
    - `upload_id` string, nullable — Upload ID for document processing workflows
    - `organization_id` string, nullable
    - `namespace_id` string, nullable
    - `sessionId` string, nullable
    - `post` string, nullable
    - `userMessage` string, nullable
    - `assistantMessage` string, nullable
    - `relatedGoals` string[], nullable
    - `relatedUseCases` string[], nullable
    - `relatedSteps` string[], nullable
    - `goalClassificationScores` number[], nullable
    - `useCaseClassificationScores` number[], nullable
    - `stepClassificationScores` number[], nullable
    - `customMetadata` object, nullable — Optional object for arbitrary custom metadata fields. Only string, number, boolean, or list of strings allowed. Nested dicts are not allowed.
  - `context` ContextItem[], nullable — Updated context for the memory item
    - `role` 'user' | 'assistant', required
    - `content` string, required
  - `relationships_json` RelationshipItem[], nullable — Updated relationships for Graph DB (neo4J)
    - `relation_type` string, required
    - `related_item_id` string, nullable
    - `relationship_type` 'previous_memory_item_id' | 'all_previous_memory_items' | 'link_to_id' — Enum for relationship types
    - `related_item_type` string, nullable — Legacy field - not used in processing
    - `metadata` object
  - `organization_id` string, nullable — Optional organization ID for multi-tenant memory scoping. When provided, update is scoped to memories within this organization.
  - `namespace_id` string, nullable — Optional namespace ID for multi-tenant memory scoping. When provided, update is scoped to memories within this namespace.

## Response `200`

Memory successfully updated

- UpdateMemoryResponse — Unified response model for update_memory API endpoint (success or error).
  - `code` integer — HTTP status code
  - `status` string — 'success' or 'error'
  - `memory_items` UpdateMemoryItem[], nullable — List of updated memory items if successful
    - `objectId` string, required
    - `memoryId` string, required
    - `content` string, nullable
    - `updatedAt` string, date-time, required
    - `memoryChunkIds` string[], nullable
    - `metadata` MemoryMetadata — Metadata for memory request
      - `hierarchical_structures` string, nullable — Hierarchical structures to enable navigation from broad topics to specific ones
      - `createdAt` string, nullable — ISO datetime when the memory was created
      - `location` string, nullable
      - `topics` string[], nullable
      - `emoji tags` string[], nullable
      - `emotion tags` string[], nullable
      - `conversationId` string, nullable
      - `sourceUrl` string, nullable
      - `role` 'user' | 'assistant' — Role of the message sender
      - `category` union — Memory category based on role. For users: preference, task, goal, fact, context. For assistants: skills, learning, task, goal, fact, context.
        - 'preference' | 'task' | 'goal' | 'fact' | 'context' — Memory categories for user messages
        - 'skills' | 'learning' | 'task' | 'goal' | 'fact' | 'context' — Memory categories for assistant messages
      - `user_id` string, nullable
      - `external_user_id` string, nullable
      - `external_user_read_access` string[], nullable
      - `external_user_write_access` string[], nullable
      - `user_read_access` string[], nullable
      - `user_write_access` string[], nullable
      - `workspace_read_access` string[], nullable
      - `workspace_write_access` string[], nullable
      - `role_read_access` string[], nullable
      - `role_write_access` string[], nullable
      - `namespace_read_access` string[], nullable
      - `namespace_write_access` string[], nullable
      - `organization_read_access` string[], nullable
      - `organization_write_access` string[], nullable
      - `pageId` string, nullable
      - `sourceType` string, nullable
      - `workspace_id` string, nullable
      - `upload_id` string, nullable — Upload ID for document processing workflows
      - `organization_id` string, nullable
      - `namespace_id` string, nullable
      - `sessionId` string, nullable
      - `post` string, nullable
      - `userMessage` string, nullable
      - `assistantMessage` string, nullable
      - `relatedGoals` string[], nullable
      - `relatedUseCases` string[], nullable
      - `relatedSteps` string[], nullable
      - `goalClassificationScores` number[], nullable
      - `useCaseClassificationScores` number[], nullable
      - `stepClassificationScores` number[], nullable
      - `customMetadata` object, nullable — Optional object for arbitrary custom metadata fields. Only string, number, boolean, or list of strings allowed. Nested dicts are not allowed.
  - `error` string, nullable — Error message if failed
  - `details` unknown
  - `message` string, nullable — Status message
  - `status_obj` SystemUpdateStatus — Status of update operation for each system
    - `pinecone` boolean
    - `neo4j` boolean
    - `parse` boolean

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `404` — Memory not found
- `413` — Content too large
- `422` — Validation Error
- `500` — Internal server error

## Changes

- **2025-11-19** `2422ab514a9d` — 28 info
  - added the new optional request property `metadata/anyOf[subschema #1: MemoryMetadata]/namespace_read_access`
  - added the new optional request property `metadata/anyOf[subschema #1: MemoryMetadata]/namespace_write_access`
  - added the new optional request property `metadata/anyOf[subschema #1: MemoryMetadata]/organization_read_access`
  - added the new optional request property `metadata/anyOf[subschema #1: MemoryMetadata]/organization_write_access`
  - …24 more
- **2025-11-07** `14ff13755871` — 37 info
  - added the new optional request property `metadata/anyOf[subschema #1: MemoryMetadata]/category`
  - added the new optional request property `metadata/anyOf[subschema #1: MemoryMetadata]/namespace_id`
  - added the new optional request property `metadata/anyOf[subschema #1: MemoryMetadata]/organization_id`
  - added the new optional request property `metadata/anyOf[subschema #1: MemoryMetadata]/role`
  - …33 more

[Change history](https://skmtc.dev/papr-ai/apis/papr-memory-api/changes/v1/memory/:memory_id/put.md)

---

[API](https://skmtc.dev/papr-ai/apis/papr-memory-api.md) · [All operations](https://skmtc.dev/papr-ai/apis/papr-memory-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/papr-ai/papr-memory-api/revisions/ea5bcad7e1ee/schema)
