> ## 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.

# Correct a context vault memory

> Applies a correction to an extracted workspace memory. When
`correctedChunkContent` is provided, the cited source chunk is updated
too so future document retrieval stays aligned with the corrected
memory.




## OpenAPI

````yaml /openapi.yaml post /api/context-vault/memories/{memoryId}/correction
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/context-vault/memories/{memoryId}/correction:
    post:
      tags:
        - Context Vault
      summary: Correct a context vault memory
      description: |
        Applies a correction to an extracted workspace memory. When
        `correctedChunkContent` is provided, the cited source chunk is updated
        too so future document retrieval stays aligned with the corrected
        memory.
      operationId: correctContextVaultMemory
      parameters:
        - in: path
          name: memoryId
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CorrectContextVaultMemoryRequest'
      responses:
        '200':
          description: Memory corrected.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CorrectContextVaultMemoryResponse'
      security:
        - ApiKeyAuth: []
        - CookieAuth: []
components:
  schemas:
    CorrectContextVaultMemoryRequest:
      type: object
      required:
        - workspaceId
        - correctedContent
      properties:
        workspaceId:
          type: string
          format: uuid
        vaultId:
          type: string
          format: uuid
          description: >-
            Optional vault inside the workspace. Defaults to the workspace's
            default vault.
        type:
          type: string
          enum:
            - wrong
            - outdated
            - incomplete
          default: wrong
        correctedContent:
          type: string
          maxLength: 10000
          description: Corrected extracted memory text.
        reason:
          type: string
          maxLength: 1000
          description: Reviewer note explaining why the correction is needed.
        correctedChunkContent:
          type: string
          maxLength: 20000
          description: >-
            Optional corrected source chunk text. Send this to keep
            document-chunk retrieval aligned with the corrected memory.
        evidenceChunkId:
          type: string
          format: uuid
          description: >-
            Optional evidence chunk to update. Omit to update all cited chunks
            when `correctedChunkContent` is supplied.
    CorrectContextVaultMemoryResponse:
      type: object
      required:
        - success
        - memory
        - updatedChunkCount
      properties:
        success:
          type: boolean
        memory:
          $ref: '#/components/schemas/ContextVaultMemory'
        updatedChunkCount:
          type: integer
          description: Number of source chunks updated by the correction.
    ContextVaultMemory:
      type: object
      required:
        - id
        - content
        - memoryType
        - createdAt
      properties:
        id:
          type: string
          format: uuid
        content:
          type: string
        category:
          type: string
          nullable: true
        scope:
          type: string
          nullable: true
        project:
          type: string
          nullable: true
        memoryType:
          type: string
          enum:
            - document
            - company
          description: >-
            `document` memories are extracted from sources; `company` memories
            are curated workspace facts.
        createdAt:
          type: string
          format: date-time
        sourceId:
          type: string
          format: uuid
          nullable: true
        sourceTitle:
          type: string
          nullable: true
        sourceUrl:
          type: string
          nullable: true
  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.
    CookieAuth:
      type: apiKey
      in: cookie
      name: better-auth.session_token
      description: Dashboard session cookie used for workspace/company endpoints.

````