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

# Upload file bytes as a document

> Ingest a file whose bytes come from the client. The viewer's Upload button uses
this, because a browser file dialog yields file bytes without a usable path. The
document is listed, graphed, and indexed like any other. Its provenance is `upload://<filename>`,
so re-uploading the same name replaces it and identical bytes are a no-op. Unlike
path-linked documents there is no disk file to open or change-track; prefer
/context/add when the daemon can read the file itself. Body limit ~48MB
(base64 inflates by a third, so roughly a 36MB file).




## OpenAPI

````yaml /openapi.yaml post /context/upload
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:
  /context/upload:
    post:
      summary: Upload file bytes as a document
      description: >
        Ingest a file whose bytes come from the client. The viewer's Upload
        button uses

        this, because a browser file dialog yields file bytes without a usable
        path. The

        document is listed, graphed, and indexed like any other. Its provenance
        is `upload://<filename>`,

        so re-uploading the same name replaces it and identical bytes are a
        no-op. Unlike

        path-linked documents there is no disk file to open or change-track;
        prefer

        /context/add when the daemon can read the file itself. Body limit ~48MB

        (base64 inflates by a third, so roughly a 36MB file).
      operationId: contextUpload
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - filename
                - contentBase64
              properties:
                filename:
                  type: string
                  description: >-
                    Name with extension; picks the extractor and titles the
                    document.
                  example: notes.md
                contentBase64:
                  type: string
                  description: The file bytes, base64-encoded.
      responses:
        '200':
          description: The ingest outcome (same shape as /context/add for one file).
          content:
            application/json:
              schema:
                type: object
                properties:
                  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.
        '413':
          description: File too large.

````