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

# Update selected fields of a memory.



## OpenAPI

````yaml api-reference/flumes.yaml patch /v0/memories/{memory_id}
openapi: 3.1.0
info:
  title: Flumes Memory API (MVP)
  version: 0.9.2
  description: >
    Unified memory + context assembly for LLM agents.

    Core endpoints: /v0/context/assemble, /v0/memories, /v0/recall,
    /v0/summarize, /v0/prune, /v0/observability/events.

    Private endpoints (not for SDKs): /v0/extract, /v0/memories:batch_upsert.
servers:
  - url: https://api.flumes.ai
    description: Production
  - url: https://staging.api.flumes.ai
    description: Staging
security:
  - bearerAuth: []
paths:
  /v0/memories/{memory_id}:
    patch:
      tags:
        - Memories
      summary: Update selected fields of a memory.
      operationId: updateMemory
      parameters:
        - $ref: '#/components/parameters/OrgHeader'
        - name: memory_id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                tags:
                  type: array
                  items:
                    type: string
                metadata:
                  type: object
                  additionalProperties: true
                archived:
                  type: boolean
                valid_to:
                  type: string
                  format: date-time
                status:
                  type: string
                  enum:
                    - active
                    - superseded
                    - disputed
      responses:
        '200':
          description: Updated memory
          headers:
            X-Request-Id:
              schema:
                type: string
            Access-Control-Allow-Origin:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Memory'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '422':
          $ref: '#/components/responses/ErrorResponse'
components:
  parameters:
    OrgHeader:
      name: X-Flumes-Org
      in: header
      required: false
      schema:
        type: string
        maxLength: 128
      description: Deprecated. Org is derived from API key; header is ignored.
  schemas:
    Memory:
      type: object
      description: >-
        Base memory record (open-world). Write requests ignore org fields; org
        is taken from header.
      properties:
        memory_id:
          type: string
          readOnly: true
        org_id:
          type: string
          readOnly: true
        namespace:
          type: string
          default: default
          maxLength: 64
        agent_id:
          type: string
          nullable: true
        entity_id:
          type: string
          nullable: true
        type:
          type: string
          enum:
            - fact
            - event
            - document
            - note
            - profile
            - chunk
        text:
          type: string
          description: >-
            Human-readable content; for facts, this is a rendered form of
            subject/predicate/object.
          maxLength: 20000
        metadata:
          type: object
          additionalProperties: true
        tags:
          type: array
          items:
            type: string
            maxLength: 64
        timestamp:
          type: string
          format: date-time
        archived:
          type: boolean
          default: false
        sensitivity:
          type: string
          enum:
            - none
            - pii
            - auto
          default: auto
        subject:
          type: string
          nullable: true
          description: Entity id like ent:user_42
        predicate:
          type: string
          nullable: true
          maxLength: 128
        object:
          oneOf:
            - type: string
              maxLength: 4000
            - type: number
            - type: boolean
            - type: object
              additionalProperties: true
            - type: 'null'
        object_type:
          type: string
          enum:
            - literal
            - string
            - number
            - date
            - json
            - entity
          nullable: true
        unit:
          type: string
          nullable: true
          maxLength: 32
        keys:
          type: array
          items:
            type: string
            maxLength: 128
          nullable: true
          description: Conflict keys for supersession.
        valid_from:
          type: string
          format: date-time
          nullable: true
        valid_to:
          type: string
          format: date-time
          nullable: true
        confidence:
          type: number
          minimum: 0
          maximum: 1
          nullable: true
        status:
          type: string
          enum:
            - active
            - superseded
            - disputed
          default: active
        provenance:
          type: object
          additionalProperties: true
          description: 'Source info; e.g., { source_turn: memory_id }'
      required:
        - type
        - namespace
        - text
    Error:
      type: object
      properties:
        error:
          type: string
          examples:
            - unauthorized
            - validation_error
            - rate_limited
            - conflict
        message:
          type: string
        request_id:
          type: string
        details:
          type: object
          additionalProperties: true
  responses:
    ErrorResponse:
      description: Error envelope
      headers:
        X-Request-Id:
          schema:
            type: string
        X-RateLimit-Remaining:
          schema:
            type: integer
        X-RateLimit-Reset:
          schema:
            type: integer
            description: UTC seconds until limit resets
        Access-Control-Allow-Origin:
          schema:
            type: string
          description: Present if CORS enabled
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: APIKey

````