{ "schemes": [ "http", "https" ], "swagger": "2.0", "info": { "description": "API for Acontext.", "title": "Acontext API", "contact": {}, "version": "1.0" }, "basePath": "/api/v1", "paths": { "/disk": { "get": { "security": [ { "BearerAuth": [] } ], "description": "List all disks under a project", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "disk" ], "summary": "List disks", "parameters": [ { "type": "integer", "description": "Limit of disks to return, default 20. Max 200.", "name": "limit", "in": "query" }, { "type": "string", "description": "Cursor for pagination. Use the cursor from the previous response to get the next page.", "name": "cursor", "in": "query" }, { "type": "boolean", "example": false, "description": "Order by created_at descending if true, ascending if false (default false)", "name": "time_desc", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/service.ListDisksOutput" } } } ] } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Create a disk group under a project", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "disk" ], "summary": "Create disk", "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.Disk" } } } ] } } } } }, "/disk/{disk_id}": { "delete": { "security": [ { "BearerAuth": [] } ], "description": "Delete a disk by its UUID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "disk" ], "summary": "Delete disk", "parameters": [ { "type": "string", "format": "uuid", "example": "123e4567-e89b-12d3-a456-426614174000", "description": "Disk ID", "name": "disk_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/serializer.Response" } } } } }, "/disk/{disk_id}/artifact": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get artifact information by path and filename. Optionally include a presigned URL for downloading and parsed file content.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "artifact" ], "summary": "Get artifact", "parameters": [ { "type": "string", "format": "uuid", "example": "123e4567-e89b-12d3-a456-426614174000", "description": "Disk ID", "name": "disk_id", "in": "path", "required": true }, { "type": "string", "description": "File path including filename", "name": "file_path", "in": "query", "required": true }, { "type": "boolean", "description": "Whether to return public URL, default is true", "name": "with_public_url", "in": "query" }, { "type": "boolean", "description": "Whether to return parsed file content, default is true", "name": "with_content", "in": "query" }, { "type": "integer", "description": "Expire time in seconds for presigned URL (default: 3600)", "name": "expire", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handler.GetArtifactResp" } } } ] } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "Update an artifact's metadata (user-defined metadata only)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "artifact" ], "summary": "Update artifact meta", "parameters": [ { "type": "string", "format": "uuid", "example": "123e4567-e89b-12d3-a456-426614174000", "description": "Disk ID", "name": "disk_id", "in": "path", "required": true }, { "description": "File path including filename", "name": "file_path", "in": "body", "required": true, "schema": { "type": "string" } }, { "description": "Custom metadata as JSON string (system metadata '__artifact_info__' cannot be modified)", "name": "meta", "in": "body", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handler.UpdateArtifactResp" } } } ] } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Upload a file and create or update an artifact record under a disk", "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "artifact" ], "summary": "Upsert artifact", "parameters": [ { "type": "string", "format": "uuid", "example": "123e4567-e89b-12d3-a456-426614174000", "description": "Disk ID", "name": "disk_id", "in": "path", "required": true }, { "type": "string", "description": "File path in the disk storage (optional, defaults to '/')", "name": "file_path", "in": "formData" }, { "type": "file", "description": "File to upload", "name": "file", "in": "formData", "required": true }, { "type": "string", "description": "Custom metadata as JSON string (optional, system metadata will be stored under '__artifact_info__' key)", "name": "meta", "in": "formData" } ], "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.Artifact" } } } ] } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "Delete an artifact by path and filename", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "artifact" ], "summary": "Delete artifact", "parameters": [ { "type": "string", "format": "uuid", "example": "123e4567-e89b-12d3-a456-426614174000", "description": "Disk ID", "name": "disk_id", "in": "path", "required": true }, { "type": "string", "description": "File path including filename", "name": "file_path", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/serializer.Response" } } } } }, "/disk/{disk_id}/artifact/ls": { "get": { "security": [ { "BearerAuth": [] } ], "description": "List artifacts in a specific path or all artifacts in a disk", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "artifact" ], "summary": "List artifacts", "parameters": [ { "type": "string", "format": "uuid", "example": "123e4567-e89b-12d3-a456-426614174000", "description": "Disk ID", "name": "disk_id", "in": "path", "required": true }, { "type": "string", "description": "Path filter (optional, defaults to root '/')", "name": "path", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handler.ListArtifactsResp" } } } ] } } } } }, "/session": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get all sessions under a project, optionally filtered by space_id", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "session" ], "summary": "Get sessions", "parameters": [ { "type": "string", "format": "uuid", "description": "Space ID to filter sessions", "name": "space_id", "in": "query" }, { "type": "boolean", "example": false, "description": "Filter sessions not connected to any space (default false)", "name": "not_connected", "in": "query" }, { "type": "integer", "description": "Limit of sessions to return, default 20. Max 200.", "name": "limit", "in": "query" }, { "type": "string", "description": "Cursor for pagination. Use the cursor from the previous response to get the next page.", "name": "cursor", "in": "query" }, { "type": "string", "description": "Order by created_at descending if true, ascending if false (default false)", "name": "time_desc", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/service.ListSessionsOutput" } } } ] } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Create a new session under a space", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "session" ], "summary": "Create session", "parameters": [ { "description": "CreateSession payload", "name": "payload", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.CreateSessionReq" } } ], "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.Session" } } } ] } } } } }, "/session/{session_id}": { "delete": { "security": [ { "BearerAuth": [] } ], "description": "Delete a session by id", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "session" ], "summary": "Delete session", "parameters": [ { "type": "string", "format": "uuid", "description": "Session ID", "name": "session_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/serializer.Response" } } } } }, "/session/{session_id}/configs": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get session configs by id", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "session" ], "summary": "Get session configs", "parameters": [ { "type": "string", "format": "uuid", "description": "Session ID", "name": "session_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.Session" } } } ] } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "Update session configs by id", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "session" ], "summary": "Update session configs", "parameters": [ { "type": "string", "format": "uuid", "description": "Session ID", "name": "session_id", "in": "path", "required": true }, { "description": "UpdateSessionConfigs payload", "name": "payload", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.UpdateSessionConfigsReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/serializer.Response" } } } } }, "/session/{session_id}/connect_to_space": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Connect a session to a space by id", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "session" ], "summary": "Connect session to space", "parameters": [ { "type": "string", "format": "uuid", "description": "Session ID", "name": "session_id", "in": "path", "required": true }, { "description": "ConnectToSpace payload", "name": "payload", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.ConnectToSpaceReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/serializer.Response" } } } } }, "/session/{session_id}/messages": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get messages from session. Default format is openai. Can convert to acontext (original) or anthropic format.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "session" ], "summary": "Get messages from session", "parameters": [ { "type": "string", "format": "uuid", "description": "Session ID", "name": "session_id", "in": "path", "required": true }, { "type": "integer", "description": "Limit of messages to return, default 20. Max 200.", "name": "limit", "in": "query" }, { "type": "string", "description": "Cursor for pagination. Use the cursor from the previous response to get the next page.", "name": "cursor", "in": "query" }, { "type": "string", "description": "Whether to return asset public url, default is true", "name": "with_asset_public_url", "in": "query" }, { "enum": [ "acontext", "openai", "anthropic" ], "type": "string", "description": "Format to convert messages to: acontext (original), openai (default), anthropic.", "name": "format", "in": "query" }, { "type": "string", "description": "Order by created_at descending if true, ascending if false (default false)", "name": "time_desc", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/service.GetMessagesOutput" } } } ] } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Supports JSON and multipart/form-data. In multipart mode: the payload is a JSON string placed in a form field. The format parameter indicates the format of the input message (default: openai, same as GET). The blob field should be a complete message object: for openai, use OpenAI ChatCompletionMessageParam format (with role and content); for anthropic, use Anthropic MessageParam format (with role and content); for acontext (internal), use {role, parts} format.", "consumes": [ "application/json", "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "session" ], "summary": "Send message to session", "parameters": [ { "type": "string", "format": "uuid", "description": "Session ID", "name": "session_id", "in": "path", "required": true }, { "description": "SendMessage payload (Content-Type: application/json)", "name": "payload", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.SendMessageReq" } }, { "type": "string", "description": "SendMessage payload (Content-Type: multipart/form-data)", "name": "payload", "in": "formData" }, { "type": "file", "description": "When uploading files, the field name must correspond to parts[*].file_field.", "name": "file", "in": "formData" } ], "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.Message" } } } ] } } } } }, "/session/{session_id}/task": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get tasks from session with cursor-based pagination", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "task" ], "summary": "Get tasks from session", "parameters": [ { "type": "string", "format": "uuid", "description": "Session ID", "name": "session_id", "in": "path", "required": true }, { "type": "integer", "description": "Limit of tasks to return, default 20. Max 200.", "name": "limit", "in": "query" }, { "type": "string", "description": "Cursor for pagination. Use the cursor from the previous response to get the next page.", "name": "cursor", "in": "query" }, { "type": "boolean", "example": false, "description": "Order by created_at descending if true, ascending if false (default false)", "name": "time_desc", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/service.GetTasksOutput" } } } ] } } } } }, "/space": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get all spaces under a project", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "space" ], "summary": "Get spaces", "parameters": [ { "type": "integer", "description": "Limit of spaces to return, default 20. Max 200.", "name": "limit", "in": "query" }, { "type": "string", "description": "Cursor for pagination. Use the cursor from the previous response to get the next page.", "name": "cursor", "in": "query" }, { "type": "string", "description": "Order by created_at descending if true, ascending if false (default false)", "name": "time_desc", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/service.ListSpacesOutput" } } } ] } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Create a new space under a project", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "space" ], "summary": "Create space", "parameters": [ { "description": "CreateSpace payload", "name": "payload", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.CreateSpaceReq" } } ], "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.Space" } } } ] } } } } }, "/space/{space_id}": { "delete": { "security": [ { "BearerAuth": [] } ], "description": "Delete a space by its ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "space" ], "summary": "Delete space", "parameters": [ { "type": "string", "format": "uuid", "example": "123e4567-e89b-12d3-a456-426614174000", "description": "Space ID", "name": "space_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/serializer.Response" } } } } }, "/space/{space_id}/block": { "get": { "security": [ { "BearerAuth": [] } ], "description": "List blocks in a space. Use type query parameter to filter by block type (page, folder, text, sop, etc.). Use parent_id query parameter to filter by parent. If both type and parent_id are empty, returns top-level pages and folders.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "block" ], "summary": "List blocks", "parameters": [ { "type": "string", "format": "uuid", "description": "Space ID", "name": "space_id", "in": "path", "required": true }, { "enum": [ "page", "folder", "text", "sop" ], "type": "string", "description": "Block type", "name": "type", "in": "query" }, { "type": "string", "format": "uuid", "description": "Parent ID", "name": "parent_id", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/model.Block" } } } } ] } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Create a new block (supports all types: page, folder, text, sop, etc.). For page and folder types, parent_id is optional. For other types, parent_id is required.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "block" ], "summary": "Create block", "parameters": [ { "type": "string", "format": "uuid", "description": "Space ID", "name": "space_id", "in": "path", "required": true }, { "description": "CreateBlock payload", "name": "payload", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.CreateBlockReq" } } ], "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/httpclient.InsertBlockResponse" } } } ] } } } } }, "/space/{space_id}/block/{block_id}": { "delete": { "security": [ { "BearerAuth": [] } ], "description": "Delete a block by its ID (works for all block types: page, folder, text, sop, etc.)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "block" ], "summary": "Delete block", "parameters": [ { "type": "string", "format": "uuid", "description": "Space ID", "name": "space_id", "in": "path", "required": true }, { "type": "string", "format": "uuid", "description": "Block ID", "name": "block_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/serializer.Response" } } } } }, "/space/{space_id}/block/{block_id}/move": { "put": { "security": [ { "BearerAuth": [] } ], "description": "Move block by updating its parent_id. Works for all block types (page, folder, text, sop, etc.). For page and folder types, parent_id can be null (root level).", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "block" ], "summary": "Move block", "parameters": [ { "type": "string", "format": "uuid", "description": "Space ID", "name": "space_id", "in": "path", "required": true }, { "type": "string", "format": "uuid", "description": "Block ID", "name": "block_id", "in": "path", "required": true }, { "description": "MoveBlock payload", "name": "payload", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.MoveBlockReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/serializer.Response" } } } } }, "/space/{space_id}/block/{block_id}/properties": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get a block's properties by its ID (works for all block types: page, folder, text, sop, etc.)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "block" ], "summary": "Get block properties", "parameters": [ { "type": "string", "format": "uuid", "description": "Space ID", "name": "space_id", "in": "path", "required": true }, { "type": "string", "format": "uuid", "description": "Block ID", "name": "block_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.Block" } } } ] } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "Update a block's title and properties by its ID (works for all block types: page, folder, text, sop, etc.)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "block" ], "summary": "Update block properties", "parameters": [ { "type": "string", "format": "uuid", "description": "Space ID", "name": "space_id", "in": "path", "required": true }, { "type": "string", "format": "uuid", "description": "Block ID", "name": "block_id", "in": "path", "required": true }, { "description": "UpdateBlockProperties payload", "name": "payload", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.UpdateBlockPropertiesReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/serializer.Response" } } } } }, "/space/{space_id}/block/{block_id}/sort": { "put": { "security": [ { "BearerAuth": [] } ], "description": "Update block sort value (works for all block types: page, folder, text, sop, etc.)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "block" ], "summary": "Update block sort", "parameters": [ { "type": "string", "format": "uuid", "description": "Space ID", "name": "space_id", "in": "path", "required": true }, { "type": "string", "format": "uuid", "description": "Block ID", "name": "block_id", "in": "path", "required": true }, { "description": "UpdateBlockSort payload", "name": "payload", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.UpdateBlockSortReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/serializer.Response" } } } } }, "/space/{space_id}/configs": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Retrieve the configurations of a space by its ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "space" ], "summary": "Get space configs", "parameters": [ { "type": "string", "format": "uuid", "example": "123e4567-e89b-12d3-a456-426614174000", "description": "Space ID", "name": "space_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.Space" } } } ] } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "Update the configurations of a space by its ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "space" ], "summary": "Update space configs", "parameters": [ { "type": "string", "format": "uuid", "example": "123e4567-e89b-12d3-a456-426614174000", "description": "Space ID", "name": "space_id", "in": "path", "required": true }, { "description": "UpdateConfigs payload", "name": "payload", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.UpdateSpaceConfigsReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/serializer.Response" } } } } }, "/space/{space_id}/experience_search": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Retrieve the experience search results for a given query within a space by its ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "space" ], "summary": "Get experience search", "parameters": [ { "type": "string", "format": "uuid", "example": "123e4567-e89b-12d3-a456-426614174000", "description": "Space ID", "name": "space_id", "in": "path", "required": true }, { "type": "string", "description": "Search query for page/folder titles", "name": "query", "in": "query", "required": true }, { "type": "integer", "description": "Maximum number of results to return (1-50, default 10)", "name": "limit", "in": "query" }, { "type": "string", "description": "Search mode: fast or agentic (default fast)", "name": "mode", "in": "query" }, { "type": "number", "format": "float64", "description": "Cosine distance threshold (0=identical, 2=opposite)", "name": "semantic_threshold", "in": "query" }, { "type": "integer", "description": "Maximum number of iterations for agentic search (1-100, default 16)", "name": "max_iterations", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/httpclient.SpaceSearchResult" } } } ] } } } } }, "/space/{space_id}/semantic_global": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Retrieve the semantic global (glob) search results for page/folder titles within a space by its ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "space" ], "summary": "Get semantic global", "parameters": [ { "type": "string", "format": "uuid", "example": "123e4567-e89b-12d3-a456-426614174000", "description": "Space ID", "name": "space_id", "in": "path", "required": true }, { "type": "string", "description": "Search query for page/folder titles", "name": "query", "in": "query", "required": true }, { "type": "integer", "description": "Maximum number of results to return (1-50, default 10)", "name": "limit", "in": "query" }, { "type": "number", "format": "float64", "description": "Cosine distance threshold (0=identical, 2=opposite)", "name": "threshold", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/httpclient.SearchResultBlockItem" } } } } ] } } } } }, "/space/{space_id}/semantic_grep": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Retrieve the semantic grep search results for content blocks within a space by its ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "space" ], "summary": "Get semantic grep", "parameters": [ { "type": "string", "format": "uuid", "example": "123e4567-e89b-12d3-a456-426614174000", "description": "Space ID", "name": "space_id", "in": "path", "required": true }, { "type": "string", "description": "Search query for content blocks", "name": "query", "in": "query", "required": true }, { "type": "integer", "description": "Maximum number of results to return (1-50, default 10)", "name": "limit", "in": "query" }, { "type": "number", "format": "float64", "description": "Cosine distance threshold (0=identical, 2=opposite)", "name": "threshold", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/httpclient.SearchResultBlockItem" } } } } ] } } } } } }, "definitions": { "fileparser.FileContent": { "type": "object", "properties": { "raw": { "description": "Raw text content", "type": "string" }, "type": { "description": "\"text\", \"json\", \"csv\", \"code\"", "type": "string" } } }, "handler.ConnectToSpaceReq": { "type": "object", "required": [ "space_id" ], "properties": { "space_id": { "type": "string", "format": "uuid", "example": "123e4567-e89b-12d3-a456-426614174000" } } }, "handler.CreateBlockReq": { "type": "object", "required": [ "type" ], "properties": { "parent_id": { "type": "string" }, "props": { "type": "object", "additionalProperties": {} }, "title": { "type": "string" }, "type": { "type": "string", "example": "text" } } }, "handler.CreateSessionReq": { "type": "object", "properties": { "configs": { "type": "object", "additionalProperties": true }, "space_id": { "type": "string", "format": "uuid", "example": "123e4567-e89b-12d3-a456-42661417" } } }, "handler.CreateSpaceReq": { "type": "object", "properties": { "configs": { "type": "object", "additionalProperties": true } } }, "handler.GetArtifactResp": { "type": "object", "properties": { "artifact": { "$ref": "#/definitions/model.Artifact" }, "content": { "$ref": "#/definitions/fileparser.FileContent" }, "public_url": { "type": "string" } } }, "handler.ListArtifactsResp": { "type": "object", "properties": { "artifacts": { "type": "array", "items": { "$ref": "#/definitions/model.Artifact" } }, "directories": { "type": "array", "items": { "type": "string" } } } }, "handler.MoveBlockReq": { "type": "object", "properties": { "parent_id": { "type": "string" }, "sort": { "type": "integer" } } }, "handler.SendMessageReq": { "type": "object", "required": [ "blob" ], "properties": { "blob": {}, "format": { "type": "string", "enum": [ "acontext", "openai", "anthropic" ], "example": "openai" } } }, "handler.UpdateArtifactResp": { "type": "object", "properties": { "artifact": { "$ref": "#/definitions/model.Artifact" } } }, "handler.UpdateBlockPropertiesReq": { "type": "object", "properties": { "props": { "type": "object", "additionalProperties": {} }, "title": { "type": "string" } } }, "handler.UpdateBlockSortReq": { "type": "object", "properties": { "sort": { "type": "integer" } } }, "handler.UpdateSessionConfigsReq": { "type": "object", "properties": { "configs": { "type": "object", "additionalProperties": true } } }, "handler.UpdateSpaceConfigsReq": { "type": "object", "required": [ "configs" ], "properties": { "configs": { "type": "object", "additionalProperties": true } } }, "httpclient.InsertBlockResponse": { "type": "object", "properties": { "id": { "type": "string" } } }, "httpclient.SearchResultBlockItem": { "type": "object", "properties": { "block_id": { "type": "string" }, "distance": { "type": "number" }, "props": { "type": "object", "additionalProperties": true }, "title": { "type": "string" }, "type": { "type": "string" } } }, "httpclient.SpaceSearchResult": { "type": "object", "properties": { "cited_blocks": { "type": "array", "items": { "$ref": "#/definitions/httpclient.SearchResultBlockItem" } }, "final_answer": { "type": "string" } } }, "model.Artifact": { "type": "object", "properties": { "created_at": { "type": "string" }, "disk_id": { "type": "string" }, "filename": { "type": "string" }, "meta": { "type": "object" }, "path": { "type": "string" }, "updated_at": { "type": "string" } } }, "model.Block": { "type": "object", "properties": { "created_at": { "type": "string" }, "id": { "type": "string" }, "is_archived": { "type": "boolean" }, "parent_id": { "type": "string" }, "props": { "type": "object" }, "sort": { "type": "integer" }, "space_id": { "type": "string" }, "title": { "type": "string" }, "type": { "type": "string" }, "updated_at": { "type": "string" } } }, "model.Disk": { "type": "object", "properties": { "created_at": { "type": "string" }, "id": { "type": "string" }, "project_id": { "type": "string" }, "updated_at": { "type": "string" } } }, "model.Message": { "type": "object", "properties": { "created_at": { "type": "string" }, "id": { "type": "string" }, "meta": { "type": "object" }, "parent_id": { "type": "string" }, "parts": { "type": "array", "items": { "type": "object" } }, "role": { "type": "string" }, "session_id": { "type": "string" }, "session_task_process_status": { "type": "string" }, "task_id": { "type": "string" }, "updated_at": { "type": "string" } } }, "model.Session": { "type": "object", "properties": { "configs": { "type": "object" }, "created_at": { "type": "string" }, "id": { "type": "string" }, "project_id": { "type": "string" }, "space_id": { "type": "string" }, "updated_at": { "type": "string" } } }, "model.Space": { "type": "object", "properties": { "configs": { "type": "object" }, "created_at": { "type": "string" }, "id": { "type": "string" }, "project_id": { "type": "string" }, "updated_at": { "type": "string" } } }, "model.Task": { "type": "object", "properties": { "created_at": { "type": "string" }, "data": { "type": "object" }, "id": { "type": "string" }, "is_planning": { "type": "boolean" }, "order": { "type": "integer" }, "project_id": { "type": "string" }, "session_id": { "type": "string" }, "space_digested": { "type": "boolean" }, "status": { "type": "string" }, "updated_at": { "type": "string" } } }, "serializer.Response": { "type": "object", "properties": { "code": { "type": "integer" }, "data": {}, "error": { "type": "string" }, "msg": { "type": "string" } } }, "service.GetMessagesOutput": { "type": "object", "properties": { "has_more": { "type": "boolean" }, "items": { "type": "array", "items": { "$ref": "#/definitions/model.Message" } }, "next_cursor": { "type": "string" }, "public_urls": { "description": "file_name -\u003e url", "type": "object", "additionalProperties": { "$ref": "#/definitions/service.PublicURL" } } } }, "service.GetTasksOutput": { "type": "object", "properties": { "has_more": { "type": "boolean" }, "items": { "type": "array", "items": { "$ref": "#/definitions/model.Task" } }, "next_cursor": { "type": "string" } } }, "service.ListDisksOutput": { "type": "object", "properties": { "has_more": { "type": "boolean" }, "items": { "type": "array", "items": { "$ref": "#/definitions/model.Disk" } }, "next_cursor": { "type": "string" } } }, "service.ListSessionsOutput": { "type": "object", "properties": { "has_more": { "type": "boolean" }, "items": { "type": "array", "items": { "$ref": "#/definitions/model.Session" } }, "next_cursor": { "type": "string" } } }, "service.ListSpacesOutput": { "type": "object", "properties": { "has_more": { "type": "boolean" }, "items": { "type": "array", "items": { "$ref": "#/definitions/model.Space" } }, "next_cursor": { "type": "string" } } }, "service.PublicURL": { "type": "object", "properties": { "expire_at": { "type": "string" }, "url": { "type": "string" } } } }, "securityDefinitions": { "BearerAuth": { "description": "Project Bearer token (e.g., \"Bearer sk-ac-xxxx\")", "type": "apiKey", "name": "Authorization", "in": "header" } } }