{ "openapi": "3.1.0", "info": { "title": "agent-fs API", "version": "0.14.0", "description": "A persistent, searchable filesystem for AI agents. agent-fs is to files what agentmail is to email.", "license": { "name": "MIT", "url": "https://github.com/desplega-ai/agent-fs/blob/main/LICENSE" } }, "servers": [ { "url": "http://localhost:7433", "description": "Local development server" } ], "paths": { "/health": { "get": { "summary": "Health check", "operationId": "health", "tags": [ "System" ], "security": [], "responses": { "200": { "description": "Server is healthy", "content": { "application/json": { "schema": { "type": "object", "properties": { "ok": { "type": "boolean", "const": true }, "version": { "type": "string" }, "maxUploadBytes": { "type": "integer", "minimum": 1, "description": "Maximum raw upload size in bytes" }, "features": { "type": "array", "items": { "type": "string" }, "description": "Optional capabilities this server supports (e.g. \"share-links\"). Absent on older servers." } }, "required": [ "ok", "version", "maxUploadBytes" ] } } } } } } }, "/share/{token}": { "get": { "summary": "Public share page", "description": "Unauthenticated HTML preview of a file shared with the share-create op, with a Download button. The token is the only credential. Expired, revoked and used-up links return the same 'link expired' page (404 for an unknown token, 410 otherwise). Each successful page view counts against maxViews.", "operationId": "sharePage", "tags": [ "Share" ], "security": [], "parameters": [ { "name": "token", "in": "path", "required": true, "schema": { "type": "string", "minLength": 43, "maxLength": 43 } } ], "responses": { "200": { "description": "The share page", "content": { "text/html": { "schema": { "type": "string" } } } }, "404": { "description": "Unknown token or file no longer available", "content": { "text/html": { "schema": { "type": "string" } } } }, "410": { "description": "Link expired, revoked or used up", "content": { "text/html": { "schema": { "type": "string" } } } }, "429": { "description": "Too many requests from this address" } } } }, "/share/{token}/raw": { "get": { "summary": "Inline bytes for a share embed", "description": "Serves (or redirects to a short-lived presigned URL for) the shared file inline. Only images, PDF, audio and video; HTML and SVG are never served inline. Does not count as a view.", "operationId": "shareRaw", "tags": [ "Share" ], "security": [], "parameters": [ { "name": "token", "in": "path", "required": true, "schema": { "type": "string", "minLength": 43, "maxLength": 43 } } ], "responses": { "200": { "description": "File bytes" }, "302": { "description": "Redirect to a short-lived presigned URL" }, "404": { "description": "Not found or not embeddable" }, "410": { "description": "Link expired, revoked or used up" } } } }, "/share/{token}/download": { "get": { "summary": "Download a shared file", "description": "Serves (or redirects to a short-lived presigned URL for) the shared file with Content-Disposition: attachment. Does not count as a view.", "operationId": "shareDownload", "tags": [ "Share" ], "security": [], "parameters": [ { "name": "token", "in": "path", "required": true, "schema": { "type": "string", "minLength": 43, "maxLength": 43 } } ], "responses": { "200": { "description": "File bytes as an attachment" }, "302": { "description": "Redirect to a short-lived presigned URL" }, "404": { "description": "File no longer available" }, "410": { "description": "Link expired, revoked or used up" } } } }, "/auth/register": { "post": { "summary": "Register a new user", "operationId": "register", "tags": [ "Auth" ], "security": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "email": { "type": "string", "format": "email" } }, "required": [ "email" ] } } } }, "responses": { "200": { "description": "User registered", "content": { "application/json": { "schema": { "type": "object", "properties": { "userId": { "type": "string" }, "orgId": { "type": "string" }, "driveId": { "type": "string" }, "apiKey": { "type": "string" } }, "required": [ "userId", "orgId", "driveId", "apiKey" ] } } } } } } }, "/auth/me": { "get": { "summary": "Get current user info", "operationId": "me", "tags": [ "Auth" ], "responses": { "200": { "description": "Current user", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "email": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "email", "createdAt" ] } } } } } } }, "/auth/profile": { "get": { "summary": "Get your own profile", "operationId": "getProfile", "tags": [ "Auth" ], "responses": { "200": { "description": "Authenticated user's profile", "content": { "application/json": { "schema": { "type": "object", "required": [ "userId", "email", "displayName" ], "properties": { "userId": { "type": "string" }, "email": { "type": "string" }, "displayName": { "type": [ "string", "null" ] } } } } } }, "401": { "description": "Unauthorized" } } }, "patch": { "summary": "Update your own display name", "description": "Names are trimmed and limited to 1–100 characters. Send null to clear. No target user ID is accepted.", "operationId": "updateProfile", "tags": [ "Auth" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "displayName": { "type": "string", "minLength": 1, "maxLength": 100, "nullable": true } }, "required": [ "displayName" ], "additionalProperties": false } } } }, "responses": { "200": { "description": "Updated profile (same shape as GET /auth/profile)" }, "400": { "description": "Invalid profile fields" }, "401": { "description": "Unauthorized" } } } }, "/auth/reset-key": { "post": { "summary": "Reset your own API key", "description": "Rotates the caller's API key. The old key stops working immediately. Records an api_key_reset audit event.", "operationId": "resetApiKey", "tags": [ "Auth" ], "responses": { "200": { "description": "API key reset", "content": { "application/json": { "schema": { "type": "object", "properties": { "apiKey": { "type": "string" } }, "required": [ "apiKey" ] } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/orgs/{orgId}/members/{userId}/reset-key": { "post": { "summary": "Reset a member's API key (org admin only)", "description": "Org admins can rotate a member's API key on their behalf, e.g. to recover a locked-out user. The old key stops working immediately. Records an api_key_reset audit event with the admin as actor.", "operationId": "resetMemberApiKey", "tags": [ "Auth" ], "parameters": [ { "name": "orgId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Organization ID" }, { "name": "userId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "ID of the member whose key to reset" } ], "responses": { "200": { "description": "Member's API key reset", "content": { "application/json": { "schema": { "type": "object", "properties": { "apiKey": { "type": "string" }, "userId": { "type": "string" }, "email": { "type": "string" } }, "required": [ "apiKey", "userId", "email" ] } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Caller is not an org admin", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Org not found, or userId is not a member of the org", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/orgs/{orgId}/ops": { "post": { "summary": "Dispatch a file operation", "operationId": "dispatchOp", "tags": [ "Operations" ], "description": "All file operations go through this single endpoint. The `op` field determines which operation to execute.", "parameters": [ { "name": "orgId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Organization ID" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "oneOf": [ { "type": "object", "title": "write", "description": "Write or overwrite a file. Creates the file if it doesn't exist, or creates a new version. Use expectedVersion for optimistic concurrency. Returns { version, path, size }.", "required": [ "op", "path", "content" ], "properties": { "op": { "type": "string", "const": "write" }, "driveId": { "type": "string", "description": "Target drive ID (optional, uses default drive)" }, "path": { "type": "string" }, "content": { "type": "string" }, "message": { "type": "string" }, "expectedVersion": { "type": "integer" } }, "additionalProperties": false }, { "type": "object", "title": "cat", "description": "Read file content with optional pagination via offset/limit; defaults to the first 200 lines when limit is omitted. Returns { content, totalLines, truncated } — always check `truncated` before trusting a row/line count. For a complete, byte-exact read (e.g. before parsing as CSV/JSON), use `download` instead.", "required": [ "op", "path" ], "properties": { "op": { "type": "string", "const": "cat" }, "driveId": { "type": "string", "description": "Target drive ID (optional, uses default drive)" }, "path": { "type": "string" }, "offset": { "type": "integer", "minimum": 0 }, "limit": { "type": "integer", "minimum": 1 } }, "additionalProperties": false }, { "type": "object", "title": "edit", "description": "Replace a specific string in a file (surgical find-and-replace). Captures the edit intent as a diff summary in version history. Returns { version, path, changes }.", "required": [ "op", "path", "old_string", "new_string" ], "properties": { "op": { "type": "string", "const": "edit" }, "driveId": { "type": "string", "description": "Target drive ID (optional, uses default drive)" }, "path": { "type": "string" }, "old_string": { "type": "string" }, "new_string": { "type": "string" }, "message": { "type": "string" }, "expectedVersion": { "type": "integer" } }, "additionalProperties": false }, { "type": "object", "title": "append", "description": "Append content to the end of an existing file. Creates a new version. Returns { version, size }.", "required": [ "op", "path", "content" ], "properties": { "op": { "type": "string", "const": "append" }, "driveId": { "type": "string", "description": "Target drive ID (optional, uses default drive)" }, "path": { "type": "string" }, "content": { "type": "string" }, "message": { "type": "string" }, "expectedVersion": { "type": "integer" } }, "additionalProperties": false }, { "type": "object", "title": "ls", "description": "List immediate children of a directory. Returns { entries } where each entry has name, type (file/directory), size, author, modifiedAt.", "required": [ "op" ], "properties": { "op": { "type": "string", "const": "ls" }, "driveId": { "type": "string", "description": "Target drive ID (optional, uses default drive)" }, "path": { "type": "string" } }, "additionalProperties": false }, { "type": "object", "title": "stat", "description": "Get file metadata without reading content. Returns path, size, contentType, author, currentVersion, createdAt, modifiedAt, isDeleted, embeddingStatus, etag (opaque id of the current bytes, compare for equality). Embedding status is pending, indexed, failed, or skipped.", "required": [ "op", "path" ], "properties": { "op": { "type": "string", "const": "stat" }, "driveId": { "type": "string", "description": "Target drive ID (optional, uses default drive)" }, "path": { "type": "string" } }, "additionalProperties": false }, { "type": "object", "title": "reveal", "description": "Everything needed to show one file in a tree, in one call: the ls listing of every ancestor directory (root first) plus the file's stat. Returns { path, stat, listings } where each listing is { path, entries } with entries shaped exactly like ls.", "required": [ "op", "path" ], "properties": { "op": { "type": "string", "const": "reveal" }, "driveId": { "type": "string", "description": "Target drive ID (optional, uses default drive)" }, "path": { "type": "string" } }, "additionalProperties": false }, { "type": "object", "title": "rm", "description": "Delete a file. Removes from S3, cleans up FTS5 index and vector embeddings. Returns { path, deleted }.", "required": [ "op", "path" ], "properties": { "op": { "type": "string", "const": "rm" }, "driveId": { "type": "string", "description": "Target drive ID (optional, uses default drive)" }, "path": { "type": "string" }, "expectedVersion": { "type": "integer" } }, "additionalProperties": false }, { "type": "object", "title": "mv", "description": "Move or rename a file. Preserves version history at the new path. Returns { from, to, version }.", "required": [ "op", "from", "to" ], "properties": { "op": { "type": "string", "const": "mv" }, "driveId": { "type": "string", "description": "Target drive ID (optional, uses default drive)" }, "from": { "type": "string" }, "to": { "type": "string" }, "message": { "type": "string" }, "expectedVersion": { "type": "integer" } }, "additionalProperties": false }, { "type": "object", "title": "cp", "description": "Copy a file using server-side S3 copy. Creates a new version at the destination. Returns { from, to, version }.", "required": [ "op", "from", "to" ], "properties": { "op": { "type": "string", "const": "cp" }, "driveId": { "type": "string", "description": "Target drive ID (optional, uses default drive)" }, "from": { "type": "string" }, "to": { "type": "string" }, "expectedVersion": { "type": "integer" } }, "additionalProperties": false }, { "type": "object", "title": "tail", "description": "Read the last N lines of a file (default 20). Returns { content, totalLines, truncated }.", "required": [ "op", "path" ], "properties": { "op": { "type": "string", "const": "tail" }, "driveId": { "type": "string", "description": "Target drive ID (optional, uses default drive)" }, "path": { "type": "string" }, "lines": { "type": "integer", "minimum": 1 } }, "additionalProperties": false }, { "type": "object", "title": "log", "description": "Show version history for a file. Returns { versions } with version number, author, timestamp, operation type, message, and diff summary.", "required": [ "op", "path" ], "properties": { "op": { "type": "string", "const": "log" }, "driveId": { "type": "string", "description": "Target drive ID (optional, uses default drive)" }, "path": { "type": "string" }, "limit": { "type": "integer", "minimum": 1 } }, "additionalProperties": false }, { "type": "object", "title": "diff", "description": "Show the diff between two versions of a file. Specify v1 and v2 version numbers. Returns { changes } as add/remove/context hunks; when file content was diffed each change carries oldLine/newLine.", "required": [ "op", "path", "v1", "v2" ], "properties": { "op": { "type": "string", "const": "diff" }, "driveId": { "type": "string", "description": "Target drive ID (optional, uses default drive)" }, "path": { "type": "string" }, "v1": { "type": "integer" }, "v2": { "type": "integer" } }, "additionalProperties": false }, { "type": "object", "title": "revert", "description": "Revert a file to a previous version. Creates a new version with the old content. Returns { version, revertedTo }.", "required": [ "op", "path", "version" ], "properties": { "op": { "type": "string", "const": "revert" }, "driveId": { "type": "string", "description": "Target drive ID (optional, uses default drive)" }, "path": { "type": "string" }, "version": { "type": "integer" }, "expectedVersion": { "type": "integer" } }, "additionalProperties": false }, { "type": "object", "title": "recent", "description": "Show recent activity across the drive. Optionally filter by path prefix and time window (since). Returns { entries } with path and version details.", "required": [ "op" ], "properties": { "op": { "type": "string", "const": "recent" }, "driveId": { "type": "string", "description": "Target drive ID (optional, uses default drive)" }, "path": { "type": "string" }, "since": { "type": "string", "format": "date-time" }, "limit": { "type": "integer", "minimum": 1 } }, "additionalProperties": false }, { "type": "object", "title": "grep", "description": "Search file content using regex pattern within a specific path. Returns matching lines with line numbers. Searches the FTS5 index, not S3 directly.", "required": [ "op", "pattern", "path" ], "properties": { "op": { "type": "string", "const": "grep" }, "driveId": { "type": "string", "description": "Target drive ID (optional, uses default drive)" }, "pattern": { "type": "string" }, "path": { "type": "string" } }, "additionalProperties": false }, { "type": "object", "title": "fts", "description": "Full-text search across all file content using FTS5 tokens. Different from grep (regex) and search (semantic). Returns { matches } with path, snippet, and rank.", "required": [ "op", "pattern" ], "properties": { "op": { "type": "string", "const": "fts" }, "driveId": { "type": "string", "description": "Target drive ID (optional, uses default drive)" }, "pattern": { "type": "string" }, "path": { "type": "string" } }, "additionalProperties": false }, { "type": "object", "title": "search", "description": "Hybrid search combining semantic (vector) and keyword (FTS5) matching. Best for natural language queries. Degrades to keyword-only without an embedding provider.", "required": [ "op", "query" ], "properties": { "op": { "type": "string", "const": "search" }, "driveId": { "type": "string", "description": "Target drive ID (optional, uses default drive)" }, "query": { "type": "string" }, "limit": { "type": "integer", "minimum": 1 } }, "additionalProperties": false }, { "type": "object", "title": "vec-search", "description": "Vector-only semantic search using embeddings. Returns results ranked by cosine similarity. Requires an embedding provider (OPENAI_API_KEY, GEMINI_API_KEY, or local).", "required": [ "op", "query" ], "properties": { "op": { "type": "string", "const": "vec-search" }, "driveId": { "type": "string", "description": "Target drive ID (optional, uses default drive)" }, "query": { "type": "string" }, "limit": { "type": "integer", "minimum": 1 } }, "additionalProperties": false }, { "type": "object", "title": "reindex", "description": "Re-index files with failed or missing FTS5/embedding entries. Skip files with indexed or skipped status. Optionally scope to a path prefix. Use after bulk writes or provider changes.", "required": [ "op" ], "properties": { "op": { "type": "string", "const": "reindex" }, "driveId": { "type": "string", "description": "Target drive ID (optional, uses default drive)" }, "path": { "type": "string" } }, "additionalProperties": false }, { "type": "object", "title": "tree", "description": "Recursively list all files and directories. Use depth to limit recursion. Returns a nested tree structure with name, type, size, and children.", "required": [ "op" ], "properties": { "op": { "type": "string", "const": "tree" }, "driveId": { "type": "string", "description": "Target drive ID (optional, uses default drive)" }, "path": { "type": "string" }, "depth": { "type": "integer", "minimum": 1 } }, "additionalProperties": false }, { "type": "object", "title": "glob", "description": "Find files by name pattern. Use `*.md` for root-level files only, `**/*.md` for recursive matching across all subdirectories. Supports `*` (any chars except /), `?` (single char), `**` (any path depth). Optionally scope to a path prefix. Returns { matches } with path, size, and modifiedAt.", "required": [ "op", "pattern" ], "properties": { "op": { "type": "string", "const": "glob" }, "driveId": { "type": "string", "description": "Target drive ID (optional, uses default drive)" }, "pattern": { "type": "string" }, "path": { "type": "string" } }, "additionalProperties": false }, { "type": "object", "title": "sql", "description": "Run a DuckDB SQL query over documents stored in the drive. Reference documents directly by path string literal (e.g. SELECT * FROM '/data/sales.csv') or bind them as named tables via `tables` ({ name: path } or { name: { path, format } } to override format detection). Supports csv, tsv, parquet, xlsx, json, ndjson/jsonl (each also .gz except parquet/xlsx), sqlite (.db/.sqlite/.sqlite3, tables exposed as name.tablename), and .duckdb files. Queries run sandboxed: no filesystem or network access beyond the bound documents. Returns { columns, rows, rowCount, truncated, files, elapsedMs }.", "required": [ "op", "query" ], "properties": { "op": { "type": "string", "const": "sql" }, "driveId": { "type": "string", "description": "Target drive ID (optional, uses default drive)" }, "query": { "type": "string" }, "tables": { "type": "object", "additionalProperties": { "anyOf": [ { "type": "string" }, { "type": "object", "properties": { "path": { "type": "string" }, "format": { "type": "string", "enum": [ "csv", "tsv", "parquet", "xlsx", "json", "ndjson", "sqlite", "duckdb" ] } }, "required": [ "path" ], "additionalProperties": false } ] } }, "maxRows": { "type": "integer", "minimum": 1, "maximum": 10000 } }, "additionalProperties": false }, { "type": "object", "title": "signed-url", "description": "Generate a temporary presigned URL for direct file download. Default expiry is 24 hours (86400 seconds). The URL requires no authentication. Set disposition to \"inline\" when the URL will be rendered in the browser (PDF in an iframe, image in a tab); the default \"attachment\" forces a download. Returns { url, path, expiresIn, expiresAt, kind }.", "required": [ "op", "path" ], "properties": { "op": { "type": "string", "const": "signed-url" }, "driveId": { "type": "string", "description": "Target drive ID (optional, uses default drive)" }, "path": { "type": "string" }, "expiresIn": { "type": "integer", "minimum": 60, "maximum": 604800 }, "disposition": { "type": "string", "enum": [ "inline", "attachment" ] } }, "additionalProperties": false }, { "type": "object", "title": "share-create", "description": "Create a public share link for a file: an unauthenticated /share/ page on the API host with a preview (markdown, text/code, image, PDF, audio, video) and a Download button. Default expiry is 24 hours (max 7 days); set maxViews to limit how often the page can be opened (maxViews=1 is a one-off link). Anyone with the link can open it, so share deliberately. Returns { id, url, sharePath, path, expiresIn, expiresAt, maxViews }. The link is shown only once; keep the id to revoke it.", "required": [ "op", "path" ], "properties": { "op": { "type": "string", "const": "share-create" }, "driveId": { "type": "string", "description": "Target drive ID (optional, uses default drive)" }, "path": { "type": "string" }, "expiresIn": { "type": "integer", "minimum": 60, "maximum": 604800 }, "maxViews": { "type": "integer", "minimum": 1, "maximum": 1000000 } }, "additionalProperties": false }, { "type": "object", "title": "share-revoke", "description": "Revoke share links so they stop working immediately. Pass exactly one of: id (from share-create), token (the token or the full share URL), or path (revokes every link to that file). Only the link's creator or a drive admin can revoke. Returns { revoked, ids }.", "required": [ "op" ], "properties": { "op": { "type": "string", "const": "share-revoke" }, "driveId": { "type": "string", "description": "Target drive ID (optional, uses default drive)" }, "id": { "type": "string" }, "token": { "type": "string" }, "path": { "type": "string" } }, "additionalProperties": false }, { "type": "object", "title": "comment-add", "description": "Add a comment to a file. Supports line ranges, a text-quote anchor ({ exact, prefix, suffix }), mentions by drive-member user ID or email, and threading via parentId. Replies auto-resolve path from parent. Returns { id, path, body, author, createdAt }.", "required": [ "op", "body" ], "properties": { "op": { "type": "string", "const": "comment-add" }, "driveId": { "type": "string", "description": "Target drive ID (optional, uses default drive)" }, "path": { "type": "string" }, "body": { "type": "string" }, "parentId": { "type": "string" }, "mentions": { "type": "array", "items": { "type": "string", "minLength": 1 }, "maxItems": 20 }, "lineStart": { "type": "integer" }, "lineEnd": { "type": "integer" }, "quotedContent": { "type": "string" }, "quote": { "type": "object", "properties": { "exact": { "type": "string" }, "prefix": { "type": "string" }, "suffix": { "type": "string" } }, "required": [ "exact" ], "additionalProperties": false, "description": "Text-quote anchor: the exact selected text plus ~32 chars of context before (prefix) and after (suffix). Lets viewers re-find the selection after the file is edited." } }, "additionalProperties": false }, { "type": "object", "title": "comment-list", "description": "List comments on a file or below a path prefix. Filter by path, pathPrefix, resolved state, or parentId. Defaults to unresolved root comments. Returns { comments } with inline replies.", "required": [ "op" ], "properties": { "op": { "type": "string", "const": "comment-list" }, "driveId": { "type": "string", "description": "Target drive ID (optional, uses default drive)" }, "path": { "type": "string" }, "pathPrefix": { "type": "string" }, "parentId": { "type": "string" }, "resolved": { "type": "boolean" }, "orgId": { "type": "string" }, "limit": { "type": "integer", "minimum": 1 }, "offset": { "type": "integer", "minimum": 0 } }, "additionalProperties": false }, { "type": "object", "title": "comment-get", "description": "Get a single comment by ID with all its replies. Returns { comment, replies }.", "required": [ "op", "id" ], "properties": { "op": { "type": "string", "const": "comment-get" }, "driveId": { "type": "string", "description": "Target drive ID (optional, uses default drive)" }, "id": { "type": "string" } }, "additionalProperties": false }, { "type": "object", "title": "comment-update", "description": "Update a comment's body and optionally replace its mentions. Mentions accept drive-member user IDs or emails. Only the original author can update. Returns { id, body, updatedAt }.", "required": [ "op", "id", "body" ], "properties": { "op": { "type": "string", "const": "comment-update" }, "driveId": { "type": "string", "description": "Target drive ID (optional, uses default drive)" }, "id": { "type": "string" }, "body": { "type": "string" }, "mentions": { "type": "array", "items": { "type": "string", "minLength": 1 }, "maxItems": 20 } }, "additionalProperties": false }, { "type": "object", "title": "comment-delete", "description": "Soft-delete a comment. Only the original author can delete. Deleting a root comment also soft-deletes its replies. Returns { deleted }.", "required": [ "op", "id" ], "properties": { "op": { "type": "string", "const": "comment-delete" }, "driveId": { "type": "string", "description": "Target drive ID (optional, uses default drive)" }, "id": { "type": "string" } }, "additionalProperties": false }, { "type": "object", "title": "comment-resolve", "description": "Resolve or reopen a root comment. Set resolved=true to resolve, resolved=false to reopen. Only root comments can be resolved. Returns { id, resolved, resolvedBy, resolvedAt }.", "required": [ "op", "id", "resolved" ], "properties": { "op": { "type": "string", "const": "comment-resolve" }, "driveId": { "type": "string", "description": "Target drive ID (optional, uses default drive)" }, "id": { "type": "string" }, "resolved": { "type": "boolean" } }, "additionalProperties": false }, { "type": "object", "title": "comment-notification-list", "description": "List comment or mention notifications for the current user in the active drive. Defaults to comment notifications. Returns { notifications, unreadCount }.", "required": [ "op" ], "properties": { "op": { "type": "string", "const": "comment-notification-list" }, "driveId": { "type": "string", "description": "Target drive ID (optional, uses default drive)" }, "unreadOnly": { "type": "boolean" }, "kinds": { "type": "array", "items": { "type": "string", "enum": [ "comment", "mention" ] }, "minItems": 1 }, "limit": { "type": "integer", "minimum": 1, "maximum": 100 }, "offset": { "type": "integer", "minimum": 0 } }, "additionalProperties": false }, { "type": "object", "title": "comment-notification-read", "description": "Mark selected comment or mention notification IDs, or all notifications of the selected kinds in the active drive, as read. All defaults to comment notifications. Returns { markedRead }.", "required": [ "op" ], "properties": { "op": { "type": "string", "const": "comment-notification-read" }, "driveId": { "type": "string", "description": "Target drive ID (optional, uses default drive)" }, "ids": { "type": "array", "items": { "type": "string" }, "minItems": 1, "maxItems": 100 }, "all": { "type": "boolean", "enum": [ true ] }, "kinds": { "type": "array", "items": { "type": "string", "enum": [ "comment", "mention" ] }, "minItems": 1 } }, "additionalProperties": false }, { "type": "object", "title": "drive-members", "description": "List members of the active drive. Returns { members } with userId, email, and displayName. Membership roles are not included.", "required": [ "op" ], "properties": { "op": { "type": "string", "const": "drive-members" }, "driveId": { "type": "string", "description": "Target drive ID (optional, uses default drive)" } }, "additionalProperties": false } ], "discriminator": { "propertyName": "op" } } } } }, "responses": { "200": { "description": "Operation result (varies by op)", "content": { "application/json": { "schema": { "type": "object", "description": "Response shape depends on the operation. See each op's description for details." } } } }, "400": { "description": "Validation error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Permission denied (RBAC)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "File or resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } } }, "components": { "securitySchemes": { "bearerAuth": { "type": "http", "scheme": "bearer", "description": "API key obtained from /auth/register" } }, "schemas": { "Error": { "type": "object", "properties": { "error": { "type": "string" }, "message": { "type": "string" } }, "required": [ "error", "message" ] } } }, "security": [ { "bearerAuth": [] } ] }