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

# Supersede a memory with a corrected successor, refile it in place with kind: move, or archive it with kind: archive (mirrors the MCP revise tool)



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/memories/{id}/revise
openapi: 3.1.0
info:
  description: >-
    The /api/v1 REST mirror of the 3ngram memory core
    (docs/concepts/architecture.mdx: one core, N transports). Authenticate with
    an X-API-Key header or a session Bearer token.
  title: 3ngram REST API
  version: v1
servers:
  - description: 3ngram platform
    url: https://api.3ngram.ai
security:
  - apiKey: []
  - sessionBearer: []
paths:
  /api/v1/memories/{id}/revise:
    post:
      summary: >-
        Supersede a memory with a corrected successor, refile it in place with
        kind: move, or archive it with kind: archive (mirrors the MCP revise
        tool)
      operationId: revise
      parameters:
        - in: path
          name: id
          required: true
          schema:
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
            type: string
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - additionalProperties: false
                  properties:
                    kind:
                      description: >-
                        archive: take each memory out of the active set (status
                        archived). No successor; content, tags and dates
                        untouched; recoverable with status: archived. Open
                        commitments and blockers are rejected: settle those with
                        resolve. reaffirm: record that each memory was reviewed
                        and is still valid; nothing about it changes, it just
                        stops being a stale candidate for a while.
                      enum:
                        - archive
                        - reaffirm
                      type: string
                    sessionRunId:
                      description: >-
                        Opaque id of the current agent session run. Pass through
                        from SessionStart. Omit to attach the single leased-open
                        session for this project, if any. A run id not owned by
                        this tenant fails the write.
                      format: uuid
                      pattern: >-
                        ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                      type: string
                  required:
                    - kind
                  type: object
                - additionalProperties: false
                  properties:
                    kind:
                      const: move
                      description: >-
                        Refile in place: no successor, dates and content
                        untouched.
                      type: string
                    project:
                      description: >-
                        New project. Omitted: unchanged. A project can be
                        replaced, not cleared.
                      maxLength: 256
                      minLength: 1
                      type: string
                    scope:
                      description: 'New scope. Omitted: unchanged.'
                      maxLength: 64
                      minLength: 1
                      pattern: ^[a-z0-9][a-z0-9-]*$
                      type: string
                    sessionRunId:
                      description: >-
                        Opaque id of the current agent session run. Pass through
                        from SessionStart. Omit to attach the single leased-open
                        session for this project, if any. A run id not owned by
                        this tenant fails the write.
                      format: uuid
                      pattern: >-
                        ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                      type: string
                    tags:
                      description: >-
                        New tag list, replacing the old one (order is
                        significant). Omitted: unchanged.
                      items:
                        maxLength: 64
                        minLength: 1
                        type: string
                      maxItems: 32
                      type: array
                  required:
                    - kind
                  type: object
                - additionalProperties: false
                  properties:
                    content:
                      maxLength: 2000
                      minLength: 1
                      type: string
                    edgeIntent:
                      default: supersedes
                      enum:
                        - supersedes
                        - updates
                      type: string
                    memoryType:
                      enum:
                        - decision
                        - commitment
                        - blocker
                        - fact
                        - preference
                        - pattern
                        - note
                        - event
                      type: string
                    project:
                      description: >-
                        Project of the successor. Omitted: inherited from the
                        predecessor.
                      maxLength: 256
                      minLength: 1
                      type: string
                    scope:
                      description: >-
                        Scope of the successor. Omitted: inherited from the
                        predecessor.
                      maxLength: 64
                      minLength: 1
                      pattern: ^[a-z0-9][a-z0-9-]*$
                      type: string
                    sessionRunId:
                      description: >-
                        Opaque id of the current agent session run. Pass through
                        from SessionStart. Omit to attach the single leased-open
                        session for this project, if any. A run id not owned by
                        this tenant fails the write.
                      format: uuid
                      pattern: >-
                        ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                      type: string
                    tags:
                      description: >-
                        Tags of the successor. Omitted: inherited from the
                        predecessor.
                      items:
                        maxLength: 64
                        minLength: 1
                        type: string
                      maxItems: 32
                      type: array
                    topic:
                      maxLength: 256
                      minLength: 1
                      type: string
                  required:
                    - memoryType
                    - topic
                    - content
                  type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                anyOf:
                  - additionalProperties: true
                    properties:
                      embedded:
                        enum:
                          - pending
                          - done
                          - failed
                          - 'off'
                        type: string
                      memory:
                        additionalProperties: true
                        properties:
                          id:
                            format: uuid
                            pattern: >-
                              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                            type: string
                          memoryType:
                            enum:
                              - decision
                              - commitment
                              - blocker
                              - fact
                              - preference
                              - pattern
                              - note
                              - event
                            type: string
                          project:
                            anyOf:
                              - maxLength: 256
                                minLength: 1
                                type: string
                              - type: 'null'
                          scope:
                            maxLength: 64
                            minLength: 1
                            pattern: ^[a-z0-9][a-z0-9-]*$
                            type: string
                          topic:
                            type: string
                        required:
                          - id
                          - memoryType
                          - topic
                          - scope
                          - project
                        type: object
                    required:
                      - memory
                      - embedded
                    type: object
                  - additionalProperties: true
                    properties:
                      kind:
                        enum:
                          - archive
                          - reaffirm
                        type: string
                      outcomes:
                        items:
                          additionalProperties: true
                          properties:
                            memoryId:
                              format: uuid
                              pattern: >-
                                ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                              type: string
                            outcome:
                              enum:
                                - archived
                                - already_archived
                                - reaffirmed
                                - rejected
                              type: string
                            reason:
                              description: Present only when outcome is rejected.
                              enum:
                                - not_found
                                - superseded
                                - open_commitment
                                - blocker
                                - archived
                              type: string
                          required:
                            - memoryId
                            - outcome
                          type: object
                        maxItems: 50
                        type: array
                    required:
                      - kind
                      - outcomes
                    type: object
          description: Success
components:
  securitySchemes:
    apiKey:
      in: header
      name: X-API-Key
      type: apiKey
    sessionBearer:
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.