{
  "openapi": "3.1.0",
  "info": {
    "title": "Syngularity API",
    "version": "0.3.0",
    "description": "Folders and named Markdown files, user-maintained discovery descriptions, optimistic concurrency, and per-key independent read/update rules for files and folders."
  },
  "servers": [
    {
      "url": "https://syngularity.dev/api/v1"
    },
    {
      "url": "http://localhost:3000/api/v1"
    }
  ],
  "security": [
    {
      "ApiKey": []
    }
  ],
  "paths": {
    "/memories": {
      "get": {
        "operationId": "listMemories",
        "summary": "List memories",
        "description": "List document metadata and section content. The full raw Markdown field is omitted; section content is included. Use search for topic discovery.\n\nRead access to returned files; HEAD also permits update-only access.\n\nBase path: /api/v1. Send Authorization: Bearer syn_<key>.\n\nKeys access only their owner's granted paths. New keys have no path grants; legacy unscoped keys normalize to explicit all-files access, while existing scoped grants are preserved. Authenticated requests share their account's plan allowance across all keys.\n\nYour account uses the price and request limits saved at signup. Free currently includes 10/second, 60/minute, 1,000/hour, 10,000/day and 100,000/calendar month. Later catalog changes do not alter existing agreements. Keys cannot raise these limits or reset usage. Windows reset independently at UTC boundaries.\n\nRead and update are independent. Exact file rules override the nearest matching folder; equal-specificity denies win. Folder grants cover future files and optionally descendants. Folder metadata requires an exact _folder.md read grant for restricted keys.\n\nFile creation (createFiles) and standalone folder creation (createFolders) are independent capabilities. Restricted write keys additionally need matching writable folder grants; file-only grants never authorize creation, and recursion and exclusions still apply. Omitted flags preserve existing permissions: all-files write keys retain both capabilities; restricted keys retain legacy createMemories file creation and no folder creation. Explicit createFiles overrides createMemories. Deleting, moving, and editing existing folder metadata require an all-files write key or the owner. Moves that newly expose content to a restricted key return 409 KEY_ACCESS_CHANGE.\n\nUpdate-only keys can obtain the current version through HEAD /memories/{path} (MCP get_memory_version) and replace the whole file. Successful writes return only {path, version}; targeted edits, diffs, and approval also require read access.\n\nTreat change cursors as opaque strings. Restricted cursors are encrypted and bound to the key and current grants. After CURSOR_SCOPE_CHANGED, rebuild the authorized snapshot from cursor 0. Empty hidden-only pages still advance nextCursor.\n\nTimestamp polling only returns current files. Follow nextCursor until null while retaining the original since filter; do not advance since between pages. Offset pages are not a snapshot during concurrent writes. Use GET /changes for reliable updates, deletions and moved-away paths.\n\nReserved _folder.md metadata files are omitted.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "Inclusive lower bound for created/updated files. Reuse nextSince; deduplicate by path and hash.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size; default 100.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Offset cursor returned as nextCursor.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Case-insensitive content, title, description, and path filter.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response. JSON examples use illustrative hashes, timestamps, and revision tokens.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "nextSince": "2026-10-16T12:00:00.000Z",
                  "memories": [
                    {
                      "path": "acme/memory/personal/Profile.md",
                      "location": {
                        "organization": "acme",
                        "folders": [
                          "memory",
                          "personal"
                        ],
                        "filename": "Profile.md"
                      },
                      "version": 3,
                      "hash": "<sha256-of-source>",
                      "title": "Profile",
                      "description": "",
                      "descriptionStatus": "missing",
                      "unresolvedDescriptions": [],
                      "sections": [
                        {
                          "id": "profile",
                          "title": "Profile",
                          "depth": 1,
                          "start": 0,
                          "bodyStart": 10,
                          "end": 49,
                          "content": "## Preferences\n\nKeep replies concise.",
                          "description": "",
                          "descriptionStatus": "missing"
                        },
                        {
                          "id": "preferences",
                          "title": "Preferences",
                          "depth": 2,
                          "start": 11,
                          "bodyStart": 26,
                          "end": 49,
                          "content": "Keep replies concise.",
                          "description": "",
                          "descriptionStatus": "missing"
                        }
                      ],
                      "frontmatter": {
                        "organization": "acme",
                        "version": 3
                      },
                      "updatedAt": "2026-10-16T12:00:00.000Z",
                      "warnings": []
                    }
                  ],
                  "nextCursor": null
                }
              }
            }
          },
          "401": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request cap exceeded; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createMemory",
        "summary": "Create a memory",
        "description": "Create a separately named Markdown file at version 1, with an optional description. Existing files are never overwritten. Folders and files are independent; sibling documents can share any folder.\n\nWrite access with file creation enabled (createFiles: true, or legacy createMemories: true for restricted keys) and a matching writable folder grant. All-files write keys default to enabled unless createFiles is false. File-only grants cannot create files; folder recursion and exclusions apply.\n\nBase path: /api/v1. Send Authorization: Bearer syn_<key>.\n\nKeys access only their owner's granted paths. New keys have no path grants; legacy unscoped keys normalize to explicit all-files access, while existing scoped grants are preserved. Authenticated requests share their account's plan allowance across all keys.\n\nYour account uses the price and request limits saved at signup. Free currently includes 10/second, 60/minute, 1,000/hour, 10,000/day and 100,000/calendar month. Later catalog changes do not alter existing agreements. Keys cannot raise these limits or reset usage. Windows reset independently at UTC boundaries.\n\nRead and update are independent. Exact file rules override the nearest matching folder; equal-specificity denies win. Folder grants cover future files and optionally descendants. Folder metadata requires an exact _folder.md read grant for restricted keys.\n\nFile creation (createFiles) and standalone folder creation (createFolders) are independent capabilities. Restricted write keys additionally need matching writable folder grants; file-only grants never authorize creation, and recursion and exclusions still apply. Omitted flags preserve existing permissions: all-files write keys retain both capabilities; restricted keys retain legacy createMemories file creation and no folder creation. Explicit createFiles overrides createMemories. Deleting, moving, and editing existing folder metadata require an all-files write key or the owner. Moves that newly expose content to a restricted key return 409 KEY_ACCESS_CHANGE.\n\nUpdate-only keys can obtain the current version through HEAD /memories/{path} (MCP get_memory_version) and replace the whole file. Successful writes return only {path, version}; targeted edits, diffs, and approval also require read access.\n\nTreat change cursors as opaque strings. Restricted cursors are encrypted and bound to the key and current grants. After CURSOR_SCOPE_CHANGED, rebuild the authorized snapshot from cursor 0. Empty hidden-only pages still advance nextCursor.\n\nUse POST /memories or MCP create_memory for creation. Updates and rewrite proposals, including MCP update_memory and propose_rewrite, require an existing file and a positive observed version; version zero does not create a file.\n\nWhen readable, creation returns canonical Markdown, not byte-identical raw input: system frontmatter is generated, YAML is serialized, and BOM, CRLF, and initial blank lines are normalized. Custom metadata values and ordinary body text are retained.\n\nCreation permission does not grant read access or authorize standalone empty-folder creation, deletion, moves, or folder-description edits.\n\nExisting restricted keys remain update-only unless the owner explicitly enables creation. All-files write keys retain their existing creation capability.\n\nPace bulk imports against unchanged account-wide quotas; batches of 50 are checkpoints, not bursts. Respect REST Retry-After or MCP error.details.retryAfter on 429 and use bounded, jittered backoff for transient 503s. If a create outcome is uncertain, read and compare canonical content before retrying; without read access, report it as unverified. Never overwrite a conflict.\n\nThe former hierarchy/category/subcategory create format is no longer accepted.\n\nSafe case-preserving filenames are supported; organizations use lowercase slugs. Traversal, symlinks and reserved filesystem names are rejected.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "path": {
                    "type": "string"
                  },
                  "markdown": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 2000
                  }
                },
                "required": [
                  "path",
                  "markdown"
                ],
                "additionalProperties": false
              },
              "example": {
                "path": "acme/memory/personal/Profile.md",
                "markdown": "# Profile\n\n## Preferences\n\nKeep replies concise.",
                "description": "Personal profile and preferences."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The created Memory when the key can read the destination. Without read access, only {path, version} is returned.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Memory"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "path": {
                          "type": "string"
                        },
                        "version": {
                          "type": "integer",
                          "minimum": 1
                        }
                      },
                      "required": [
                        "path",
                        "version"
                      ],
                      "additionalProperties": false
                    }
                  ]
                },
                "example": {
                  "path": "acme/memory/personal/Profile.md",
                  "location": {
                    "organization": "acme",
                    "folders": [
                      "memory",
                      "personal"
                    ],
                    "filename": "Profile.md"
                  },
                  "markdown": "---\norganization: acme\nversion: 1\ndescription: Personal profile and preferences.\ndescription_hash: 9a452a5333f20bd32765cbe581cbb0b3f8c32b636e55b5ac33e151968002fbde\n---\n# Profile\n\n## Preferences\n\nKeep replies concise.\n",
                  "version": 1,
                  "hash": "<sha256-of-source>",
                  "title": "Profile",
                  "description": "Personal profile and preferences.",
                  "descriptionStatus": "current",
                  "unresolvedDescriptions": [],
                  "sections": [
                    {
                      "id": "profile",
                      "title": "Profile",
                      "depth": 1,
                      "start": 0,
                      "bodyStart": 10,
                      "end": 49,
                      "content": "## Preferences\n\nKeep replies concise.",
                      "description": "",
                      "descriptionStatus": "missing"
                    },
                    {
                      "id": "preferences",
                      "title": "Preferences",
                      "depth": 2,
                      "start": 11,
                      "bodyStart": 26,
                      "end": 49,
                      "content": "Keep replies concise.",
                      "description": "",
                      "descriptionStatus": "missing"
                    }
                  ],
                  "frontmatter": {
                    "organization": "acme",
                    "version": 1,
                    "description": "Personal profile and preferences.",
                    "description_hash": "9a452a5333f20bd32765cbe581cbb0b3f8c32b636e55b5ac33e151968002fbde"
                  },
                  "updatedAt": "2026-10-16T12:00:00.000Z",
                  "warnings": []
                }
              }
            }
          },
          "401": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request cap exceeded; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/search": {
      "get": {
        "operationId": "searchMemories",
        "summary": "Search memories",
        "description": "Search authorized Markdown at section granularity. Cloud semantic and hybrid modes use owner-configured OpenAI embeddings persisted in pgvector; keyword search does not send content to a provider.\n\nRead access to returned files; HEAD also permits update-only access.\n\nBase path: /api/v1. Send Authorization: Bearer syn_<key>.\n\nKeys access only their owner's granted paths. New keys have no path grants; legacy unscoped keys normalize to explicit all-files access, while existing scoped grants are preserved. Authenticated requests share their account's plan allowance across all keys.\n\nYour account uses the price and request limits saved at signup. Free currently includes 10/second, 60/minute, 1,000/hour, 10,000/day and 100,000/calendar month. Later catalog changes do not alter existing agreements. Keys cannot raise these limits or reset usage. Windows reset independently at UTC boundaries.\n\nRead and update are independent. Exact file rules override the nearest matching folder; equal-specificity denies win. Folder grants cover future files and optionally descendants. Folder metadata requires an exact _folder.md read grant for restricted keys.\n\nFile creation (createFiles) and standalone folder creation (createFolders) are independent capabilities. Restricted write keys additionally need matching writable folder grants; file-only grants never authorize creation, and recursion and exclusions still apply. Omitted flags preserve existing permissions: all-files write keys retain both capabilities; restricted keys retain legacy createMemories file creation and no folder creation. Explicit createFiles overrides createMemories. Deleting, moving, and editing existing folder metadata require an all-files write key or the owner. Moves that newly expose content to a restricted key return 409 KEY_ACCESS_CHANGE.\n\nUpdate-only keys can obtain the current version through HEAD /memories/{path} (MCP get_memory_version) and replace the whole file. Successful writes return only {path, version}; targeted edits, diffs, and approval also require read access.\n\nTreat change cursors as opaque strings. Restricted cursors are encrypted and bound to the key and current grants. After CURSOR_SCOPE_CHANGED, rebuild the authorized snapshot from cursor 0. Empty hidden-only pages still advance nextCursor.\n\nSearch is permission-filtered before ranking, including for restricted keys. Results identify the best matching section for targeted reads and edits.\n\nThe workspace owner configures an OpenAI API key and embedding model in Settings, then reindexes existing memories. Without a key, hybrid falls back to keyword with semanticAvailable=false; semantic returns EMBEDDING_KEY_REQUIRED. Local installations retain the built-in lexical similarity mode.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "Natural-language or keyword query.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "mode",
            "in": "query",
            "required": false,
            "description": "Ranking mode; default hybrid.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "root",
            "in": "query",
            "required": false,
            "description": "Organization or folder prefix.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum hits; default 20.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "minScore",
            "in": "query",
            "required": false,
            "description": "Exclude weaker matches.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response. JSON examples use illustrative hashes, timestamps, and revision tokens.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "query": "boating",
                  "mode": "hybrid",
                  "hits": [
                    {
                      "path": "acme/memory/personal/Profile.md",
                      "title": "Profile",
                      "version": 3,
                      "snippet": "…weekend sailing and marine trips…",
                      "score": 0.82,
                      "sectionId": "preferences",
                      "descriptionStatus": "missing",
                      "updatedAt": "2026-10-16T12:00:00.000Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request cap exceeded; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/changes": {
      "get": {
        "operationId": "memoryChanges",
        "summary": "Poll memory changes",
        "description": "Read an ordered journal of file revision metadata and deletions, including move source paths. No Markdown or section content is stored in the journal.\n\nRead access to returned files; HEAD also permits update-only access.\n\nBase path: /api/v1. Send Authorization: Bearer syn_<key>.\n\nKeys access only their owner's granted paths. New keys have no path grants; legacy unscoped keys normalize to explicit all-files access, while existing scoped grants are preserved. Authenticated requests share their account's plan allowance across all keys.\n\nYour account uses the price and request limits saved at signup. Free currently includes 10/second, 60/minute, 1,000/hour, 10,000/day and 100,000/calendar month. Later catalog changes do not alter existing agreements. Keys cannot raise these limits or reset usage. Windows reset independently at UTC boundaries.\n\nRead and update are independent. Exact file rules override the nearest matching folder; equal-specificity denies win. Folder grants cover future files and optionally descendants. Folder metadata requires an exact _folder.md read grant for restricted keys.\n\nFile creation (createFiles) and standalone folder creation (createFolders) are independent capabilities. Restricted write keys additionally need matching writable folder grants; file-only grants never authorize creation, and recursion and exclusions still apply. Omitted flags preserve existing permissions: all-files write keys retain both capabilities; restricted keys retain legacy createMemories file creation and no folder creation. Explicit createFiles overrides createMemories. Deleting, moving, and editing existing folder metadata require an all-files write key or the owner. Moves that newly expose content to a restricted key return 409 KEY_ACCESS_CHANGE.\n\nUpdate-only keys can obtain the current version through HEAD /memories/{path} (MCP get_memory_version) and replace the whole file. Successful writes return only {path, version}; targeted edits, diffs, and approval also require read access.\n\nTreat change cursors as opaque strings. Restricted cursors are encrypted and bound to the key and current grants. After CURSOR_SCOPE_CHANGED, rebuild the authorized snapshot from cursor 0. Empty hidden-only pages still advance nextCursor.\n\nApply events in order and persist nextCursor only after a page succeeds. Continue while hasMore is true; otherwise poll again later with the same cursor.\n\nUpsert means fetch the current Markdown with GET /memories/{path}; delete means remove the local path. Moves produce source deletes and destination upserts. If a newer deletion makes a fetch return 404, remove that path and continue replaying.\n\nEvents are per owner and retained without time expiry. Existing heads are seeded during migration; earlier deletions are not reconstructed. Bootstrap an empty replica from cursor 0. A saved cursor belongs to its workspace and server; an ahead cursor returns 409 INVALID_CURSOR.\n\nIncludes _folder.md metadata. Empty folder registry changes are outside this file feed. The journal contains path/version/hash metadata only; read-only keys may poll it and all requests use normal quotas.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Exclusive cursor from the last completed page. Default 0 starts from the migration baseline on an empty replica. Treat as a string, not a timestamp or file version.",
            "schema": {
              "type": "string",
              "pattern": "^(0|[1-9][0-9]{0,18}|s1\\.[A-Za-z0-9_-]{39,100})$",
              "default": "0"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Events per page; default 100.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response. JSON examples use illustrative hashes, timestamps, and revision tokens.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemoryChanges"
                },
                "example": {
                  "changes": [
                    {
                      "cursor": "12",
                      "type": "delete",
                      "path": "acme/memory/personal/Profile.md",
                      "version": 3,
                      "hash": "<deleted-revision-sha256>"
                    },
                    {
                      "cursor": "13",
                      "type": "upsert",
                      "path": "acme/Archive/Profile.md",
                      "version": 4,
                      "hash": "<new-revision-sha256>"
                    }
                  ],
                  "nextCursor": "13",
                  "hasMore": false
                }
              }
            }
          },
          "401": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request cap exceeded; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/memories/{path}": {
      "get": {
        "operationId": "readMemory",
        "summary": "Read a memory",
        "description": "Read authoritative Markdown, or the complete Memory JSON with section IDs, descriptions, warnings, and current version.\n\nRead access to returned files; HEAD also permits update-only access.\n\nBase path: /api/v1. Send Authorization: Bearer syn_<key>.\n\nKeys access only their owner's granted paths. New keys have no path grants; legacy unscoped keys normalize to explicit all-files access, while existing scoped grants are preserved. Authenticated requests share their account's plan allowance across all keys.\n\nYour account uses the price and request limits saved at signup. Free currently includes 10/second, 60/minute, 1,000/hour, 10,000/day and 100,000/calendar month. Later catalog changes do not alter existing agreements. Keys cannot raise these limits or reset usage. Windows reset independently at UTC boundaries.\n\nRead and update are independent. Exact file rules override the nearest matching folder; equal-specificity denies win. Folder grants cover future files and optionally descendants. Folder metadata requires an exact _folder.md read grant for restricted keys.\n\nFile creation (createFiles) and standalone folder creation (createFolders) are independent capabilities. Restricted write keys additionally need matching writable folder grants; file-only grants never authorize creation, and recursion and exclusions still apply. Omitted flags preserve existing permissions: all-files write keys retain both capabilities; restricted keys retain legacy createMemories file creation and no folder creation. Explicit createFiles overrides createMemories. Deleting, moving, and editing existing folder metadata require an all-files write key or the owner. Moves that newly expose content to a restricted key return 409 KEY_ACCESS_CHANGE.\n\nUpdate-only keys can obtain the current version through HEAD /memories/{path} (MCP get_memory_version) and replace the whole file. Successful writes return only {path, version}; targeted edits, diffs, and approval also require read access.\n\nTreat change cursors as opaque strings. Restricted cursors are encrypted and bound to the key and current grants. After CURSOR_SCOPE_CHANGED, rebuild the authorized snapshot from cursor 0. Empty hidden-only pages still advance nextCursor.\n\nETag is informational; If-Match/conditional 304 requests are not supported. Supply version in write bodies.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "path",
            "in": "path",
            "required": true,
            "description": "A Markdown file path, such as organization/contacts.md or organization/folder/contacts.md. Folders are optional; URL-encode each segment.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "Omit for raw Markdown; use json for the Memory object.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response. JSON examples use illustrative hashes, timestamps, and revision tokens.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Memory"
                }
              },
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request cap exceeded; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "head": {
        "operationId": "memoryVersion",
        "summary": "Check a memory version",
        "description": "Obtain the current version without downloading content, hashes, headings, or descriptions. Requires read or update permission for this exact path.\n\nRead access to returned files; HEAD also permits update-only access.\n\nBase path: /api/v1. Send Authorization: Bearer syn_<key>.\n\nKeys access only their owner's granted paths. New keys have no path grants; legacy unscoped keys normalize to explicit all-files access, while existing scoped grants are preserved. Authenticated requests share their account's plan allowance across all keys.\n\nYour account uses the price and request limits saved at signup. Free currently includes 10/second, 60/minute, 1,000/hour, 10,000/day and 100,000/calendar month. Later catalog changes do not alter existing agreements. Keys cannot raise these limits or reset usage. Windows reset independently at UTC boundaries.\n\nRead and update are independent. Exact file rules override the nearest matching folder; equal-specificity denies win. Folder grants cover future files and optionally descendants. Folder metadata requires an exact _folder.md read grant for restricted keys.\n\nFile creation (createFiles) and standalone folder creation (createFolders) are independent capabilities. Restricted write keys additionally need matching writable folder grants; file-only grants never authorize creation, and recursion and exclusions still apply. Omitted flags preserve existing permissions: all-files write keys retain both capabilities; restricted keys retain legacy createMemories file creation and no folder creation. Explicit createFiles overrides createMemories. Deleting, moving, and editing existing folder metadata require an all-files write key or the owner. Moves that newly expose content to a restricted key return 409 KEY_ACCESS_CHANGE.\n\nUpdate-only keys can obtain the current version through HEAD /memories/{path} (MCP get_memory_version) and replace the whole file. Successful writes return only {path, version}; targeted edits, diffs, and approval also require read access.\n\nTreat change cursors as opaque strings. Restricted cursors are encrypted and bound to the key and current grants. After CURSOR_SCOPE_CHANGED, rebuild the authorized snapshot from cursor 0. Empty hidden-only pages still advance nextCursor.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "path",
            "in": "path",
            "required": true,
            "description": "A Markdown file path, such as organization/contacts.md or organization/folder/contacts.md. Folders are optional; URL-encode each segment.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Empty body. X-Memory-Version and ETag identify the current version.",
            "headers": {
              "X-Memory-Version": {
                "schema": {
                  "type": "integer"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request cap exceeded; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateMemory",
        "summary": "Update a memory or section",
        "description": "Replace a complete file from the Markdown editor/upload, or replace a named section using its observed version.\n\nUpdate permission for the target path. Standalone folder creation, deletes, moves, and folder metadata edits require all-files write access; diffs and approvals also require read access.\n\nBase path: /api/v1. Send Authorization: Bearer syn_<key>.\n\nKeys access only their owner's granted paths. New keys have no path grants; legacy unscoped keys normalize to explicit all-files access, while existing scoped grants are preserved. Authenticated requests share their account's plan allowance across all keys.\n\nYour account uses the price and request limits saved at signup. Free currently includes 10/second, 60/minute, 1,000/hour, 10,000/day and 100,000/calendar month. Later catalog changes do not alter existing agreements. Keys cannot raise these limits or reset usage. Windows reset independently at UTC boundaries.\n\nRead and update are independent. Exact file rules override the nearest matching folder; equal-specificity denies win. Folder grants cover future files and optionally descendants. Folder metadata requires an exact _folder.md read grant for restricted keys.\n\nFile creation (createFiles) and standalone folder creation (createFolders) are independent capabilities. Restricted write keys additionally need matching writable folder grants; file-only grants never authorize creation, and recursion and exclusions still apply. Omitted flags preserve existing permissions: all-files write keys retain both capabilities; restricted keys retain legacy createMemories file creation and no folder creation. Explicit createFiles overrides createMemories. Deleting, moving, and editing existing folder metadata require an all-files write key or the owner. Moves that newly expose content to a restricted key return 409 KEY_ACCESS_CHANGE.\n\nUpdate-only keys can obtain the current version through HEAD /memories/{path} (MCP get_memory_version) and replace the whole file. Successful writes return only {path, version}; targeted edits, diffs, and approval also require read access.\n\nTreat change cursors as opaque strings. Restricted cursors are encrypted and bound to the key and current grants. After CURSOR_SCOPE_CHANGED, rebuild the authorized snapshot from cursor 0. Empty hidden-only pages still advance nextCursor.\n\nJSON body variants cannot be mixed. multipart/form-data is also accepted for whole-file replacement.\n\nRequires an existing file and its positive observed version. Version zero does not create a file; use POST /memories or MCP create_memory instead.\n\n1 MB limit includes generated frontmatter. Full replacement replaces custom metadata too.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "path",
            "in": "path",
            "required": true,
            "description": "A Markdown file path, such as organization/contacts.md or organization/folder/contacts.md. Folders are optional; URL-encode each segment.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "version": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "markdown": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "version",
                      "markdown"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "version": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "sectionId": {
                        "type": "string"
                      },
                      "text": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "version",
                      "sectionId",
                      "text"
                    ],
                    "additionalProperties": false
                  }
                ]
              },
              "example": {
                "version": 3,
                "markdown": "# Profile\n\n## Preferences\n\nUpdated preferences."
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  },
                  "version": {
                    "type": "integer",
                    "minimum": 1
                  }
                },
                "required": [
                  "file",
                  "version"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response. JSON examples use illustrative hashes, timestamps, and revision tokens.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Memory"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "path": {
                          "type": "string"
                        },
                        "version": {
                          "type": "integer",
                          "minimum": 1
                        }
                      },
                      "required": [
                        "path",
                        "version"
                      ],
                      "additionalProperties": false
                    }
                  ]
                },
                "example": {
                  "path": "acme/memory/personal/Profile.md",
                  "location": {
                    "organization": "acme",
                    "folders": [
                      "memory",
                      "personal"
                    ],
                    "filename": "Profile.md"
                  },
                  "markdown": "---\norganization: acme\nversion: 3\n---\n# Profile\n\n## Preferences\n\nKeep replies concise.\n",
                  "version": 3,
                  "hash": "<sha256-of-source>",
                  "title": "Profile",
                  "description": "",
                  "descriptionStatus": "missing",
                  "unresolvedDescriptions": [],
                  "sections": [
                    {
                      "id": "profile",
                      "title": "Profile",
                      "depth": 1,
                      "start": 0,
                      "bodyStart": 10,
                      "end": 49,
                      "content": "## Preferences\n\nKeep replies concise.",
                      "description": "",
                      "descriptionStatus": "missing"
                    },
                    {
                      "id": "preferences",
                      "title": "Preferences",
                      "depth": 2,
                      "start": 11,
                      "bodyStart": 26,
                      "end": 49,
                      "content": "Keep replies concise.",
                      "description": "",
                      "descriptionStatus": "missing"
                    }
                  ],
                  "frontmatter": {
                    "organization": "acme",
                    "version": 3
                  },
                  "updatedAt": "2026-10-16T12:00:00.000Z",
                  "warnings": []
                }
              }
            }
          },
          "401": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request cap exceeded; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "patchMemory",
        "summary": "Patch text or descriptions",
        "description": "Replace one unique exact text match, or update/confirm file and section descriptions using the metadata variant.\n\nUpdate permission for the target path. Standalone folder creation, deletes, moves, and folder metadata edits require all-files write access; diffs and approvals also require read access.\n\nBase path: /api/v1. Send Authorization: Bearer syn_<key>.\n\nKeys access only their owner's granted paths. New keys have no path grants; legacy unscoped keys normalize to explicit all-files access, while existing scoped grants are preserved. Authenticated requests share their account's plan allowance across all keys.\n\nYour account uses the price and request limits saved at signup. Free currently includes 10/second, 60/minute, 1,000/hour, 10,000/day and 100,000/calendar month. Later catalog changes do not alter existing agreements. Keys cannot raise these limits or reset usage. Windows reset independently at UTC boundaries.\n\nRead and update are independent. Exact file rules override the nearest matching folder; equal-specificity denies win. Folder grants cover future files and optionally descendants. Folder metadata requires an exact _folder.md read grant for restricted keys.\n\nFile creation (createFiles) and standalone folder creation (createFolders) are independent capabilities. Restricted write keys additionally need matching writable folder grants; file-only grants never authorize creation, and recursion and exclusions still apply. Omitted flags preserve existing permissions: all-files write keys retain both capabilities; restricted keys retain legacy createMemories file creation and no folder creation. Explicit createFiles overrides createMemories. Deleting, moving, and editing existing folder metadata require an all-files write key or the owner. Moves that newly expose content to a restricted key return 409 KEY_ACCESS_CHANGE.\n\nUpdate-only keys can obtain the current version through HEAD /memories/{path} (MCP get_memory_version) and replace the whole file. Successful writes return only {path, version}; targeted edits, diffs, and approval also require read access.\n\nTreat change cursors as opaque strings. Restricted cursors are encrypted and bound to the key and current grants. After CURSOR_SCOPE_CHANGED, rebuild the authorized snapshot from cursor 0. Empty hidden-only pages still advance nextCursor.\n\nDescribing a section anchors its heading ID. IDs remain stable across title changes.\n\nContent changes retain descriptions and mark them needs_review. Null can remove descriptions for deleted sections.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "path",
            "in": "path",
            "required": true,
            "description": "A Markdown file path, such as organization/contacts.md or organization/folder/contacts.md. Folders are optional; URL-encode each segment.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "version": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "sectionId": {
                        "type": "string"
                      },
                      "oldText": {
                        "type": "string",
                        "minLength": 1
                      },
                      "newText": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "version",
                      "sectionId",
                      "oldText",
                      "newText"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "version": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "metadata": {
                        "type": "object",
                        "properties": {
                          "description": {
                            "anyOf": [
                              {
                                "type": "string",
                                "maxLength": 2000
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "sections": {
                            "type": "object",
                            "additionalProperties": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 2000
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          }
                        },
                        "required": [],
                        "additionalProperties": false
                      }
                    },
                    "required": [
                      "version",
                      "metadata"
                    ],
                    "additionalProperties": false
                  }
                ]
              },
              "example": {
                "version": 3,
                "metadata": {
                  "description": "Profile and preferences",
                  "sections": {
                    "preferences": "Preferred communication style and tools."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response. JSON examples use illustrative hashes, timestamps, and revision tokens.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Memory"
                },
                "example": {
                  "path": "acme/memory/personal/Profile.md",
                  "location": {
                    "organization": "acme",
                    "folders": [
                      "memory",
                      "personal"
                    ],
                    "filename": "Profile.md"
                  },
                  "markdown": "---\norganization: acme\nversion: 3\n---\n# Profile\n\n## Preferences\n\nKeep replies concise.\n",
                  "version": 3,
                  "hash": "<sha256-of-source>",
                  "title": "Profile",
                  "description": "",
                  "descriptionStatus": "missing",
                  "unresolvedDescriptions": [],
                  "sections": [
                    {
                      "id": "profile",
                      "title": "Profile",
                      "depth": 1,
                      "start": 0,
                      "bodyStart": 10,
                      "end": 49,
                      "content": "## Preferences\n\nKeep replies concise.",
                      "description": "",
                      "descriptionStatus": "missing"
                    },
                    {
                      "id": "preferences",
                      "title": "Preferences",
                      "depth": 2,
                      "start": 11,
                      "bodyStart": 26,
                      "end": 49,
                      "content": "Keep replies concise.",
                      "description": "",
                      "descriptionStatus": "missing"
                    }
                  ],
                  "frontmatter": {
                    "organization": "acme",
                    "version": 3
                  },
                  "updatedAt": "2026-10-16T12:00:00.000Z",
                  "warnings": []
                }
              }
            }
          },
          "401": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request cap exceeded; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteMemory",
        "summary": "Delete a file",
        "description": "Delete one current file using its observed version. Sibling files and folders are unaffected.\n\nUpdate permission for the target path. Standalone folder creation, deletes, moves, and folder metadata edits require all-files write access; diffs and approvals also require read access.\n\nBase path: /api/v1. Send Authorization: Bearer syn_<key>.\n\nKeys access only their owner's granted paths. New keys have no path grants; legacy unscoped keys normalize to explicit all-files access, while existing scoped grants are preserved. Authenticated requests share their account's plan allowance across all keys.\n\nYour account uses the price and request limits saved at signup. Free currently includes 10/second, 60/minute, 1,000/hour, 10,000/day and 100,000/calendar month. Later catalog changes do not alter existing agreements. Keys cannot raise these limits or reset usage. Windows reset independently at UTC boundaries.\n\nRead and update are independent. Exact file rules override the nearest matching folder; equal-specificity denies win. Folder grants cover future files and optionally descendants. Folder metadata requires an exact _folder.md read grant for restricted keys.\n\nFile creation (createFiles) and standalone folder creation (createFolders) are independent capabilities. Restricted write keys additionally need matching writable folder grants; file-only grants never authorize creation, and recursion and exclusions still apply. Omitted flags preserve existing permissions: all-files write keys retain both capabilities; restricted keys retain legacy createMemories file creation and no folder creation. Explicit createFiles overrides createMemories. Deleting, moving, and editing existing folder metadata require an all-files write key or the owner. Moves that newly expose content to a restricted key return 409 KEY_ACCESS_CHANGE.\n\nUpdate-only keys can obtain the current version through HEAD /memories/{path} (MCP get_memory_version) and replace the whole file. Successful writes return only {path, version}; targeted edits, diffs, and approval also require read access.\n\nTreat change cursors as opaque strings. Restricted cursors are encrypted and bound to the key and current grants. After CURSOR_SCOPE_CHANGED, rebuild the authorized snapshot from cursor 0. Empty hidden-only pages still advance nextCursor.\n\nDeletion removes pending rewrite drafts for this source. Cloud Storage cleanup uses a retryable queue.\n\nReserved _folder.md files are managed through folder operations.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "path",
            "in": "path",
            "required": true,
            "description": "A Markdown file path, such as organization/contacts.md or organization/folder/contacts.md. Folders are optional; URL-encode each segment.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "version": {
                    "type": "integer",
                    "minimum": 1
                  }
                },
                "required": [
                  "version"
                ],
                "additionalProperties": false
              },
              "example": {
                "version": 3
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response. JSON examples use illustrative hashes, timestamps, and revision tokens.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request cap exceeded; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/map": {
      "get": {
        "operationId": "memoryMap",
        "summary": "Discover the memory map",
        "description": "Find folders, file purposes, and section outlines without downloading section bodies. The structure is generated automatically; descriptions are user-maintained.\n\nRead access to returned files; HEAD also permits update-only access.\n\nBase path: /api/v1. Send Authorization: Bearer syn_<key>.\n\nKeys access only their owner's granted paths. New keys have no path grants; legacy unscoped keys normalize to explicit all-files access, while existing scoped grants are preserved. Authenticated requests share their account's plan allowance across all keys.\n\nYour account uses the price and request limits saved at signup. Free currently includes 10/second, 60/minute, 1,000/hour, 10,000/day and 100,000/calendar month. Later catalog changes do not alter existing agreements. Keys cannot raise these limits or reset usage. Windows reset independently at UTC boundaries.\n\nRead and update are independent. Exact file rules override the nearest matching folder; equal-specificity denies win. Folder grants cover future files and optionally descendants. Folder metadata requires an exact _folder.md read grant for restricted keys.\n\nFile creation (createFiles) and standalone folder creation (createFolders) are independent capabilities. Restricted write keys additionally need matching writable folder grants; file-only grants never authorize creation, and recursion and exclusions still apply. Omitted flags preserve existing permissions: all-files write keys retain both capabilities; restricted keys retain legacy createMemories file creation and no folder creation. Explicit createFiles overrides createMemories. Deleting, moving, and editing existing folder metadata require an all-files write key or the owner. Moves that newly expose content to a restricted key return 409 KEY_ACCESS_CHANGE.\n\nUpdate-only keys can obtain the current version through HEAD /memories/{path} (MCP get_memory_version) and replace the whole file. Successful writes return only {path, version}; targeted edits, diffs, and approval also require read access.\n\nTreat change cursors as opaque strings. Restricted cursors are encrypted and bound to the key and current grants. After CURSOR_SCOPE_CHANGED, rebuild the authorized snapshot from cursor 0. Empty hidden-only pages still advance nextCursor.\n\nDescriptions are missing, current, or needs_review. Treat descriptions as navigation aids and read source files before editing.\n\nFolder revision tokens cover descendant files and folder paths; use them for moves and deletion.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "root",
            "in": "query",
            "required": false,
            "description": "Limit results to an organization or folder.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "JSON is default. markdown returns a readable map.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response. JSON examples use illustrative hashes, timestamps, and revision tokens.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Map"
                }
              },
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request cap exceeded; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/folders": {
      "get": {
        "operationId": "listFolders",
        "summary": "List folders",
        "description": "List organization and folder containers, including empty folders, descriptions and subtree revisions.\n\nRead access to returned files; HEAD also permits update-only access.\n\nBase path: /api/v1. Send Authorization: Bearer syn_<key>.\n\nKeys access only their owner's granted paths. New keys have no path grants; legacy unscoped keys normalize to explicit all-files access, while existing scoped grants are preserved. Authenticated requests share their account's plan allowance across all keys.\n\nYour account uses the price and request limits saved at signup. Free currently includes 10/second, 60/minute, 1,000/hour, 10,000/day and 100,000/calendar month. Later catalog changes do not alter existing agreements. Keys cannot raise these limits or reset usage. Windows reset independently at UTC boundaries.\n\nRead and update are independent. Exact file rules override the nearest matching folder; equal-specificity denies win. Folder grants cover future files and optionally descendants. Folder metadata requires an exact _folder.md read grant for restricted keys.\n\nFile creation (createFiles) and standalone folder creation (createFolders) are independent capabilities. Restricted write keys additionally need matching writable folder grants; file-only grants never authorize creation, and recursion and exclusions still apply. Omitted flags preserve existing permissions: all-files write keys retain both capabilities; restricted keys retain legacy createMemories file creation and no folder creation. Explicit createFiles overrides createMemories. Deleting, moving, and editing existing folder metadata require an all-files write key or the owner. Moves that newly expose content to a restricted key return 409 KEY_ACCESS_CHANGE.\n\nUpdate-only keys can obtain the current version through HEAD /memories/{path} (MCP get_memory_version) and replace the whole file. Successful writes return only {path, version}; targeted edits, diffs, and approval also require read access.\n\nTreat change cursors as opaque strings. Restricted cursors are encrypted and bound to the key and current grants. After CURSOR_SCOPE_CHANGED, rebuild the authorized snapshot from cursor 0. Empty hidden-only pages still advance nextCursor.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "root",
            "in": "query",
            "required": false,
            "description": "Limit the folder listing to a branch.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response. JSON examples use illustrative hashes, timestamps, and revision tokens.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "folders": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Folder"
                      }
                    }
                  },
                  "required": [
                    "folders"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "folders": [
                    {
                      "kind": "folder",
                      "name": "personal",
                      "slug": "personal",
                      "path": "acme/memory/personal",
                      "parentPath": "acme/memory",
                      "description": "Personal profile and preferences.",
                      "version": 1,
                      "revision": "<64-character-subtree-revision>"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request cap exceeded; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createFolder",
        "summary": "Create a folder",
        "description": "Create an empty folder under an existing organization or folder, with an optional display name and purpose text.\n\nWrite access with createFolders: true and a matching writable folder grant. All-files write keys default to enabled unless createFolders is false. File creation is independent; file-only grants cannot create folders.\n\nBase path: /api/v1. Send Authorization: Bearer syn_<key>.\n\nKeys access only their owner's granted paths. New keys have no path grants; legacy unscoped keys normalize to explicit all-files access, while existing scoped grants are preserved. Authenticated requests share their account's plan allowance across all keys.\n\nYour account uses the price and request limits saved at signup. Free currently includes 10/second, 60/minute, 1,000/hour, 10,000/day and 100,000/calendar month. Later catalog changes do not alter existing agreements. Keys cannot raise these limits or reset usage. Windows reset independently at UTC boundaries.\n\nRead and update are independent. Exact file rules override the nearest matching folder; equal-specificity denies win. Folder grants cover future files and optionally descendants. Folder metadata requires an exact _folder.md read grant for restricted keys.\n\nFile creation (createFiles) and standalone folder creation (createFolders) are independent capabilities. Restricted write keys additionally need matching writable folder grants; file-only grants never authorize creation, and recursion and exclusions still apply. Omitted flags preserve existing permissions: all-files write keys retain both capabilities; restricted keys retain legacy createMemories file creation and no folder creation. Explicit createFiles overrides createMemories. Deleting, moving, and editing existing folder metadata require an all-files write key or the owner. Moves that newly expose content to a restricted key return 409 KEY_ACCESS_CHANGE.\n\nUpdate-only keys can obtain the current version through HEAD /memories/{path} (MCP get_memory_version) and replace the whole file. Successful writes return only {path, version}; targeted edits, diffs, and approval also require read access.\n\nTreat change cursors as opaque strings. Restricted cursors are encrypted and bound to the key and current grants. After CURSOR_SCOPE_CHANGED, rebuild the authorized snapshot from cursor 0. Empty hidden-only pages still advance nextCursor.\n\nOrganization management is available to the signed-in owner in the app.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "path": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 2000
                  }
                },
                "required": [
                  "path"
                ],
                "additionalProperties": false
              },
              "example": {
                "path": "acme/memory/personal",
                "description": "Personal profile and preferences."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "201 Created. All-files keys receive the Folder object; restricted creators receive only {path, version} without subtree metadata or revision tokens.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Folder"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "path": {
                          "type": "string"
                        },
                        "version": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "path",
                        "version"
                      ],
                      "additionalProperties": false
                    }
                  ]
                },
                "example": {
                  "kind": "folder",
                  "name": "personal",
                  "slug": "personal",
                  "path": "acme/memory/personal",
                  "parentPath": "acme/memory",
                  "description": "Personal profile and preferences.",
                  "version": 1,
                  "revision": "<64-character-subtree-revision>"
                }
              }
            }
          },
          "401": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request cap exceeded; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/export": {
      "get": {
        "operationId": "exportMarkdown",
        "summary": "Export Markdown ZIP",
        "description": "Download Markdown files and portable folder metadata in their organization hierarchy.\n\nRead access to returned files; HEAD also permits update-only access.\n\nBase path: /api/v1. Send Authorization: Bearer syn_<key>.\n\nKeys access only their owner's granted paths. New keys have no path grants; legacy unscoped keys normalize to explicit all-files access, while existing scoped grants are preserved. Authenticated requests share their account's plan allowance across all keys.\n\nYour account uses the price and request limits saved at signup. Free currently includes 10/second, 60/minute, 1,000/hour, 10,000/day and 100,000/calendar month. Later catalog changes do not alter existing agreements. Keys cannot raise these limits or reset usage. Windows reset independently at UTC boundaries.\n\nRead and update are independent. Exact file rules override the nearest matching folder; equal-specificity denies win. Folder grants cover future files and optionally descendants. Folder metadata requires an exact _folder.md read grant for restricted keys.\n\nFile creation (createFiles) and standalone folder creation (createFolders) are independent capabilities. Restricted write keys additionally need matching writable folder grants; file-only grants never authorize creation, and recursion and exclusions still apply. Omitted flags preserve existing permissions: all-files write keys retain both capabilities; restricted keys retain legacy createMemories file creation and no folder creation. Explicit createFiles overrides createMemories. Deleting, moving, and editing existing folder metadata require an all-files write key or the owner. Moves that newly expose content to a restricted key return 409 KEY_ACCESS_CHANGE.\n\nUpdate-only keys can obtain the current version through HEAD /memories/{path} (MCP get_memory_version) and replace the whole file. Successful writes return only {path, version}; targeted edits, diffs, and approval also require read access.\n\nTreat change cursors as opaque strings. Restricted cursors are encrypted and bound to the key and current grants. After CURSOR_SCOPE_CHANGED, rebuild the authorized snapshot from cursor 0. Empty hidden-only pages still advance nextCursor.\n\nThe response is binary ZIP, not JSON. Save it to a file.\n\nIncludes _folder.md metadata and empty folder entries. Excludes API keys, events, rewrite drafts and historical revision objects.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response. JSON examples use illustrative hashes, timestamps, and revision tokens.",
            "content": {
              "application/zip": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request cap exceeded; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/webhooks": {
      "get": {
        "operationId": "listWebhooks",
        "summary": "List webhook subscriptions",
        "description": "List account webhook subscriptions. Requires an all-files write key with manageWebhooks.\n\nAll-files write key with explicit manageWebhooks: true. Restricted and read-only keys cannot manage subscriptions.\n\nBase path: /api/v1. Send Authorization: Bearer syn_<key>.\n\nKeys access only their owner's granted paths. New keys have no path grants; legacy unscoped keys normalize to explicit all-files access, while existing scoped grants are preserved. Authenticated requests share their account's plan allowance across all keys.\n\nYour account uses the price and request limits saved at signup. Free currently includes 10/second, 60/minute, 1,000/hour, 10,000/day and 100,000/calendar month. Later catalog changes do not alter existing agreements. Keys cannot raise these limits or reset usage. Windows reset independently at UTC boundaries.\n\nRead and update are independent. Exact file rules override the nearest matching folder; equal-specificity denies win. Folder grants cover future files and optionally descendants. Folder metadata requires an exact _folder.md read grant for restricted keys.\n\nFile creation (createFiles) and standalone folder creation (createFolders) are independent capabilities. Restricted write keys additionally need matching writable folder grants; file-only grants never authorize creation, and recursion and exclusions still apply. Omitted flags preserve existing permissions: all-files write keys retain both capabilities; restricted keys retain legacy createMemories file creation and no folder creation. Explicit createFiles overrides createMemories. Deleting, moving, and editing existing folder metadata require an all-files write key or the owner. Moves that newly expose content to a restricted key return 409 KEY_ACCESS_CHANGE.\n\nUpdate-only keys can obtain the current version through HEAD /memories/{path} (MCP get_memory_version) and replace the whole file. Successful writes return only {path, version}; targeted edits, diffs, and approval also require read access.\n\nTreat change cursors as opaque strings. Restricted cursors are encrypted and bound to the key and current grants. After CURSOR_SCOPE_CHANGED, rebuild the authorized snapshot from cursor 0. Empty hidden-only pages still advance nextCursor.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response. JSON examples use illustrative hashes, timestamps, and revision tokens.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "webhooks": []
                }
              }
            }
          },
          "401": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request cap exceeded; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createWebhook",
        "summary": "Create a webhook subscription",
        "description": "Register a public HTTPS endpoint on port 443 and queue a signed webhook.test. Credentials, fragments, private addresses and redirects are not allowed. The secret is returned only in this response.\n\nAll-files write key with explicit manageWebhooks: true. Restricted and read-only keys cannot manage subscriptions.\n\nBase path: /api/v1. Send Authorization: Bearer syn_<key>.\n\nKeys access only their owner's granted paths. New keys have no path grants; legacy unscoped keys normalize to explicit all-files access, while existing scoped grants are preserved. Authenticated requests share their account's plan allowance across all keys.\n\nYour account uses the price and request limits saved at signup. Free currently includes 10/second, 60/minute, 1,000/hour, 10,000/day and 100,000/calendar month. Later catalog changes do not alter existing agreements. Keys cannot raise these limits or reset usage. Windows reset independently at UTC boundaries.\n\nRead and update are independent. Exact file rules override the nearest matching folder; equal-specificity denies win. Folder grants cover future files and optionally descendants. Folder metadata requires an exact _folder.md read grant for restricted keys.\n\nFile creation (createFiles) and standalone folder creation (createFolders) are independent capabilities. Restricted write keys additionally need matching writable folder grants; file-only grants never authorize creation, and recursion and exclusions still apply. Omitted flags preserve existing permissions: all-files write keys retain both capabilities; restricted keys retain legacy createMemories file creation and no folder creation. Explicit createFiles overrides createMemories. Deleting, moving, and editing existing folder metadata require an all-files write key or the owner. Moves that newly expose content to a restricted key return 409 KEY_ACCESS_CHANGE.\n\nUpdate-only keys can obtain the current version through HEAD /memories/{path} (MCP get_memory_version) and replace the whole file. Successful writes return only {path, version}; targeted edits, diffs, and approval also require read access.\n\nTreat change cursors as opaque strings. Restricted cursors are encrypted and bound to the key and current grants. After CURSOR_SCOPE_CHANGED, rebuild the authorized snapshot from cursor 0. Empty hidden-only pages still advance nextCursor.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "url": "https://example.com/hook",
                "events": [
                  "memory.upsert"
                ],
                "pathPrefix": "acme/projects",
                "enabled": true
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful response. JSON examples use illustrative hashes, timestamps, and revision tokens.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "id": "<uuid>",
                  "url": "https://example.com/hook",
                  "events": [
                    "memory.upsert"
                  ],
                  "secret": "whsec_..."
                }
              }
            }
          },
          "401": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request cap exceeded; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/webhooks/{id}": {
      "get": {
        "operationId": "getWebhook",
        "summary": "Get a webhook subscription",
        "description": "Get one subscription without its signing secret.\n\nAll-files write key with explicit manageWebhooks: true. Restricted and read-only keys cannot manage subscriptions.\n\nBase path: /api/v1. Send Authorization: Bearer syn_<key>.\n\nKeys access only their owner's granted paths. New keys have no path grants; legacy unscoped keys normalize to explicit all-files access, while existing scoped grants are preserved. Authenticated requests share their account's plan allowance across all keys.\n\nYour account uses the price and request limits saved at signup. Free currently includes 10/second, 60/minute, 1,000/hour, 10,000/day and 100,000/calendar month. Later catalog changes do not alter existing agreements. Keys cannot raise these limits or reset usage. Windows reset independently at UTC boundaries.\n\nRead and update are independent. Exact file rules override the nearest matching folder; equal-specificity denies win. Folder grants cover future files and optionally descendants. Folder metadata requires an exact _folder.md read grant for restricted keys.\n\nFile creation (createFiles) and standalone folder creation (createFolders) are independent capabilities. Restricted write keys additionally need matching writable folder grants; file-only grants never authorize creation, and recursion and exclusions still apply. Omitted flags preserve existing permissions: all-files write keys retain both capabilities; restricted keys retain legacy createMemories file creation and no folder creation. Explicit createFiles overrides createMemories. Deleting, moving, and editing existing folder metadata require an all-files write key or the owner. Moves that newly expose content to a restricted key return 409 KEY_ACCESS_CHANGE.\n\nUpdate-only keys can obtain the current version through HEAD /memories/{path} (MCP get_memory_version) and replace the whole file. Successful writes return only {path, version}; targeted edits, diffs, and approval also require read access.\n\nTreat change cursors as opaque strings. Restricted cursors are encrypted and bound to the key and current grants. After CURSOR_SCOPE_CHANGED, rebuild the authorized snapshot from cursor 0. Empty hidden-only pages still advance nextCursor.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Rewrite draft ID returned by POST /rewrites.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Subscription ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response. JSON examples use illustrative hashes, timestamps, and revision tokens.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "id": "<uuid>",
                  "url": "https://example.com/hook",
                  "events": [
                    "memory.upsert"
                  ],
                  "enabled": true
                }
              }
            }
          },
          "401": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request cap exceeded; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateWebhook",
        "summary": "Update a webhook subscription",
        "description": "Update its URL, event filters, path prefix, or enabled state.\n\nAll-files write key with explicit manageWebhooks: true. Restricted and read-only keys cannot manage subscriptions.\n\nBase path: /api/v1. Send Authorization: Bearer syn_<key>.\n\nKeys access only their owner's granted paths. New keys have no path grants; legacy unscoped keys normalize to explicit all-files access, while existing scoped grants are preserved. Authenticated requests share their account's plan allowance across all keys.\n\nYour account uses the price and request limits saved at signup. Free currently includes 10/second, 60/minute, 1,000/hour, 10,000/day and 100,000/calendar month. Later catalog changes do not alter existing agreements. Keys cannot raise these limits or reset usage. Windows reset independently at UTC boundaries.\n\nRead and update are independent. Exact file rules override the nearest matching folder; equal-specificity denies win. Folder grants cover future files and optionally descendants. Folder metadata requires an exact _folder.md read grant for restricted keys.\n\nFile creation (createFiles) and standalone folder creation (createFolders) are independent capabilities. Restricted write keys additionally need matching writable folder grants; file-only grants never authorize creation, and recursion and exclusions still apply. Omitted flags preserve existing permissions: all-files write keys retain both capabilities; restricted keys retain legacy createMemories file creation and no folder creation. Explicit createFiles overrides createMemories. Deleting, moving, and editing existing folder metadata require an all-files write key or the owner. Moves that newly expose content to a restricted key return 409 KEY_ACCESS_CHANGE.\n\nUpdate-only keys can obtain the current version through HEAD /memories/{path} (MCP get_memory_version) and replace the whole file. Successful writes return only {path, version}; targeted edits, diffs, and approval also require read access.\n\nTreat change cursors as opaque strings. Restricted cursors are encrypted and bound to the key and current grants. After CURSOR_SCOPE_CHANGED, rebuild the authorized snapshot from cursor 0. Empty hidden-only pages still advance nextCursor.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Rewrite draft ID returned by POST /rewrites.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Subscription ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "enabled": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response. JSON examples use illustrative hashes, timestamps, and revision tokens.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "id": "<uuid>",
                  "enabled": false
                }
              }
            }
          },
          "401": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request cap exceeded; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteWebhook",
        "summary": "Delete a webhook subscription",
        "description": "Delete a subscription and pending deliveries.\n\nAll-files write key with explicit manageWebhooks: true. Restricted and read-only keys cannot manage subscriptions.\n\nBase path: /api/v1. Send Authorization: Bearer syn_<key>.\n\nKeys access only their owner's granted paths. New keys have no path grants; legacy unscoped keys normalize to explicit all-files access, while existing scoped grants are preserved. Authenticated requests share their account's plan allowance across all keys.\n\nYour account uses the price and request limits saved at signup. Free currently includes 10/second, 60/minute, 1,000/hour, 10,000/day and 100,000/calendar month. Later catalog changes do not alter existing agreements. Keys cannot raise these limits or reset usage. Windows reset independently at UTC boundaries.\n\nRead and update are independent. Exact file rules override the nearest matching folder; equal-specificity denies win. Folder grants cover future files and optionally descendants. Folder metadata requires an exact _folder.md read grant for restricted keys.\n\nFile creation (createFiles) and standalone folder creation (createFolders) are independent capabilities. Restricted write keys additionally need matching writable folder grants; file-only grants never authorize creation, and recursion and exclusions still apply. Omitted flags preserve existing permissions: all-files write keys retain both capabilities; restricted keys retain legacy createMemories file creation and no folder creation. Explicit createFiles overrides createMemories. Deleting, moving, and editing existing folder metadata require an all-files write key or the owner. Moves that newly expose content to a restricted key return 409 KEY_ACCESS_CHANGE.\n\nUpdate-only keys can obtain the current version through HEAD /memories/{path} (MCP get_memory_version) and replace the whole file. Successful writes return only {path, version}; targeted edits, diffs, and approval also require read access.\n\nTreat change cursors as opaque strings. Restricted cursors are encrypted and bound to the key and current grants. After CURSOR_SCOPE_CHANGED, rebuild the authorized snapshot from cursor 0. Empty hidden-only pages still advance nextCursor.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Rewrite draft ID returned by POST /rewrites.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Subscription ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful response. JSON examples use illustrative hashes, timestamps, and revision tokens.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request cap exceeded; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/folders/{path}": {
      "patch": {
        "operationId": "describeFolder",
        "summary": "Describe a folder",
        "description": "Set a brief description stored in portable _folder.md metadata. Uses the metadata version returned by the map.\n\nUpdate permission for the target path. Standalone folder creation, deletes, moves, and folder metadata edits require all-files write access; diffs and approvals also require read access.\n\nBase path: /api/v1. Send Authorization: Bearer syn_<key>.\n\nKeys access only their owner's granted paths. New keys have no path grants; legacy unscoped keys normalize to explicit all-files access, while existing scoped grants are preserved. Authenticated requests share their account's plan allowance across all keys.\n\nYour account uses the price and request limits saved at signup. Free currently includes 10/second, 60/minute, 1,000/hour, 10,000/day and 100,000/calendar month. Later catalog changes do not alter existing agreements. Keys cannot raise these limits or reset usage. Windows reset independently at UTC boundaries.\n\nRead and update are independent. Exact file rules override the nearest matching folder; equal-specificity denies win. Folder grants cover future files and optionally descendants. Folder metadata requires an exact _folder.md read grant for restricted keys.\n\nFile creation (createFiles) and standalone folder creation (createFolders) are independent capabilities. Restricted write keys additionally need matching writable folder grants; file-only grants never authorize creation, and recursion and exclusions still apply. Omitted flags preserve existing permissions: all-files write keys retain both capabilities; restricted keys retain legacy createMemories file creation and no folder creation. Explicit createFiles overrides createMemories. Deleting, moving, and editing existing folder metadata require an all-files write key or the owner. Moves that newly expose content to a restricted key return 409 KEY_ACCESS_CHANGE.\n\nUpdate-only keys can obtain the current version through HEAD /memories/{path} (MCP get_memory_version) and replace the whole file. Successful writes return only {path, version}; targeted edits, diffs, and approval also require read access.\n\nTreat change cursors as opaque strings. Restricted cursors are encrypted and bound to the key and current grants. After CURSOR_SCOPE_CHANGED, rebuild the authorized snapshot from cursor 0. Empty hidden-only pages still advance nextCursor.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "path",
            "in": "path",
            "required": true,
            "description": "Organization/folder path; URL-encode each segment.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "version": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 2000
                  }
                },
                "required": [
                  "version",
                  "description"
                ],
                "additionalProperties": false
              },
              "example": {
                "version": 1,
                "description": "Personal profile and preferences."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response. JSON examples use illustrative hashes, timestamps, and revision tokens.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "path": "acme/memory/personal",
                  "description": "Personal profile and preferences.",
                  "version": 2
                }
              }
            }
          },
          "401": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request cap exceeded; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteFolder",
        "summary": "Delete a folder subtree",
        "description": "Delete descendant files and folders after checking the observed subtree revision.\n\nUpdate permission for the target path. Standalone folder creation, deletes, moves, and folder metadata edits require all-files write access; diffs and approvals also require read access.\n\nBase path: /api/v1. Send Authorization: Bearer syn_<key>.\n\nKeys access only their owner's granted paths. New keys have no path grants; legacy unscoped keys normalize to explicit all-files access, while existing scoped grants are preserved. Authenticated requests share their account's plan allowance across all keys.\n\nYour account uses the price and request limits saved at signup. Free currently includes 10/second, 60/minute, 1,000/hour, 10,000/day and 100,000/calendar month. Later catalog changes do not alter existing agreements. Keys cannot raise these limits or reset usage. Windows reset independently at UTC boundaries.\n\nRead and update are independent. Exact file rules override the nearest matching folder; equal-specificity denies win. Folder grants cover future files and optionally descendants. Folder metadata requires an exact _folder.md read grant for restricted keys.\n\nFile creation (createFiles) and standalone folder creation (createFolders) are independent capabilities. Restricted write keys additionally need matching writable folder grants; file-only grants never authorize creation, and recursion and exclusions still apply. Omitted flags preserve existing permissions: all-files write keys retain both capabilities; restricted keys retain legacy createMemories file creation and no folder creation. Explicit createFiles overrides createMemories. Deleting, moving, and editing existing folder metadata require an all-files write key or the owner. Moves that newly expose content to a restricted key return 409 KEY_ACCESS_CHANGE.\n\nUpdate-only keys can obtain the current version through HEAD /memories/{path} (MCP get_memory_version) and replace the whole file. Successful writes return only {path, version}; targeted edits, diffs, and approval also require read access.\n\nTreat change cursors as opaque strings. Restricted cursors are encrypted and bound to the key and current grants. After CURSOR_SCOPE_CHANGED, rebuild the authorized snapshot from cursor 0. Empty hidden-only pages still advance nextCursor.\n\nA folder topic/ and sibling topic.md are independent; deleting the folder preserves the sibling file.\n\nOrganization deletion remain signed-in owner actions in the app. Export a copy before deleting content.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "path",
            "in": "path",
            "required": true,
            "description": "Organization/folder path; URL-encode each segment.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "revision": {
                    "type": "string",
                    "minLength": 64,
                    "maxLength": 64
                  }
                },
                "required": [
                  "revision"
                ],
                "additionalProperties": false
              },
              "example": {
                "revision": "<64-character-subtree-revision>"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response. JSON examples use illustrative hashes, timestamps, and revision tokens.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request cap exceeded; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/moves": {
      "post": {
        "operationId": "moveItem",
        "summary": "Rename or move files and folders",
        "description": "Move a file or an entire folder subtree, optionally between existing organizations or folders. Existing destinations are never overwritten.\n\nUpdate permission for the target path. Standalone folder creation, deletes, moves, and folder metadata edits require all-files write access; diffs and approvals also require read access.\n\nBase path: /api/v1. Send Authorization: Bearer syn_<key>.\n\nKeys access only their owner's granted paths. New keys have no path grants; legacy unscoped keys normalize to explicit all-files access, while existing scoped grants are preserved. Authenticated requests share their account's plan allowance across all keys.\n\nYour account uses the price and request limits saved at signup. Free currently includes 10/second, 60/minute, 1,000/hour, 10,000/day and 100,000/calendar month. Later catalog changes do not alter existing agreements. Keys cannot raise these limits or reset usage. Windows reset independently at UTC boundaries.\n\nRead and update are independent. Exact file rules override the nearest matching folder; equal-specificity denies win. Folder grants cover future files and optionally descendants. Folder metadata requires an exact _folder.md read grant for restricted keys.\n\nFile creation (createFiles) and standalone folder creation (createFolders) are independent capabilities. Restricted write keys additionally need matching writable folder grants; file-only grants never authorize creation, and recursion and exclusions still apply. Omitted flags preserve existing permissions: all-files write keys retain both capabilities; restricted keys retain legacy createMemories file creation and no folder creation. Explicit createFiles overrides createMemories. Deleting, moving, and editing existing folder metadata require an all-files write key or the owner. Moves that newly expose content to a restricted key return 409 KEY_ACCESS_CHANGE.\n\nUpdate-only keys can obtain the current version through HEAD /memories/{path} (MCP get_memory_version) and replace the whole file. Successful writes return only {path, version}; targeted edits, diffs, and approval also require read access.\n\nTreat change cursors as opaque strings. Restricted cursors are encrypted and bound to the key and current grants. After CURSOR_SCOPE_CHANGED, rebuild the authorized snapshot from cursor 0. Empty hidden-only pages still advance nextCursor.\n\nMoved files receive a new version; historical cloud revision objects are retained.\n\nPending rewrite drafts for moved sources are invalidated. Update bot requests that reference old paths.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "const": "file"
                      },
                      "source": {
                        "type": "string"
                      },
                      "target": {
                        "type": "string"
                      },
                      "version": {
                        "type": "integer",
                        "minimum": 1
                      }
                    },
                    "required": [
                      "kind",
                      "source",
                      "target",
                      "version"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "const": "folder"
                      },
                      "source": {
                        "type": "string"
                      },
                      "target": {
                        "type": "string"
                      },
                      "revision": {
                        "type": "string",
                        "minLength": 64,
                        "maxLength": 64
                      }
                    },
                    "required": [
                      "kind",
                      "source",
                      "target",
                      "revision"
                    ],
                    "additionalProperties": false
                  }
                ]
              },
              "example": {
                "kind": "file",
                "source": "acme/memory/personal/Profile.md",
                "target": "acme/memory/personal/About.md",
                "version": 3
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response. JSON examples use illustrative hashes, timestamps, and revision tokens.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "moved": true,
                  "path": "acme/memory/personal/About.md"
                }
              }
            }
          },
          "401": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request cap exceeded; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/rewrites": {
      "post": {
        "operationId": "proposeRewrite",
        "summary": "Propose a rewrite",
        "description": "Create a reviewable whole-file rewrite draft and diff without changing the source.\n\nUpdate permission for the target path. Standalone folder creation, deletes, moves, and folder metadata edits require all-files write access; diffs and approvals also require read access.\n\nBase path: /api/v1. Send Authorization: Bearer syn_<key>.\n\nKeys access only their owner's granted paths. New keys have no path grants; legacy unscoped keys normalize to explicit all-files access, while existing scoped grants are preserved. Authenticated requests share their account's plan allowance across all keys.\n\nYour account uses the price and request limits saved at signup. Free currently includes 10/second, 60/minute, 1,000/hour, 10,000/day and 100,000/calendar month. Later catalog changes do not alter existing agreements. Keys cannot raise these limits or reset usage. Windows reset independently at UTC boundaries.\n\nRead and update are independent. Exact file rules override the nearest matching folder; equal-specificity denies win. Folder grants cover future files and optionally descendants. Folder metadata requires an exact _folder.md read grant for restricted keys.\n\nFile creation (createFiles) and standalone folder creation (createFolders) are independent capabilities. Restricted write keys additionally need matching writable folder grants; file-only grants never authorize creation, and recursion and exclusions still apply. Omitted flags preserve existing permissions: all-files write keys retain both capabilities; restricted keys retain legacy createMemories file creation and no folder creation. Explicit createFiles overrides createMemories. Deleting, moving, and editing existing folder metadata require an all-files write key or the owner. Moves that newly expose content to a restricted key return 409 KEY_ACCESS_CHANGE.\n\nUpdate-only keys can obtain the current version through HEAD /memories/{path} (MCP get_memory_version) and replace the whole file. Successful writes return only {path, version}; targeted edits, diffs, and approval also require read access.\n\nTreat change cursors as opaque strings. Restricted cursors are encrypted and bound to the key and current grants. After CURSOR_SCOPE_CHANGED, rebuild the authorized snapshot from cursor 0. Empty hidden-only pages still advance nextCursor.\n\nRequires an existing file and its positive observed version. Version zero does not create a file; use POST /memories or MCP create_memory instead.\n\nDrafts expire after 24 hours. Owners review them in Memories; trusted keys can use the approval endpoint.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "path": {
                    "type": "string"
                  },
                  "version": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "markdown": {
                    "type": "string"
                  }
                },
                "required": [
                  "path",
                  "version",
                  "markdown"
                ],
                "additionalProperties": false
              },
              "example": {
                "path": "acme/memory/personal/Profile.md",
                "version": 3,
                "markdown": "# Updated profile"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful response. JSON examples use illustrative hashes, timestamps, and revision tokens.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "id": "<draft-uuid>",
                  "path": "acme/memory/personal/Profile.md",
                  "version": 3,
                  "baseHash": "<source-sha256>",
                  "markdown": "# Updated profile",
                  "diff": "<unified-diff>",
                  "createdAt": "2026-10-16T12:00:00.000Z"
                }
              }
            }
          },
          "401": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request cap exceeded; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/rewrites/{id}/approve": {
      "post": {
        "operationId": "approveRewrite",
        "summary": "Approve a rewrite",
        "description": "Commit a draft only when its base version and hash still match the current file.\n\nRead/write key with explicit rewrite approval enabled.\n\nBase path: /api/v1. Send Authorization: Bearer syn_<key>.\n\nKeys access only their owner's granted paths. New keys have no path grants; legacy unscoped keys normalize to explicit all-files access, while existing scoped grants are preserved. Authenticated requests share their account's plan allowance across all keys.\n\nYour account uses the price and request limits saved at signup. Free currently includes 10/second, 60/minute, 1,000/hour, 10,000/day and 100,000/calendar month. Later catalog changes do not alter existing agreements. Keys cannot raise these limits or reset usage. Windows reset independently at UTC boundaries.\n\nRead and update are independent. Exact file rules override the nearest matching folder; equal-specificity denies win. Folder grants cover future files and optionally descendants. Folder metadata requires an exact _folder.md read grant for restricted keys.\n\nFile creation (createFiles) and standalone folder creation (createFolders) are independent capabilities. Restricted write keys additionally need matching writable folder grants; file-only grants never authorize creation, and recursion and exclusions still apply. Omitted flags preserve existing permissions: all-files write keys retain both capabilities; restricted keys retain legacy createMemories file creation and no folder creation. Explicit createFiles overrides createMemories. Deleting, moving, and editing existing folder metadata require an all-files write key or the owner. Moves that newly expose content to a restricted key return 409 KEY_ACCESS_CHANGE.\n\nUpdate-only keys can obtain the current version through HEAD /memories/{path} (MCP get_memory_version) and replace the whole file. Successful writes return only {path, version}; targeted edits, diffs, and approval also require read access.\n\nTreat change cursors as opaque strings. Restricted cursors are encrypted and bound to the key and current grants. After CURSOR_SCOPE_CHANGED, rebuild the authorized snapshot from cursor 0. Empty hidden-only pages still advance nextCursor.\n\nNo request body. Missing, expired, or stale drafts fail; successful approval removes the pending draft.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Rewrite draft ID returned by POST /rewrites.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response. JSON examples use illustrative hashes, timestamps, and revision tokens.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Memory"
                },
                "example": {
                  "path": "acme/memory/personal/Profile.md",
                  "location": {
                    "organization": "acme",
                    "folders": [
                      "memory",
                      "personal"
                    ],
                    "filename": "Profile.md"
                  },
                  "markdown": "---\norganization: acme\nversion: 3\n---\n# Profile\n\n## Preferences\n\nKeep replies concise.\n",
                  "version": 3,
                  "hash": "<sha256-of-source>",
                  "title": "Profile",
                  "description": "",
                  "descriptionStatus": "missing",
                  "unresolvedDescriptions": [],
                  "sections": [
                    {
                      "id": "profile",
                      "title": "Profile",
                      "depth": 1,
                      "start": 0,
                      "bodyStart": 10,
                      "end": 49,
                      "content": "## Preferences\n\nKeep replies concise.",
                      "description": "",
                      "descriptionStatus": "missing"
                    },
                    {
                      "id": "preferences",
                      "title": "Preferences",
                      "depth": 2,
                      "start": 11,
                      "bodyStart": 26,
                      "end": 49,
                      "content": "Keep replies concise.",
                      "description": "",
                      "descriptionStatus": "missing"
                    }
                  ],
                  "frontmatter": {
                    "organization": "acme",
                    "version": 3
                  },
                  "updatedAt": "2026-10-16T12:00:00.000Z",
                  "warnings": []
                }
              }
            }
          },
          "401": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request cap exceeded; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/webhooks/{id}/rotate-secret": {
      "post": {
        "operationId": "rotateWebhook",
        "summary": "Rotate a webhook secret",
        "description": "Replace the signing secret. The new plaintext is returned only once.\n\nAll-files write key with explicit manageWebhooks: true. Restricted and read-only keys cannot manage subscriptions.\n\nBase path: /api/v1. Send Authorization: Bearer syn_<key>.\n\nKeys access only their owner's granted paths. New keys have no path grants; legacy unscoped keys normalize to explicit all-files access, while existing scoped grants are preserved. Authenticated requests share their account's plan allowance across all keys.\n\nYour account uses the price and request limits saved at signup. Free currently includes 10/second, 60/minute, 1,000/hour, 10,000/day and 100,000/calendar month. Later catalog changes do not alter existing agreements. Keys cannot raise these limits or reset usage. Windows reset independently at UTC boundaries.\n\nRead and update are independent. Exact file rules override the nearest matching folder; equal-specificity denies win. Folder grants cover future files and optionally descendants. Folder metadata requires an exact _folder.md read grant for restricted keys.\n\nFile creation (createFiles) and standalone folder creation (createFolders) are independent capabilities. Restricted write keys additionally need matching writable folder grants; file-only grants never authorize creation, and recursion and exclusions still apply. Omitted flags preserve existing permissions: all-files write keys retain both capabilities; restricted keys retain legacy createMemories file creation and no folder creation. Explicit createFiles overrides createMemories. Deleting, moving, and editing existing folder metadata require an all-files write key or the owner. Moves that newly expose content to a restricted key return 409 KEY_ACCESS_CHANGE.\n\nUpdate-only keys can obtain the current version through HEAD /memories/{path} (MCP get_memory_version) and replace the whole file. Successful writes return only {path, version}; targeted edits, diffs, and approval also require read access.\n\nTreat change cursors as opaque strings. Restricted cursors are encrypted and bound to the key and current grants. After CURSOR_SCOPE_CHANGED, rebuild the authorized snapshot from cursor 0. Empty hidden-only pages still advance nextCursor.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Rewrite draft ID returned by POST /rewrites.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Subscription ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response. JSON examples use illustrative hashes, timestamps, and revision tokens.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "secret": "whsec_..."
                }
              }
            }
          },
          "401": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request cap exceeded; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/webhooks/{id}/test": {
      "post": {
        "operationId": "testWebhook",
        "summary": "Test a webhook",
        "description": "Queue a signed webhook.test delivery.\n\nAll-files write key with explicit manageWebhooks: true. Restricted and read-only keys cannot manage subscriptions.\n\nBase path: /api/v1. Send Authorization: Bearer syn_<key>.\n\nKeys access only their owner's granted paths. New keys have no path grants; legacy unscoped keys normalize to explicit all-files access, while existing scoped grants are preserved. Authenticated requests share their account's plan allowance across all keys.\n\nYour account uses the price and request limits saved at signup. Free currently includes 10/second, 60/minute, 1,000/hour, 10,000/day and 100,000/calendar month. Later catalog changes do not alter existing agreements. Keys cannot raise these limits or reset usage. Windows reset independently at UTC boundaries.\n\nRead and update are independent. Exact file rules override the nearest matching folder; equal-specificity denies win. Folder grants cover future files and optionally descendants. Folder metadata requires an exact _folder.md read grant for restricted keys.\n\nFile creation (createFiles) and standalone folder creation (createFolders) are independent capabilities. Restricted write keys additionally need matching writable folder grants; file-only grants never authorize creation, and recursion and exclusions still apply. Omitted flags preserve existing permissions: all-files write keys retain both capabilities; restricted keys retain legacy createMemories file creation and no folder creation. Explicit createFiles overrides createMemories. Deleting, moving, and editing existing folder metadata require an all-files write key or the owner. Moves that newly expose content to a restricted key return 409 KEY_ACCESS_CHANGE.\n\nUpdate-only keys can obtain the current version through HEAD /memories/{path} (MCP get_memory_version) and replace the whole file. Successful writes return only {path, version}; targeted edits, diffs, and approval also require read access.\n\nTreat change cursors as opaque strings. Restricted cursors are encrypted and bound to the key and current grants. After CURSOR_SCOPE_CHANGED, rebuild the authorized snapshot from cursor 0. Empty hidden-only pages still advance nextCursor.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Rewrite draft ID returned by POST /rewrites.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Subscription ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Successful response. JSON examples use illustrative hashes, timestamps, and revision tokens.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "queued": true
                }
              }
            }
          },
          "401": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request cap exceeded; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "Actionable error; inspect error.code, message, details and requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "syn_<key>"
      }
    },
    "schemas": {
      "MemoryChange": {
        "type": "object",
        "properties": {
          "cursor": {
            "type": "string",
            "description": "Opaque cursor; numeric for all-files keys, encrypted for restricted keys."
          },
          "type": {
            "type": "string",
            "enum": [
              "upsert",
              "delete"
            ]
          },
          "path": {
            "type": "string"
          },
          "version": {
            "type": "integer"
          },
          "hash": {
            "type": "string"
          }
        },
        "required": [
          "cursor",
          "type",
          "path",
          "version",
          "hash"
        ],
        "additionalProperties": false
      },
      "MemoryChanges": {
        "type": "object",
        "properties": {
          "changes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MemoryChange"
            }
          },
          "nextCursor": {
            "type": "string",
            "description": "Persist verbatim. Grant changes invalidate restricted cursors."
          },
          "hasMore": {
            "type": "boolean"
          }
        },
        "required": [
          "changes",
          "nextCursor",
          "hasMore"
        ],
        "additionalProperties": false
      },
      "Location": {
        "type": "object",
        "properties": {
          "organization": {
            "type": "string"
          },
          "folders": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "filename": {
            "type": "string"
          }
        },
        "required": [
          "organization",
          "folders",
          "filename"
        ],
        "additionalProperties": false
      },
      "Section": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "depth": {
            "type": "integer"
          },
          "start": {
            "type": "integer"
          },
          "bodyStart": {
            "type": "integer"
          },
          "end": {
            "type": "integer"
          },
          "content": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "descriptionStatus": {
            "type": "string",
            "enum": [
              "missing",
              "current",
              "needs_review"
            ]
          }
        },
        "required": [
          "id",
          "title",
          "depth",
          "start",
          "bodyStart",
          "end",
          "content",
          "description",
          "descriptionStatus"
        ],
        "additionalProperties": false
      },
      "Memory": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string"
          },
          "location": {
            "$ref": "#/components/schemas/Location"
          },
          "markdown": {
            "type": "string"
          },
          "version": {
            "type": "integer"
          },
          "hash": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "descriptionStatus": {
            "type": "string",
            "enum": [
              "missing",
              "current",
              "needs_review"
            ]
          },
          "unresolvedDescriptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Section"
            }
          },
          "frontmatter": {
            "type": "object",
            "additionalProperties": true
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        },
        "required": [
          "path",
          "location",
          "markdown",
          "version",
          "hash",
          "title",
          "description",
          "descriptionStatus",
          "unresolvedDescriptions",
          "sections",
          "frontmatter",
          "updatedAt",
          "warnings"
        ],
        "additionalProperties": false
      },
      "Folder": {
        "type": "object",
        "properties": {
          "kind": {
            "enum": [
              "organization",
              "folder"
            ]
          },
          "path": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "parentPath": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": "string"
          },
          "version": {
            "type": "integer"
          },
          "revision": {
            "type": "string"
          }
        },
        "required": [
          "kind",
          "path",
          "name",
          "slug",
          "parentPath",
          "description",
          "version",
          "revision"
        ],
        "additionalProperties": false
      },
      "MapFile": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "location": {
            "$ref": "#/components/schemas/Location"
          },
          "description": {
            "type": "string"
          },
          "descriptionStatus": {
            "type": "string",
            "enum": [
              "missing",
              "current",
              "needs_review"
            ]
          },
          "version": {
            "type": "integer"
          },
          "hash": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "unresolvedDescriptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sections": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "depth": {
                  "type": "integer"
                },
                "description": {
                  "type": "string"
                },
                "descriptionStatus": {
                  "type": "string",
                  "enum": [
                    "missing",
                    "current",
                    "needs_review"
                  ]
                }
              },
              "required": [
                "id",
                "title",
                "depth",
                "description",
                "descriptionStatus"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "path",
          "title",
          "location",
          "description",
          "descriptionStatus",
          "version",
          "hash",
          "updatedAt",
          "unresolvedDescriptions",
          "sections"
        ],
        "additionalProperties": false
      },
      "Map": {
        "type": "object",
        "properties": {
          "root": {
            "type": "string"
          },
          "folders": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Folder"
            }
          },
          "files": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MapFile"
            }
          }
        },
        "required": [
          "root",
          "folders",
          "files"
        ],
        "additionalProperties": false
      },
      "DescriptionEdit": {
        "type": "object",
        "properties": {
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ]
          },
          "sections": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 2000
                },
                {
                  "type": "null"
                }
              ]
            }
          }
        },
        "required": [],
        "additionalProperties": false
      },
      "KeyPermissions": {
        "type": "object",
        "properties": {
          "access": {
            "enum": [
              "read",
              "write"
            ]
          },
          "approveRewrites": {
            "type": "boolean",
            "default": false
          },
          "manageWebhooks": {
            "type": "boolean",
            "default": false,
            "description": "Allow an all-files write key to manage account webhook subscriptions."
          },
          "createMemories": {
            "type": "boolean",
            "description": "Legacy file creation flag for restricted keys. Used only when createFiles is omitted. All-files write keys retain their legacy default when createFiles is omitted."
          },
          "createFiles": {
            "type": "boolean",
            "description": "Allow creating files within writable folder grants. Overrides createMemories. Omitted preserves legacy behavior: enabled for all-files write keys, otherwise uses createMemories. Does not enable standalone folder creation."
          },
          "createFolders": {
            "type": "boolean",
            "description": "Allow creating standalone folders within writable folder grants. Independent of file creation. Omitted preserves legacy behavior: enabled for all-files write keys, disabled for restricted keys."
          },
          "scope": {
            "enum": [
              "all",
              "restricted"
            ]
          },
          "rules": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "type": "object",
              "properties": {
                "kind": {
                  "enum": [
                    "file",
                    "folder"
                  ]
                },
                "path": {
                  "type": "string"
                },
                "read": {
                  "type": "boolean"
                },
                "write": {
                  "type": "boolean"
                },
                "recursive": {
                  "type": "boolean"
                }
              },
              "required": [
                "kind",
                "path"
              ],
              "additionalProperties": false,
              "anyOf": [
                {
                  "required": [
                    "read"
                  ]
                },
                {
                  "required": [
                    "write"
                  ]
                }
              ]
            }
          }
        },
        "required": [
          "access"
        ],
        "additionalProperties": false,
        "dependentRequired": {
          "rules": [
            "scope"
          ]
        },
        "allOf": [
          {
            "if": {
              "properties": {
                "access": {
                  "const": "read"
                }
              }
            },
            "then": {
              "properties": {
                "approveRewrites": {
                  "const": false
                },
                "createMemories": {
                  "const": false
                },
                "createFiles": {
                  "const": false
                },
                "createFolders": {
                  "const": false
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "scope": {
                  "const": "all"
                }
              },
              "required": [
                "scope"
              ]
            },
            "then": {
              "properties": {
                "rules": {
                  "maxItems": 0
                }
              }
            }
          }
        ]
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "details": {},
              "requestId": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message",
              "requestId"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false
      }
    }
  }
}
