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

# Attach a file to a chat

> Upload file bytes into one chat's scope. The file is chunked and embedded like a
document, but only that session's recall searches it: it stays out of the documents
list, the graph, and entity extraction, and it is deleted with the chat. Omit
`sessionId` to create the session on the spot (titled 'New chat' until the first
message names it). Body limit ~48MB (~36MB of file). Remove an attachment with
DELETE /context/documents/{id}.




## OpenAPI

````yaml /openapi.yaml post /assistant/attachments
openapi: 3.1.0
info:
  title: memloom local API
  version: 0.1.0
  description: >
    The HTTP API served by the `memloom serve` daemon on your machine. The CLI,
    the MCP server,

    and the viewer all route through this API. The daemon is the single owner of
    the store, so

    every client shares one consistent view of your memories.


    No authentication: the daemon binds to `127.0.0.1` only and is reachable
    solely from your

    own machine. Browser clients on other localhost ports are allowed via CORS.
servers:
  - url: http://127.0.0.1:4319
    description: Local memloom daemon
security: []
paths:
  /assistant/attachments:
    post:
      summary: Attach a file to a chat
      description: >
        Upload file bytes into one chat's scope. The file is chunked and
        embedded like a

        document, but only that session's recall searches it: it stays out of
        the documents

        list, the graph, and entity extraction, and it is deleted with the chat.
        Omit

        `sessionId` to create the session on the spot (titled 'New chat' until
        the first

        message names it). Body limit ~48MB (~36MB of file). Remove an
        attachment with

        DELETE /context/documents/{id}.
      operationId: assistantAttach
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - filename
                - contentBase64
              properties:
                filename:
                  type: string
                  example: brief.pdf
                contentBase64:
                  type: string
                sessionId:
                  type: string
                  format: uuid
                  description: The chat to attach to; omit to create one.
      responses:
        '200':
          description: The ingest outcome plus the session it landed in.
          content:
            application/json:
              schema:
                type: object
                properties:
                  sessionId:
                    type: string
                    format: uuid
                  documentId:
                    type: string
                    format: uuid
                  outcome:
                    type: string
                    enum:
                      - added
                      - updated
                      - unchanged
                      - converted
                      - exists
                  title:
                    type: string
                  chunks:
                    type: integer
        '400':
          description: Unsupported file type or empty content.
        '404':
          description: No such session.
        '413':
          description: File too large.

````