> ## Documentation Index
> Fetch the complete documentation index at: https://docs.memcontext.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Update a memory

> Update a memory's content, category, or project. If only metadata changes,
a simple update is performed. If content changes, the system re-runs the
classification flow against similar memories and may supersede or relate to them.




## OpenAPI

````yaml /openapi.yaml patch /api/memories/{id}
openapi: 3.1.0
info:
  title: MemContext API
  version: 1.1.0
  description: |
    REST API for persistent, evolving AI memory. Save, search, and manage
    memories with automatic deduplication, version chains, and hybrid retrieval.
servers:
  - url: https://api.memcontext.in
    description: Production
security:
  - ApiKeyAuth: []
tags:
  - name: Memories
    description: Save, search, list, update, and delete memories.
  - name: History
    description: Inspect how memories evolve over time.
  - name: Feedback
    description: Rate retrieval quality to improve future results.
  - name: Profiles
    description: Pre-aggregated user context from memory.
  - name: Workspaces
    description: >-
      Company/team account boundaries for billing, members, API keys, and
      vaults.
  - name: API Keys
    description: Workspace-bound API keys for server-side integrations.
  - name: Subscription
    description: Workspace-owned billing and member-memory limits.
  - name: Context Vault
    description: Document ingestion and workspace RAG retrieval.
paths:
  /api/memories/{id}:
    patch:
      tags:
        - Memories
      summary: Update a memory
      description: >
        Update a memory's content, category, or project. If only metadata
        changes,

        a simple update is performed. If content changes, the system re-runs the

        classification flow against similar memories and may supersede or relate
        to them.
      operationId: updateMemory
      parameters:
        - $ref: '#/components/parameters/MemoryId'
        - in: query
          name: scope
          schema:
            type: string
            maxLength: 200
          description: >-
            Hard isolation boundary. When provided, the memory must belong to
            this scope.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateMemoryRequest'
      responses:
        '200':
          description: Update result.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateMemoryResponse'
        '404':
          description: Memory not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  parameters:
    MemoryId:
      in: path
      name: id
      required: true
      schema:
        type: string
        format: uuid
      description: Memory UUID.
  schemas:
    UpdateMemoryRequest:
      type: object
      properties:
        content:
          type: string
          maxLength: 10000
          description: >-
            New content. If changed, triggers re-classification against similar
            memories.
        category:
          $ref: '#/components/schemas/MemoryCategory'
        project:
          type: string
          maxLength: 100
    UpdateMemoryResponse:
      type: object
      required:
        - success
      properties:
        success:
          type: boolean
        memory:
          type: object
          description: Returned when only metadata was updated.
          properties:
            id:
              type: string
            content:
              type: string
            category:
              type: string
              nullable: true
            scope:
              type: string
              nullable: true
            project:
              type: string
              nullable: true
        superseded:
          type: string
          format: uuid
          description: ID of superseded memory (when content update triggers supersession).
        relatedTo:
          type: string
          format: uuid
          description: >-
            ID of related memory (when content update creates an extend/similar
            relation).
        error:
          type: string
          description: Error message when `success` is `false`.
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Human-readable error message.
        code:
          type: string
          description: Machine-readable error code (e.g. `HTTP_404`, `INTERNAL_ERROR`).
        requestId:
          type: string
          description: >-
            Unique request ID for tracing. Also returned in the `X-Request-Id`
            response header.
        errorId:
          type: string
          description: Unique error ID for support reference (format `ERR_XXXXXXXX`).
    MemoryCategory:
      type: string
      enum:
        - preference
        - fact
        - decision
        - context
      description: |
        - `preference` - User likes or dislikes (e.g. "prefers dark mode").
        - `fact` - Objective information (e.g. "uses macOS").
        - `decision` - Choices made (e.g. "chose the new billing provider").
        - `context` - Background information (e.g. "working on e-commerce app").
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: >
        API key created from the MemContext dashboard. Keys are prefixed with
        `mc_`, bound to one workspace, and API-key requests cannot override that
        workspace.

````