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

# Ingest a chat transcript

> For plugins and hooks. Secrets are removed, then the conversation is split into chunks and
extracted into memories in the background. Resending the same (or a longer) transcript with the
same `sessionId` skips chunks already queued. Use `final: false` while the chat is still going.




## OpenAPI

````yaml /openapi.yaml post /api/memories/ingest
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/ingest:
    post:
      tags:
        - Memories
      summary: Ingest a chat transcript
      description: >
        For plugins and hooks. Secrets are removed, then the conversation is
        split into chunks and

        extracted into memories in the background. Resending the same (or a
        longer) transcript with the

        same `sessionId` skips chunks already queued. Use `final: false` while
        the chat is still going.
      operationId: ingestTranscript
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - sessionId
                - messages
              properties:
                sessionId:
                  type: string
                  maxLength: 200
                messages:
                  type: array
                  maxItems: 1000
                  items:
                    $ref: '#/components/schemas/TranscriptMessage'
                client:
                  type: string
                project:
                  type: string
                scope:
                  type: string
                date:
                  type: string
                  description: >-
                    Conversation date, used to resolve relative dates like "next
                    Friday".
                final:
                  type: boolean
                  default: true
                handoff:
                  type: object
                  properties:
                    content:
                      type: string
                    done:
                      type: boolean
      responses:
        '202':
          description: Accepted for background extraction.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IngestTranscriptResponse'
components:
  schemas:
    TranscriptMessage:
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          enum:
            - user
            - assistant
            - system
            - tool
          description: Only `user` and `assistant` messages are used.
        content:
          type: string
        at:
          type: string
          format: date-time
    IngestTranscriptResponse:
      type: object
      required:
        - accepted
        - skipped
        - jobIds
        - redacted
      properties:
        accepted:
          type: integer
          description: Transcript chunks queued for extraction.
        skipped:
          type: integer
          description: Chunks already ingested earlier (idempotent resend).
        jobIds:
          type: array
          items:
            type: string
            format: uuid
        redacted:
          type: integer
          description: Secrets removed before anything was stored.
        deferred:
          type: integer
          description: >-
            Chunks not queued in this request (max 30 per request, or memory
            limit reached). Resend later; already-queued chunks are skipped.
        limitExceeded:
          type: boolean
        handoff:
          $ref: '#/components/schemas/SetHandoffResponse'
    SetHandoffResponse:
      type: object
      required:
        - status
        - handoff
      properties:
        status:
          type: string
          enum:
            - saved
            - updated
            - closed
            - none
        handoff:
          allOf:
            - $ref: '#/components/schemas/HandoffNote'
          nullable: true
        redacted:
          type: integer
    HandoffNote:
      type: object
      required:
        - id
        - content
        - createdAt
      properties:
        id:
          type: string
          format: uuid
        content:
          type: string
        project:
          type: string
        scope:
          type: string
        client:
          type: string
        createdAt:
          type: string
          format: date-time
        validUntil:
          type: string
          format: date-time
  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.

````

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