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

# Sync the selected Notion items now

> What `memloom notion sync` calls (the daemon also runs it on a poll timer). For each
selected item: asks Notion whether it changed, refetches only the sections whose
last_edited_time moved (cached block tree), renders to markdown, and re-ingests
chunk-stably so unchanged chunks keep their rows and embeddings. The response
streams NDJSON: one {"type":"item"} event per page plus fetch-progress events, then
{"type":"done"} with the totals. A dry run fetches no page content and writes
nothing.




## OpenAPI

````yaml /openapi.yaml post /notion/sync/stream
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:
  /notion/sync/stream:
    post:
      summary: Sync the selected Notion items now
      description: >
        What `memloom notion sync` calls (the daemon also runs it on a poll
        timer). For each

        selected item: asks Notion whether it changed, refetches only the
        sections whose

        last_edited_time moved (cached block tree), renders to markdown, and
        re-ingests

        chunk-stably so unchanged chunks keep their rows and embeddings. The
        response

        streams NDJSON: one {"type":"item"} event per page plus fetch-progress
        events, then

        {"type":"done"} with the totals. A dry run fetches no page content and
        writes

        nothing.
      operationId: notionSyncStream
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                dryRun:
                  type: boolean
                  description: List what would sync; no content fetches, no writes.
                force:
                  type: boolean
                  description: Ignore caches and refetch every selected item in full.
                wait:
                  type: boolean
                  description: >-
                    If a sync is already running, queue behind it instead of
                    failing.
      responses:
        '200':
          description: NDJSON progress stream ending with a done (or error) event.
        '400':
          $ref: '#/components/responses/ValidationError'
components:
  responses:
    ValidationError:
      description: The request body failed validation. `issues` names each offending field.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: invalid request body
              issues:
                type: array
                items:
                  type: object
                  properties:
                    path:
                      type: string
                      example: query
                    message:
                      type: string
                      example: query must be a non-empty string

````