{ "openapi": "3.1.0", "info": { "title": "Coline App Platform API", "version": "1.0.0-beta", "summary": "Workspace-native app registry, install, and runtime APIs for Coline.", "description": "Canonical OpenAPI source for the current stable app-platform slice. This document covers the public store catalog plus the `/api/v1` workspace install/runtime surface." }, "servers": [ { "url": "https://coline.app", "description": "Production" }, { "url": "http://localhost:3000", "description": "Local development" } ], "tags": [ { "name": "Store", "description": "Public store catalog and approved app releases." }, { "name": "Publisher", "description": "Authenticated app registration and version creation APIs." }, { "name": "Auth", "description": "Login with Coline OAuth endpoints." }, { "name": "AI", "description": "Tab API endpoints for completions and model discovery." }, { "name": "Workspace installs", "description": "Workspace app install and permission APIs." }, { "name": "Runtime", "description": "Installed app file, index, notification, and ambient APIs." }, { "name": "Members", "description": "Workspace member listing." }, { "name": "Docs", "description": "Workspace document CRUD with page layout." }, { "name": "Drives", "description": "Workspace drive listing." }, { "name": "Files", "description": "File metadata, update, and deletion." }, { "name": "Notes", "description": "Workspace note CRUD." }, { "name": "Calendar", "description": "Calendar event CRUD." }, { "name": "Search", "description": "Workspace content search." }, { "name": "Tasks", "description": "Taskboard and task CRUD." }, { "name": "Channels", "description": "Workspace channel listing and message reading." }, { "name": "Direct Messages", "description": "Workspace DM listing and message reading." }, { "name": "Messages", "description": "Message detail, editing, deletion, threads, reactions, and pins." } ], "paths": { "/api/v1/tab/models": { "get": { "tags": [ "AI" ], "summary": "List Tab models", "operationId": "listTabModels", "responses": { "200": { "description": "Tab model list", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TabModelsResponse" } } } } } } }, "/api/v1/tab/chat/completions": { "post": { "tags": [ "AI" ], "summary": "Create an OpenAI-compatible Tab chat completion", "operationId": "createTabChatCompletion", "security": [ { "bearerAuth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TabChatCompletionInput" } } } }, "responses": { "200": { "description": "OpenAI-compatible Tab chat completion", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TabChatCompletionResponseEnvelope" } } } }, "400": { "description": "Validation or model error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "402": { "description": "Insufficient credits", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } } } }, "/api/v1/oauth/authorize": { "get": { "tags": [ "Auth" ], "summary": "Authorize an OAuth client", "operationId": "authorizeOauthClient", "parameters": [ { "name": "response_type", "in": "query", "required": true, "schema": { "type": "string", "const": "code" } }, { "name": "client_id", "in": "query", "required": true, "schema": { "type": "string" } }, { "name": "redirect_uri", "in": "query", "required": true, "schema": { "type": "string", "format": "uri" } }, { "name": "scope", "in": "query", "required": false, "schema": { "type": "string" } }, { "name": "state", "in": "query", "required": false, "schema": { "type": "string" } }, { "name": "code_challenge", "in": "query", "required": false, "schema": { "type": "string" } }, { "name": "code_challenge_method", "in": "query", "required": false, "schema": { "type": "string" } } ], "responses": { "302": { "description": "Redirect to sign-in or back to the client redirect URI" }, "400": { "description": "Invalid authorization request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } } } }, "/api/v1/oauth/token": { "post": { "tags": [ "Auth" ], "summary": "Exchange an authorization code for tokens", "operationId": "exchangeOauthAuthorizationCode", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OAuthTokenExchangeInput" } }, "application/x-www-form-urlencoded": { "schema": { "$ref": "#/components/schemas/OAuthTokenExchangeInput" } } } }, "responses": { "200": { "description": "Token response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OAuthTokenResponse" } } } }, "400": { "description": "Invalid token request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OAuthErrorResponse" } } } } } } }, "/api/v1/oauth/userinfo": { "get": { "tags": [ "Auth" ], "summary": "Resolve OAuth userinfo", "operationId": "getOauthUserInfo", "security": [ { "bearerAuth": [] } ], "responses": { "200": { "description": "User info", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OAuthUserInfoResponse" } } } }, "401": { "description": "Invalid token", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OAuthErrorResponse" } } } } } } }, "/api/v1/apps": { "get": { "tags": [ "Store" ], "summary": "List store apps", "operationId": "listStoreApps", "responses": { "200": { "description": "Store apps", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/StoreAppsResponse" } } } } } }, "post": { "tags": [ "Publisher" ], "summary": "Register a new app and initial release", "operationId": "registerApp", "security": [ { "bearerAuth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RegisterAppInput" } } } }, "responses": { "201": { "description": "Registered app", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AppVersionMutationResponse" } } } } } } }, "/api/v1/apps/{appKey}": { "get": { "tags": [ "Store" ], "summary": "Get a store app", "operationId": "getStoreApp", "parameters": [ { "name": "appKey", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Store app detail", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/StoreAppResponse" } } } }, "404": { "description": "App not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } } } }, "/api/v1/apps/{appKey}/versions": { "get": { "tags": [ "Store" ], "summary": "List approved versions for a store app", "operationId": "listStoreAppVersions", "parameters": [ { "name": "appKey", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Approved store app versions", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/StoreAppVersionsResponse" } } } } } }, "post": { "tags": [ "Publisher" ], "summary": "Create a new app version", "operationId": "createAppVersion", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "appKey", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RegisterAppInput" } } } }, "responses": { "201": { "description": "Created app version", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AppVersionMutationResponse" } } } } } } }, "/api/v1/apps/{appKey}/versions/{versionId}/submit": { "post": { "tags": [ "Publisher" ], "summary": "Submit an app version for review", "operationId": "submitAppVersionForReview", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "appKey", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "versionId", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "storeListed": { "type": "boolean" } } } } } }, "responses": { "200": { "description": "Submitted app version", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SubmitAppVersionForReviewResponse" } } } } } } }, "/api/v1/workspaces/{workspaceSlug}/apps": { "get": { "tags": [ "Workspace installs" ], "summary": "List installed apps and workspace-visible catalog", "operationId": "listWorkspaceApps", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Workspace app data", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WorkspaceAppsResponse" } } } } } }, "post": { "tags": [ "Workspace installs" ], "summary": "Install an app into a workspace", "operationId": "installWorkspaceApp", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InstallWorkspaceAppInput" } } } }, "responses": { "201": { "description": "Installed app", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InstallWorkspaceAppResponse" } } } } } } }, "/api/v1/workspaces/{workspaceSlug}/apps/{appKey}": { "get": { "tags": [ "Workspace installs" ], "summary": "Get an installed workspace app", "operationId": "getWorkspaceInstalledApp", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "appKey", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Installed app", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WorkspaceInstalledAppResponse" } } } } } }, "delete": { "tags": [ "Workspace installs" ], "summary": "Uninstall a workspace app", "operationId": "uninstallWorkspaceApp", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "appKey", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "App uninstalled", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OkResponse" } } } } } } }, "/api/v1/workspaces/{workspaceSlug}/apps/{appKey}/permissions": { "get": { "tags": [ "Workspace installs" ], "summary": "Get granted workspace app permissions", "operationId": "getWorkspaceAppPermissions", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "appKey", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Workspace app permissions", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WorkspaceAppPermissionsResponse" } } } } } }, "put": { "tags": [ "Workspace installs" ], "summary": "Update granted workspace app permissions", "operationId": "updateWorkspaceAppPermissions", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "appKey", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "grantedPermissions" ], "properties": { "grantedPermissions": { "type": "array", "items": { "type": "string" } } } } } } }, "responses": { "200": { "description": "Updated permissions", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WorkspaceAppPermissionsResponse" } } } } } } }, "/api/v1/workspaces/{workspaceSlug}/apps/{appKey}/secrets": { "get": { "tags": [ "Workspace installs" ], "summary": "List app secrets", "operationId": "listWorkspaceAppSecrets", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "appKey", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "App secrets", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WorkspaceAppSecretsResponse" } } } } } }, "post": { "tags": [ "Workspace installs" ], "summary": "Create or rotate app secret", "operationId": "createWorkspaceAppSecret", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "appKey", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "key", "value" ], "properties": { "key": { "type": "string" }, "value": { "type": "string" } } } } } }, "responses": { "201": { "description": "App secret stored", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateWorkspaceAppSecretResponse" } } } } } } }, "/api/v1/workspaces/{workspaceSlug}/apps/{appKey}/secrets/{secretId}": { "delete": { "tags": [ "Workspace installs" ], "summary": "Delete app secret", "operationId": "deleteWorkspaceAppSecret", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "appKey", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "secretId", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "App secret deleted", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OkResponse" } } } } } } }, "/api/v1/workspaces/{workspaceSlug}/apps/{appKey}/oauth-connections": { "get": { "tags": [ "Workspace installs" ], "summary": "List app OAuth connections", "operationId": "listWorkspaceAppOauthConnections", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "appKey", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "App OAuth connections", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WorkspaceAppOauthConnectionsResponse" } } } } } }, "post": { "tags": [ "Workspace installs" ], "summary": "Create or update app OAuth connection", "operationId": "createWorkspaceAppOauthConnection", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "appKey", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "providerKey", "accessToken", "scopes" ], "properties": { "providerKey": { "type": "string" }, "externalAccountId": { "type": "string" }, "accessToken": { "type": "string" }, "refreshToken": { "type": "string" }, "scopes": { "type": "array", "items": { "type": "string" } }, "tokenExpiresAt": { "type": "string", "format": "date-time" }, "metadata": { "type": "object", "additionalProperties": true } } } } } }, "responses": { "201": { "description": "App OAuth connection stored", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateWorkspaceAppOauthConnectionResponse" } } } } } } }, "/api/v1/workspaces/{workspaceSlug}/apps/{appKey}/oauth-connections/{connectionId}": { "delete": { "tags": [ "Workspace installs" ], "summary": "Delete app OAuth connection", "operationId": "deleteWorkspaceAppOauthConnection", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "appKey", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "connectionId", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "App OAuth connection deleted", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OkResponse" } } } } } } }, "/api/v1/workspaces/{workspaceSlug}/apps/{appKey}/deliveries": { "get": { "tags": [ "Workspace installs" ], "summary": "List app deliveries", "operationId": "listWorkspaceAppDeliveries", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "appKey", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "App deliveries", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WorkspaceAppDeliveriesResponse" } } } } } }, "post": { "tags": [ "Workspace installs" ], "summary": "Send a signed test delivery", "operationId": "sendWorkspaceAppTestDelivery", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "appKey", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "eventType", "payload" ], "properties": { "eventType": { "type": "string" }, "targetUrl": { "type": "string" }, "payload": { "type": "object", "additionalProperties": true } } } } } }, "responses": { "201": { "description": "Test delivery recorded", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SendWorkspaceAppTestDeliveryResponse" } } } } } } }, "/api/v1/workspaces/{workspaceSlug}/apps/{appKey}/deliveries/{deliveryId}/replay": { "post": { "tags": [ "Workspace installs" ], "summary": "Replay a stored app delivery", "operationId": "replayWorkspaceAppDelivery", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "appKey", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "deliveryId", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Delivery replayed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SendWorkspaceAppTestDeliveryResponse" } } } } } } }, "/api/v1/workspaces/{workspaceSlug}/apps/{appKey}/files/{fileId}": { "get": { "tags": [ "Runtime" ], "summary": "Read an app-backed file document", "operationId": "getAppFileDocument", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "appKey", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "fileId", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "App-backed file document", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AppFileDocumentResponse" } } } } } }, "patch": { "tags": [ "Runtime" ], "summary": "Update an app-backed file document", "operationId": "updateAppFileDocument", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "appKey", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "fileId", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "document" ], "properties": { "document": { "type": "object", "additionalProperties": true } } } } } }, "responses": { "200": { "description": "Updated app-backed file document", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AppFileDocumentUpdateResponse" } } } } } } }, "/api/v1/workspaces/{workspaceSlug}/apps/{appKey}/files": { "get": { "tags": [ "Runtime" ], "summary": "List app-backed files", "operationId": "listAppFiles", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "appKey", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "driveId", "in": "query", "required": false, "schema": { "type": "string" } }, { "name": "typeKey", "in": "query", "required": false, "schema": { "type": "string" } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100 } } ], "responses": { "200": { "description": "App-backed file list", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AppFilesListResponse" } } } } } }, "post": { "tags": [ "Runtime" ], "summary": "Create an app-backed file", "operationId": "createAppFile", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "appKey", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateAppFileInput" } } } }, "responses": { "201": { "description": "Created app-backed file", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateAppFileResponse" } } } } } } }, "/api/v1/workspaces/{workspaceSlug}/apps/{appKey}/actions": { "post": { "tags": [ "Runtime" ], "summary": "Execute a hosted app action", "operationId": "executeAppAction", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "appKey", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ExecuteAppActionInput" } } } }, "responses": { "200": { "description": "Hosted app action result", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ExecuteAppActionResponse" } } } } } } }, "/api/v1/workspaces/{workspaceSlug}/apps/{appKey}/notifications": { "post": { "tags": [ "Runtime" ], "summary": "Create an app notification", "operationId": "createAppNotification", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "appKey", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateAppNotificationInput" } } } }, "responses": { "201": { "description": "Notification created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OkResponse" } } } } } } }, "/api/v1/workspaces/{workspaceSlug}/apps/{appKey}/index-documents": { "post": { "tags": [ "Runtime" ], "summary": "Upsert app index documents", "operationId": "upsertAppIndexDocuments", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "appKey", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpsertAppIndexDocumentsInput" } } } }, "responses": { "201": { "description": "Index documents upserted", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpsertAppIndexDocumentsResponse" } } } } } }, "delete": { "tags": [ "Runtime" ], "summary": "Delete app index documents", "operationId": "deleteAppIndexDocuments", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "appKey", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeleteAppIndexDocumentsInput" } } } }, "responses": { "200": { "description": "Index documents deleted", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeleteAppIndexDocumentsResponse" } } } } } } }, "/api/v1/workspaces/{workspaceSlug}/apps/{appKey}/ambient/events": { "post": { "tags": [ "Runtime" ], "summary": "Emit app ambient events", "operationId": "emitAppAmbientEvents", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "appKey", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EmitAppAmbientEventsInput" } } } }, "responses": { "201": { "description": "Ambient events accepted", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EmitAppAmbientEventsResponse" } } } } } } }, "/api/v1/workspaces/{workspaceSlug}/members": { "get": { "tags": ["Members"], "summary": "List workspace members", "operationId": "listWorkspaceMembers", "security": [{ "bearerAuth": [] }], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "List of workspace members", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListWorkspaceMembersResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } } } }, "/api/v1/workspaces/{workspaceSlug}/docs": { "get": { "tags": ["Docs"], "summary": "List workspace docs", "operationId": "listWorkspaceDocs", "security": [{ "bearerAuth": [] }], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "q", "in": "query", "required": false, "description": "Search docs by title", "schema": { "type": "string", "maxLength": 200 } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 20 } }, { "name": "cursor", "in": "query", "required": false, "description": "Opaque pagination cursor from a previous response", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Paginated list of docs", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListWorkspaceDocsResponse" } } } }, "400": { "description": "Invalid query parameters", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } } }, "post": { "tags": ["Docs"], "summary": "Create a workspace doc", "operationId": "createWorkspaceDoc", "security": [{ "bearerAuth": [] }], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateDocInput" } } } }, "responses": { "201": { "description": "Created doc", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DocResponse" } } } }, "400": { "description": "Validation error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } } } }, "/api/v1/workspaces/{workspaceSlug}/docs/{docId}": { "get": { "tags": ["Docs"], "summary": "Get a workspace doc with full content", "operationId": "getWorkspaceDoc", "security": [{ "bearerAuth": [] }], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "docId", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Doc with full content and layout", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DocDetailResponse" } } } }, "404": { "description": "Doc not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } } }, "patch": { "tags": ["Docs"], "summary": "Update a workspace doc", "operationId": "updateWorkspaceDoc", "security": [{ "bearerAuth": [] }], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "docId", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateDocInput" } } } }, "responses": { "200": { "description": "Updated doc", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DocDetailResponse" } } } }, "400": { "description": "Validation error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "404": { "description": "Doc not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } } }, "delete": { "tags": ["Docs"], "summary": "Delete (trash) a workspace doc", "operationId": "deleteWorkspaceDoc", "security": [{ "bearerAuth": [] }], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "docId", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Doc trashed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OkResponse" } } } }, "404": { "description": "Doc not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } } } }, "/api/v1/workspaces/{workspaceSlug}/drives": { "get": { "tags": ["Drives"], "summary": "List workspace drives", "operationId": "listWorkspaceDrives", "security": [{ "bearerAuth": [] }], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "List of workspace drives", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListWorkspaceDrivesResponse" } } } } } } }, "/api/v1/workspaces/{workspaceSlug}/drives/{driveId}/files": { "get": { "tags": ["Files"], "summary": "List files in a drive", "operationId": "listDriveFiles", "security": [{ "bearerAuth": [] }], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "driveId", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "parentId", "in": "query", "required": false, "description": "List files inside this folder", "schema": { "type": "string" } }, { "name": "fileType", "in": "query", "required": false, "description": "Filter by file type (e.g. doc, note, folder)", "schema": { "type": "string" } }, { "name": "trashed", "in": "query", "required": false, "schema": { "type": "boolean", "default": false } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 50 } }, { "name": "cursor", "in": "query", "required": false, "description": "Opaque pagination cursor", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Paginated list of files", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListDriveFilesResponse" } } } }, "400": { "description": "Invalid query parameters", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "404": { "description": "Drive not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } } } }, "/api/v1/workspaces/{workspaceSlug}/files/{fileId}": { "get": { "tags": ["Files"], "summary": "Get file metadata", "operationId": "getFile", "security": [{ "bearerAuth": [] }], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "fileId", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "File metadata", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FileDetailResponse" } } } }, "404": { "description": "File not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } } }, "patch": { "tags": ["Files"], "summary": "Update a file (rename, move, recolor)", "operationId": "updateFile", "security": [{ "bearerAuth": [] }], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "fileId", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateFileInput" } } } }, "responses": { "200": { "description": "Updated file", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FileDetailResponse" } } } }, "400": { "description": "Validation error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "404": { "description": "File not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } } }, "delete": { "tags": ["Files"], "summary": "Delete (trash) a file", "operationId": "deleteFile", "security": [{ "bearerAuth": [] }], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "fileId", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "File trashed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OkResponse" } } } }, "404": { "description": "File not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } } } }, "/api/v1/workspaces/{workspaceSlug}/notes": { "get": { "tags": ["Notes"], "summary": "List workspace notes", "operationId": "listWorkspaceNotes", "security": [{ "bearerAuth": [] }], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "q", "in": "query", "required": false, "description": "Search notes by title", "schema": { "type": "string", "maxLength": 200 } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 20 } }, { "name": "cursor", "in": "query", "required": false, "description": "Opaque pagination cursor from a previous response", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Paginated list of notes", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListWorkspaceNotesResponse" } } } }, "400": { "description": "Invalid query parameters", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } } }, "post": { "tags": ["Notes"], "summary": "Create a workspace note", "operationId": "createWorkspaceNote", "security": [{ "bearerAuth": [] }], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateNoteInput" } } } }, "responses": { "201": { "description": "Created note", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NoteResponse" } } } }, "400": { "description": "Validation error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } } } }, "/api/v1/workspaces/{workspaceSlug}/notes/{noteId}": { "get": { "tags": ["Notes"], "summary": "Get a workspace note with content", "operationId": "getWorkspaceNote", "security": [{ "bearerAuth": [] }], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "noteId", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Note with full content", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NoteDetailResponse" } } } }, "404": { "description": "Note not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } } }, "put": { "tags": ["Notes"], "summary": "Update a workspace note", "operationId": "updateWorkspaceNote", "security": [{ "bearerAuth": [] }], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "noteId", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateNoteInput" } } } }, "responses": { "200": { "description": "Updated note", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NoteResponse" } } } }, "400": { "description": "Validation error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "404": { "description": "Note not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } } }, "delete": { "tags": ["Notes"], "summary": "Delete (trash) a workspace note", "operationId": "deleteWorkspaceNote", "security": [{ "bearerAuth": [] }], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "noteId", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Note trashed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OkResponse" } } } }, "404": { "description": "Note not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } } } }, "/api/v1/workspaces/{workspaceSlug}/calendar/events": { "get": { "tags": ["Calendar"], "summary": "List calendar events in a date range", "operationId": "listCalendarEvents", "security": [{ "bearerAuth": [] }], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "start", "in": "query", "required": true, "description": "Range start as ISO 8601 datetime", "schema": { "type": "string", "format": "date-time" } }, { "name": "end", "in": "query", "required": true, "description": "Range end as ISO 8601 datetime", "schema": { "type": "string", "format": "date-time" } } ], "responses": { "200": { "description": "Calendar events in the requested range", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListCalendarEventsResponse" } } } }, "400": { "description": "Invalid date range", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } } }, "post": { "tags": ["Calendar"], "summary": "Create a calendar event", "operationId": "createCalendarEvent", "security": [{ "bearerAuth": [] }], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateCalendarEventInput" } } } }, "responses": { "201": { "description": "Created calendar event", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CalendarEventDetailResponse" } } } }, "400": { "description": "Validation error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } } } }, "/api/v1/workspaces/{workspaceSlug}/calendar/events/{eventId}": { "get": { "tags": ["Calendar"], "summary": "Get a calendar event", "operationId": "getCalendarEvent", "security": [{ "bearerAuth": [] }], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "eventId", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Calendar event detail", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CalendarEventDetailResponse" } } } }, "404": { "description": "Event not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } } }, "patch": { "tags": ["Calendar"], "summary": "Update a calendar event", "operationId": "updateCalendarEvent", "security": [{ "bearerAuth": [] }], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "eventId", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateCalendarEventInput" } } } }, "responses": { "200": { "description": "Updated calendar event", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CalendarEventDetailResponse" } } } }, "400": { "description": "Validation error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "404": { "description": "Event not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } } }, "delete": { "tags": ["Calendar"], "summary": "Delete a calendar event", "operationId": "deleteCalendarEvent", "security": [{ "bearerAuth": [] }], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "eventId", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Event deleted", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OkResponse" } } } }, "404": { "description": "Event not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } } } }, "/api/v1/workspaces/{workspaceSlug}/search": { "post": { "tags": ["Search"], "summary": "Search workspace content", "operationId": "searchWorkspace", "security": [{ "bearerAuth": [] }], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WorkspaceSearchInput" } } } }, "responses": { "200": { "description": "Search results", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WorkspaceSearchResponse" } } } }, "400": { "description": "Validation error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } } } }, "/api/v1/workspaces/{workspaceSlug}/taskboards": { "get": { "tags": ["Tasks"], "summary": "List workspace taskboards", "operationId": "listWorkspaceTaskboards", "security": [{ "bearerAuth": [] }], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "List of taskboards with statuses", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListWorkspaceTaskboardsResponse" } } } } } } }, "/api/v1/workspaces/{workspaceSlug}/taskboards/{taskboardId}/tasks": { "get": { "tags": ["Tasks"], "summary": "List tasks on a taskboard", "operationId": "listTaskboardTasks", "security": [{ "bearerAuth": [] }], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "taskboardId", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "q", "in": "query", "required": false, "description": "Search tasks by title or description", "schema": { "type": "string", "maxLength": 200 } }, { "name": "statusId", "in": "query", "required": false, "description": "Filter by status ID", "schema": { "type": "string" } }, { "name": "assigneeUserId", "in": "query", "required": false, "description": "Filter by assignee user ID", "schema": { "type": "string" } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 50 } } ], "responses": { "200": { "description": "List of tasks", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListTaskboardTasksResponse" } } } }, "404": { "description": "Taskboard not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } } }, "post": { "tags": ["Tasks"], "summary": "Create a task on a taskboard", "operationId": "createTaskboardTask", "security": [{ "bearerAuth": [] }], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "taskboardId", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateTaskInput" } } } }, "responses": { "201": { "description": "Created task", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateTaskResponse" } } } }, "400": { "description": "Validation error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "404": { "description": "Taskboard not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } } } }, "/api/v1/workspaces/{workspaceSlug}/taskboards/{taskboardId}/tasks/{taskId}": { "patch": { "tags": ["Tasks"], "summary": "Update a task", "operationId": "updateTaskboardTask", "security": [{ "bearerAuth": [] }], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "taskboardId", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "taskId", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateTaskInput" } } } }, "responses": { "200": { "description": "Task updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OkResponse" } } } }, "400": { "description": "Validation error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "404": { "description": "Task not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } } }, "delete": { "tags": ["Tasks"], "summary": "Delete a task", "operationId": "deleteTaskboardTask", "security": [{ "bearerAuth": [] }], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "taskboardId", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "taskId", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Task deleted", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OkResponse" } } } }, "404": { "description": "Task not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } } } }, "/api/v1/workspaces/{workspaceSlug}/channels": { "get": { "tags": ["Channels"], "operationId": "listWorkspaceChannels", "summary": "List channels", "description": "Returns all non-archived channels in the workspace. Only team workspaces have channels; personal workspaces return an empty array.", "security": [{ "bearerAuth": [] }], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Channel list", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChannelListResponse" } } } } } } }, "/api/v1/workspaces/{workspaceSlug}/channels/{channelId}/messages": { "get": { "tags": ["Channels"], "operationId": "listChannelMessages", "summary": "List channel messages", "description": "Returns root-level messages in decreasing chronological order with cursor-based pagination.", "security": [{ "bearerAuth": [] }], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "channelId", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 50 } }, { "name": "cursor", "in": "query", "schema": { "type": "string" }, "description": "Opaque pagination cursor returned in previous response." } ], "responses": { "200": { "description": "Paginated message list", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessagesListResponse" } } } }, "404": { "description": "Channel not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } } }, "post": { "tags": ["Channels"], "operationId": "sendChannelMessage", "summary": "Send a message to a channel", "description": "Sends a message to the specified channel. Requires user context (session auth).", "security": [{ "bearerAuth": [] }], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "channelId", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SendMessageInput" } } } }, "responses": { "201": { "description": "Message sent", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SendMessageResponse" } } } }, "404": { "description": "Channel not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } } } }, "/api/v1/workspaces/{workspaceSlug}/dms": { "get": { "tags": ["Direct Messages"], "operationId": "listWorkspaceDms", "summary": "List direct messages", "description": "Returns workspace-scoped DM conversations with member details.", "security": [{ "bearerAuth": [] }], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "DM list", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DmListResponse" } } } } } } }, "/api/v1/workspaces/{workspaceSlug}/dms/{dmId}/messages": { "get": { "tags": ["Direct Messages"], "operationId": "listDmMessages", "summary": "List DM messages", "description": "Returns root-level messages in a DM conversation in decreasing chronological order with cursor-based pagination.", "security": [{ "bearerAuth": [] }], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "dmId", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 50 } }, { "name": "cursor", "in": "query", "schema": { "type": "string" }, "description": "Opaque pagination cursor returned in previous response." } ], "responses": { "200": { "description": "Paginated message list", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessagesListResponse" } } } }, "404": { "description": "DM not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } } }, "post": { "tags": ["Direct Messages"], "operationId": "sendDmMessage", "summary": "Send a message to a DM", "description": "Sends a message in a DM conversation. Requires user context (session auth).", "security": [{ "bearerAuth": [] }], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "dmId", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SendMessageInput" } } } }, "responses": { "201": { "description": "Message sent", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SendMessageResponse" } } } }, "404": { "description": "DM not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } } } }, "/api/v1/workspaces/{workspaceSlug}/messages/{messageId}": { "get": { "tags": ["Messages"], "operationId": "getMessage", "summary": "Get a message", "description": "Retrieves a single message by ID, including container context.", "security": [{ "bearerAuth": [] }], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "messageId", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Message detail", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageDetailResponse" } } } }, "404": { "description": "Message not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } } }, "patch": { "tags": ["Messages"], "operationId": "editMessage", "summary": "Edit a message", "description": "Updates the content of a message. Only the author can edit.", "security": [{ "bearerAuth": [] }], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "messageId", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EditMessageInput" } } } }, "responses": { "200": { "description": "Updated message", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageDetailResponse" } } } }, "403": { "description": "Not the message author", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "404": { "description": "Message not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } } }, "delete": { "tags": ["Messages"], "operationId": "deleteMessage", "summary": "Delete a message", "description": "Soft-deletes a message. Only the author can delete.", "security": [{ "bearerAuth": [] }], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "messageId", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Message deleted", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OkResponse" } } } }, "403": { "description": "Not the message author", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } }, "404": { "description": "Message not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } } } }, "/api/v1/workspaces/{workspaceSlug}/messages/{messageId}/thread": { "get": { "tags": ["Messages"], "operationId": "getThread", "summary": "Get thread replies", "description": "Returns the root message and up to 200 thread replies in ascending chronological order.", "security": [{ "bearerAuth": [] }], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "messageId", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Thread with root message and replies", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ThreadResponse" } } } }, "404": { "description": "Message not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } } }, "post": { "tags": ["Messages"], "operationId": "replyToThread", "summary": "Reply to a thread", "description": "Posts a reply to a message thread. Requires user context.", "security": [{ "bearerAuth": [] }], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "messageId", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ThreadReplyInput" } } } }, "responses": { "201": { "description": "Reply posted", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SendMessageResponse" } } } }, "404": { "description": "Message not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } } } }, "/api/v1/workspaces/{workspaceSlug}/messages/{messageId}/reactions/{emoji}": { "put": { "tags": ["Messages"], "operationId": "addReaction", "summary": "Add a reaction", "description": "Adds an emoji reaction to a message. Idempotent.", "security": [{ "bearerAuth": [] }], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "messageId", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "emoji", "in": "path", "required": true, "schema": { "type": "string" }, "description": "URL-encoded emoji character." } ], "responses": { "200": { "description": "Reaction applied", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReactionResponse" } } } }, "404": { "description": "Message not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } } }, "delete": { "tags": ["Messages"], "operationId": "removeReaction", "summary": "Remove a reaction", "description": "Removes a specific emoji reaction from a message.", "security": [{ "bearerAuth": [] }], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "messageId", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "emoji", "in": "path", "required": true, "schema": { "type": "string" }, "description": "URL-encoded emoji character." } ], "responses": { "200": { "description": "Reaction removed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OkResponse" } } } }, "404": { "description": "Message not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } } } }, "/api/v1/workspaces/{workspaceSlug}/messages/{messageId}/pin": { "put": { "tags": ["Messages"], "operationId": "pinMessage", "summary": "Pin a message", "description": "Pins a message in its container. Idempotent.", "security": [{ "bearerAuth": [] }], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "messageId", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Message pinned", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PinResponse" } } } }, "404": { "description": "Message not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } } }, "delete": { "tags": ["Messages"], "operationId": "unpinMessage", "summary": "Unpin a message", "description": "Removes a pin from a message.", "security": [{ "bearerAuth": [] }], "parameters": [ { "name": "workspaceSlug", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "messageId", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Message unpinned", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PinResponse" } } } }, "404": { "description": "Message not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } } } } }, "components": { "securitySchemes": { "bearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "API key or session-backed bearer token" } }, "schemas": { "ErrorEnvelope": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } }, "OAuthErrorResponse": { "type": "object", "required": [ "error", "error_description" ], "properties": { "error": { "type": "string" }, "error_description": { "type": "string" } } }, "OAuthTokenExchangeInput": { "type": "object", "required": [ "grant_type", "client_id", "client_secret", "code", "redirect_uri" ], "properties": { "grant_type": { "type": "string", "const": "authorization_code" }, "client_id": { "type": "string" }, "client_secret": { "type": "string" }, "code": { "type": "string" }, "redirect_uri": { "type": "string", "format": "uri" }, "code_verifier": { "type": "string" } } }, "OAuthTokenResponse": { "type": "object", "required": [ "access_token", "token_type", "expires_in", "refresh_token", "scope" ], "properties": { "access_token": { "type": "string" }, "token_type": { "type": "string", "const": "Bearer" }, "expires_in": { "type": "integer" }, "refresh_token": { "type": "string" }, "scope": { "type": "string" } } }, "OAuthUserInfoResponse": { "type": "object", "required": [ "sub", "email", "email_verified", "name", "given_name", "family_name", "picture", "preferred_username", "scope" ], "properties": { "sub": { "type": "string" }, "email": { "type": "string" }, "email_verified": { "type": "boolean" }, "name": { "type": "string" }, "given_name": { "type": [ "string", "null" ] }, "family_name": { "type": [ "string", "null" ] }, "picture": { "type": [ "string", "null" ] }, "preferred_username": { "type": [ "string", "null" ] }, "scope": { "type": "string" } } }, "TabModelRecord": { "type": "object", "required": [ "id", "object", "created", "owned_by", "providerModelId", "pricing", "capabilities" ], "properties": { "id": { "type": "string" }, "object": { "type": "string", "const": "model" }, "created": { "type": "integer" }, "owned_by": { "type": "string" }, "providerModelId": { "type": "string" }, "pricing": { "type": "object", "required": [ "inputPerMillionUsd", "outputPerMillionUsd" ], "properties": { "inputPerMillionUsd": { "type": "number" }, "outputPerMillionUsd": { "type": "number" } } }, "capabilities": { "type": "object", "required": [ "streaming", "surfaces" ], "properties": { "streaming": { "type": "boolean" }, "surfaces": { "type": "array", "items": { "type": "string" } } } } } }, "TabModelsResponse": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "object", "required": [ "object", "data" ], "properties": { "object": { "type": "string", "const": "list" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/TabModelRecord" } } } } } }, "TabChatCompletionInput": { "type": "object", "required": [ "model", "tab_context" ], "properties": { "model": { "type": "string" }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" }, "content": { "type": "string" } } } }, "stream": { "type": "boolean" }, "max_tokens": { "type": "integer" }, "max_completion_tokens": { "type": "integer" }, "temperature": { "type": "number" }, "top_p": { "type": "number" }, "tab_context": { "type": "object", "additionalProperties": true } } }, "TabChatCompletionResponseEnvelope": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "object", "required": [ "id", "object", "created", "model", "choices", "usage" ], "properties": { "id": { "type": "string" }, "object": { "type": "string", "const": "chat.completion" }, "created": { "type": "integer" }, "model": { "type": "string" }, "choices": { "type": "array", "items": { "type": "object", "required": [ "index", "message", "finish_reason" ], "properties": { "index": { "type": "integer" }, "message": { "type": "object", "required": [ "role", "content" ], "properties": { "role": { "type": "string", "const": "assistant" }, "content": { "type": "string" } } }, "finish_reason": { "type": "string", "const": "stop" } } } }, "usage": { "type": "object", "required": [ "prompt_tokens", "completion_tokens", "total_tokens" ], "properties": { "prompt_tokens": { "type": "integer" }, "completion_tokens": { "type": "integer" }, "total_tokens": { "type": "integer" } } } } } } }, "OkResponse": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "object", "required": [ "ok" ], "properties": { "ok": { "type": "boolean", "const": true } } } } }, "AppCatalogItem": { "type": "object", "required": [ "appId", "appKey", "name", "description", "iconUrl", "status", "latestPublishedVersion", "latestPublishedVersionId", "isInstalled" ], "properties": { "appId": { "type": "string" }, "appKey": { "type": "string" }, "name": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "iconUrl": { "type": [ "string", "null" ] }, "status": { "type": "string" }, "latestPublishedVersion": { "type": [ "string", "null" ] }, "latestPublishedVersionId": { "type": [ "string", "null" ] }, "isInstalled": { "type": "boolean" } } }, "RegisteredAppDetail": { "type": "object", "required": [ "appId", "appKey", "name", "description", "iconUrl", "status", "ownerUserId", "storeListed", "latestPublishedVersion", "latestPublishedVersionId" ], "properties": { "appId": { "type": "string" }, "appKey": { "type": "string" }, "name": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "iconUrl": { "type": [ "string", "null" ] }, "status": { "type": "string" }, "ownerUserId": { "type": [ "string", "null" ] }, "storeListed": { "type": "boolean" }, "latestPublishedVersion": { "type": [ "string", "null" ] }, "latestPublishedVersionId": { "type": [ "string", "null" ] } } }, "RegisteredAppVersionSummary": { "type": "object", "required": [ "versionId", "version", "status", "reviewStatus", "apiBaseUrl", "permissions", "notificationChannels", "kairo", "fileTypes", "submittedAt", "reviewedAt", "reviewNotes", "publishedAt", "createdAt", "updatedAt" ], "properties": { "versionId": { "type": "string" }, "version": { "type": "string" }, "status": { "type": "string" }, "reviewStatus": { "type": "string" }, "apiBaseUrl": { "type": "string" }, "permissions": { "type": "array", "items": { "type": "string" } }, "notificationChannels": { "type": "array", "items": { "type": "object", "required": [ "key", "name", "defaultDeliveries", "defaultPriority" ], "properties": { "key": { "type": "string" }, "name": { "type": "string" }, "description": { "type": "string" }, "defaultDeliveries": { "type": "array", "items": { "type": "string" } }, "defaultPriority": { "type": "string" } } } }, "kairo": { "oneOf": [ { "type": "object", "additionalProperties": true }, { "type": "null" } ] }, "fileTypes": { "type": "array", "items": { "type": "object", "required": [ "typeKey", "name", "description" ], "properties": { "typeKey": { "type": "string" }, "name": { "type": "string" }, "description": { "type": [ "string", "null" ] } } } }, "submittedAt": { "type": [ "string", "null" ], "format": "date-time" }, "reviewedAt": { "type": [ "string", "null" ], "format": "date-time" }, "reviewNotes": { "type": [ "string", "null" ] }, "publishedAt": { "type": [ "string", "null" ], "format": "date-time" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } }, "InstalledAppSummary": { "type": "object", "required": [ "installId", "appId", "appKey", "name", "description", "iconUrl", "status", "installScope", "scopeSubjectId", "version" ], "properties": { "installId": { "type": "string" }, "appId": { "type": "string" }, "appKey": { "type": "string" }, "name": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "iconUrl": { "type": [ "string", "null" ] }, "status": { "type": "string" }, "installScope": { "type": "string" }, "scopeSubjectId": { "type": "string" }, "version": { "type": [ "string", "null" ] } } }, "StoreAppsResponse": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "object", "required": [ "apps" ], "properties": { "apps": { "type": "array", "items": { "$ref": "#/components/schemas/RegisteredAppDetail" } } } } } }, "StoreAppResponse": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "object", "required": [ "app" ], "properties": { "app": { "$ref": "#/components/schemas/RegisteredAppDetail" } } } } }, "StoreAppVersionsResponse": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "object", "required": [ "versions" ], "properties": { "versions": { "type": "array", "items": { "$ref": "#/components/schemas/RegisteredAppVersionSummary" } } } } } }, "WorkspaceAppsResponse": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "object", "required": [ "installedApps", "catalog", "permissions" ], "properties": { "installedApps": { "type": "array", "items": { "$ref": "#/components/schemas/InstalledAppSummary" } }, "catalog": { "type": "array", "items": { "$ref": "#/components/schemas/AppCatalogItem" } }, "permissions": { "type": "object", "required": [ "canManageApps" ], "properties": { "canManageApps": { "type": "boolean" } } } } } } }, "InstallWorkspaceAppInput": { "type": "object", "required": [ "appId" ], "properties": { "appId": { "type": "string" }, "pinnedVersionId": { "type": "string" }, "grantedPermissions": { "type": "array", "items": { "type": "string" } } } }, "InstallWorkspaceAppResponse": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "object", "required": [ "installId", "appId", "appKey", "version", "grantedPermissions" ], "properties": { "installId": { "type": "string" }, "appId": { "type": "string" }, "appKey": { "type": "string" }, "version": { "type": "string" }, "grantedPermissions": { "type": "array", "items": { "type": "string" } } } } } }, "WorkspaceInstalledAppResponse": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "object", "required": [ "install", "permissions" ], "properties": { "install": { "$ref": "#/components/schemas/InstalledAppSummary" }, "permissions": { "type": "object", "required": [ "canManageApps" ], "properties": { "canManageApps": { "type": "boolean" } } } } } } }, "WorkspaceAppPermissionsResponse": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "object", "required": [ "install", "availablePermissions", "grantedPermissions", "permissions" ], "properties": { "install": { "$ref": "#/components/schemas/InstalledAppSummary" }, "availablePermissions": { "type": "array", "items": { "type": "string" } }, "grantedPermissions": { "type": "array", "items": { "type": "string" } }, "permissions": { "type": "object", "required": [ "canManageApps" ], "properties": { "canManageApps": { "type": "boolean" } } } } } } }, "RegisterAppInput": { "type": "object", "required": [ "version", "manifest", "fileTypes" ], "properties": { "version": { "type": "string" }, "manifest": { "type": "object", "required": [ "key", "name", "permissions", "notificationChannels", "hosting" ], "properties": { "key": { "type": "string" }, "name": { "type": "string" }, "description": { "type": "string" }, "iconUrl": { "type": "string" }, "permissions": { "type": "array", "items": { "type": "string" } }, "notificationChannels": { "type": "array", "items": { "type": "object", "required": [ "key", "name", "defaultDeliveries", "defaultPriority" ], "properties": { "key": { "type": "string" }, "name": { "type": "string" }, "description": { "type": "string" }, "defaultDeliveries": { "type": "array", "items": { "type": "string" } }, "defaultPriority": { "type": "string" } } } }, "kairo": { "type": "object", "additionalProperties": true }, "hosting": { "type": "object", "required": [ "mode", "baseUrl" ], "properties": { "mode": { "type": "string", "const": "external" }, "baseUrl": { "type": "string" } } } } }, "fileTypes": { "type": "array", "items": { "type": "object", "required": [ "typeKey", "name", "storage", "indexable", "homeRenderMode" ], "properties": { "typeKey": { "type": "string" }, "name": { "type": "string" }, "description": { "type": "string" }, "storage": { "type": "string", "const": "coline_document" }, "indexable": { "type": "boolean" }, "homeRenderMode": { "type": "string" } } } } } }, "AppVersionMutationResponse": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "object", "required": [ "appId", "appKey", "versionId", "version" ], "properties": { "appId": { "type": "string" }, "appKey": { "type": "string" }, "versionId": { "type": "string" }, "version": { "type": "string" } } } } }, "SubmitAppVersionForReviewResponse": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "object", "required": [ "appId", "appKey", "versionId", "version", "reviewStatus", "storeListed" ], "properties": { "appId": { "type": "string" }, "appKey": { "type": "string" }, "versionId": { "type": "string" }, "version": { "type": "string" }, "reviewStatus": { "type": "string", "const": "submitted" }, "storeListed": { "type": "boolean" } } } } }, "WorkspaceAppSecretsResponse": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "object", "required": [ "install", "secrets", "permissions" ], "properties": { "install": { "$ref": "#/components/schemas/InstalledAppSummary" }, "secrets": { "type": "array", "items": { "type": "object", "required": [ "id", "key", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "key": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "permissions": { "type": "object", "required": [ "canManageApps" ], "properties": { "canManageApps": { "type": "boolean" } } } } } } }, "CreateWorkspaceAppSecretResponse": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "object", "required": [ "secret", "value" ], "properties": { "secret": { "type": "object", "required": [ "id", "key", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "key": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } }, "value": { "type": "string" } } } } }, "WorkspaceAppOauthConnectionsResponse": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "object", "required": [ "install", "connections", "permissions" ], "properties": { "install": { "$ref": "#/components/schemas/InstalledAppSummary" }, "connections": { "type": "array", "items": { "type": "object", "required": [ "id", "providerKey", "externalAccountId", "scopes", "tokenExpiresAt", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "providerKey": { "type": "string" }, "externalAccountId": { "type": [ "string", "null" ] }, "scopes": { "type": "array", "items": { "type": "string" } }, "tokenExpiresAt": { "type": [ "string", "null" ], "format": "date-time" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "permissions": { "type": "object", "required": [ "canManageApps" ], "properties": { "canManageApps": { "type": "boolean" } } } } } } }, "CreateWorkspaceAppOauthConnectionResponse": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "object", "required": [ "connection" ], "properties": { "connection": { "type": "object", "required": [ "id", "providerKey", "externalAccountId", "scopes", "tokenExpiresAt", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "providerKey": { "type": "string" }, "externalAccountId": { "type": [ "string", "null" ] }, "scopes": { "type": "array", "items": { "type": "string" } }, "tokenExpiresAt": { "type": [ "string", "null" ], "format": "date-time" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } } } } }, "WorkspaceAppDeliveriesResponse": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "object", "required": [ "install", "deliveries", "permissions" ], "properties": { "install": { "$ref": "#/components/schemas/InstalledAppSummary" }, "deliveries": { "type": "array", "items": { "type": "object", "required": [ "id", "eventType", "targetUrl", "status", "attemptCount", "lastStatusCode", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "eventType": { "type": "string" }, "targetUrl": { "type": "string" }, "status": { "type": "string" }, "attemptCount": { "type": "integer" }, "lastStatusCode": { "type": [ "integer", "null" ] }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } }, "permissions": { "type": "object", "required": [ "canManageApps" ], "properties": { "canManageApps": { "type": "boolean" } } } } } } }, "SendWorkspaceAppTestDeliveryResponse": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "object", "required": [ "delivery" ], "properties": { "delivery": { "type": "object", "required": [ "id", "eventType", "targetUrl", "status", "attemptCount", "lastStatusCode", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "eventType": { "type": "string" }, "targetUrl": { "type": "string" }, "status": { "type": "string" }, "attemptCount": { "type": "integer" }, "lastStatusCode": { "type": [ "integer", "null" ] }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } } } } }, "AppFilesListResponse": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "object", "required": [ "files", "availableFileTypes" ], "properties": { "files": { "type": "array", "items": { "type": "object", "required": [ "id", "driveId", "parentId", "name", "fileType", "typeLabel", "appKey", "appName", "openHref", "updatedAt", "createdAt", "version", "capabilities" ], "properties": { "id": { "type": "string" }, "driveId": { "type": "string" }, "parentId": { "type": [ "string", "null" ] }, "name": { "type": "string" }, "fileType": { "type": "string" }, "typeLabel": { "type": "string" }, "appKey": { "type": "string" }, "appName": { "type": "string" }, "openHref": { "type": "string" }, "updatedAt": { "type": "string", "format": "date-time" }, "createdAt": { "type": "string", "format": "date-time" }, "version": { "type": "integer" }, "capabilities": { "type": "object", "required": [ "canRead", "canWrite", "canManage" ], "properties": { "canRead": { "type": "boolean" }, "canWrite": { "type": "boolean" }, "canManage": { "type": "boolean" } } } } } }, "availableFileTypes": { "type": "array", "items": { "type": "object", "required": [ "typeKey", "name", "description" ], "properties": { "typeKey": { "type": "string" }, "name": { "type": "string" }, "description": { "type": [ "string", "null" ] } } } } } } } }, "CreateAppFileInput": { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string" }, "typeKey": { "type": "string" }, "driveId": { "type": "string" }, "parentId": { "type": [ "string", "null" ] }, "document": { "type": "object", "additionalProperties": true } } }, "CreateAppFileResponse": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "object", "required": [ "file", "document", "version" ], "properties": { "file": { "type": "object", "required": [ "id", "driveId", "parentId", "name", "fileType", "typeLabel", "appKey", "appName", "openHref", "updatedAt", "createdAt", "version", "capabilities" ], "properties": { "id": { "type": "string" }, "driveId": { "type": "string" }, "parentId": { "type": [ "string", "null" ] }, "name": { "type": "string" }, "fileType": { "type": "string" }, "typeLabel": { "type": "string" }, "appKey": { "type": "string" }, "appName": { "type": "string" }, "openHref": { "type": "string" }, "updatedAt": { "type": "string", "format": "date-time" }, "createdAt": { "type": "string", "format": "date-time" }, "version": { "type": "integer" }, "capabilities": { "type": "object", "required": [ "canRead", "canWrite", "canManage" ], "properties": { "canRead": { "type": "boolean" }, "canWrite": { "type": "boolean" }, "canManage": { "type": "boolean" } } } } }, "document": { "type": "object", "additionalProperties": true }, "version": { "type": "integer" } } } } }, "ExecuteAppActionInput": { "type": "object", "required": [ "action" ], "properties": { "action": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string" }, "payload": { "type": "object", "additionalProperties": true } } }, "fileId": { "type": [ "string", "null" ] } } }, "ExecuteAppActionResponse": { "type": "object", "required": [ "data" ], "properties": { "data": { "oneOf": [ { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "ok", "refresh" ] } } }, { "type": "object", "required": [ "type", "href" ], "properties": { "type": { "type": "string", "enum": [ "navigate" ] }, "href": { "type": "string" } } }, { "type": "object", "required": [ "type", "fileId" ], "properties": { "type": { "type": "string", "enum": [ "open_file" ] }, "fileId": { "type": "string" } } } ] } } }, "AppFileDocumentResponse": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "object", "required": [ "file", "document", "version", "capabilities" ], "properties": { "file": { "type": "object", "required": [ "id", "name", "fileType", "appKey", "appName", "typeLabel", "openHref", "updatedAt" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "fileType": { "type": "string" }, "appKey": { "type": "string" }, "appName": { "type": "string" }, "typeLabel": { "type": "string" }, "openHref": { "type": "string" }, "updatedAt": { "type": "string", "format": "date-time" } } }, "document": { "type": "object", "additionalProperties": true }, "version": { "type": "integer" }, "capabilities": { "type": "object", "required": [ "canRead", "canWrite", "canManage" ], "properties": { "canRead": { "type": "boolean" }, "canWrite": { "type": "boolean" }, "canManage": { "type": "boolean" } } } } } } }, "AppFileDocumentUpdateResponse": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "object", "required": [ "document", "version", "updatedAt" ], "properties": { "document": { "type": "object", "additionalProperties": true }, "version": { "type": "integer" }, "updatedAt": { "type": "string", "format": "date-time" } } } } }, "CreateAppNotificationInput": { "type": "object", "required": [ "channelKey", "typeKey", "recipients", "title" ], "properties": { "channelKey": { "type": "string" }, "typeKey": { "type": "string" }, "recipients": { "type": "array", "items": { "type": "object", "required": [ "userId" ], "properties": { "userId": { "type": "string" } } } }, "title": { "type": "string" }, "body": { "type": "string" }, "targetUrl": { "type": "string" }, "icon": { "type": "string" }, "priority": { "type": "string" }, "dedupeKey": { "type": "string" }, "metadata": { "type": "object", "additionalProperties": true } } }, "UpsertAppIndexDocumentsInput": { "type": "object", "required": [ "documents" ], "properties": { "documents": { "type": "array", "items": { "type": "object", "required": [ "documentKey", "documentType", "title" ], "properties": { "documentKey": { "type": "string" }, "documentType": { "type": "string" }, "fileId": { "type": "string" }, "title": { "type": "string" }, "body": { "type": "string" }, "url": { "type": "string" }, "metadata": { "type": "object", "additionalProperties": true }, "visibilityMode": { "type": "string" }, "visibility": { "type": "array", "items": { "type": "object", "required": [ "subjectType", "subjectId" ], "properties": { "subjectType": { "type": "string" }, "subjectId": { "type": "string" } } } } } } } } }, "UpsertAppIndexDocumentsResponse": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "object", "required": [ "documents" ], "properties": { "documents": { "type": "array", "items": { "type": "object", "required": [ "id", "documentKey", "visibilityMode" ], "properties": { "id": { "type": "string" }, "documentKey": { "type": "string" }, "visibilityMode": { "type": "string" } } } } } } } }, "DeleteAppIndexDocumentsInput": { "type": "object", "required": [ "documentKeys" ], "properties": { "documentKeys": { "type": "array", "items": { "type": "string" } } } }, "DeleteAppIndexDocumentsResponse": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "object", "required": [ "deleted" ], "properties": { "deleted": { "type": "array", "items": { "type": "object", "required": [ "id", "documentKey" ], "properties": { "id": { "type": "string" }, "documentKey": { "type": "string" } } } } } } } }, "EmitAppAmbientEventsInput": { "type": "object", "required": [ "events" ], "properties": { "events": { "type": "array", "items": { "type": "object", "required": [ "sourceKind", "action", "entityType", "entityId", "dedupeKey" ], "properties": { "sourceKind": { "type": "string" }, "action": { "type": "string" }, "entityType": { "type": "string" }, "entityId": { "type": "string" }, "actorUserId": { "type": "string" }, "containerType": { "type": "string" }, "containerId": { "type": "string" }, "occurredAt": { "type": "string", "format": "date-time" }, "dedupeKey": { "type": "string" }, "payload": { "type": "object", "additionalProperties": true }, "metadata": { "type": "object", "additionalProperties": true }, "schemaVersion": { "type": "integer" } } } } } }, "EmitAppAmbientEventsResponse": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "object", "required": [ "events" ], "properties": { "events": { "type": "array", "items": { "type": "object", "required": [ "id", "dedupeKey" ], "properties": { "id": { "type": "string" }, "dedupeKey": { "type": "string" } } } } } } } }, "WorkspaceMember": { "type": "object", "required": ["id", "workspaceMemberId", "email", "joinedAt", "roles"], "properties": { "id": { "type": "string", "description": "User ID" }, "workspaceMemberId": { "type": "string" }, "email": { "type": "string", "format": "email" }, "firstName": { "type": "string", "nullable": true }, "lastName": { "type": "string", "nullable": true }, "avatarUrl": { "type": "string", "nullable": true }, "joinedAt": { "type": "string", "format": "date-time" }, "roles": { "type": "array", "items": { "type": "string" } } } }, "ListWorkspaceMembersResponse": { "type": "object", "required": ["data"], "properties": { "data": { "type": "object", "required": ["members"], "properties": { "members": { "type": "array", "items": { "$ref": "#/components/schemas/WorkspaceMember" } } } } } }, "NoteSummary": { "type": "object", "required": ["id", "driveId", "title", "body", "createdAt", "updatedAt"], "properties": { "id": { "type": "string" }, "driveId": { "type": "string" }, "parentId": { "type": "string", "nullable": true }, "title": { "type": "string" }, "body": { "type": "string", "description": "Plaintext body content" }, "color": { "type": "string", "nullable": true }, "createdByUserId": { "type": "string", "nullable": true }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } }, "PaginationInfo": { "type": "object", "required": ["limit", "hasMore"], "properties": { "limit": { "type": "integer" }, "hasMore": { "type": "boolean" }, "nextCursor": { "type": "string", "nullable": true } } }, "ListWorkspaceNotesResponse": { "type": "object", "required": ["data"], "properties": { "data": { "type": "object", "required": ["notes", "page"], "properties": { "notes": { "type": "array", "items": { "$ref": "#/components/schemas/NoteSummary" } }, "page": { "$ref": "#/components/schemas/PaginationInfo" } } } } }, "CreateNoteInput": { "type": "object", "properties": { "title": { "type": "string", "maxLength": 120 }, "body": { "type": "string", "maxLength": 250000, "default": "" }, "blocks": { "type": "array", "items": { "type": "object" }, "description": "BlockNote block array" }, "driveId": { "type": "string", "description": "Target drive ID (defaults to workspace default drive)" }, "parentId": { "type": "string", "nullable": true, "description": "Parent folder ID" } } }, "NoteResponse": { "type": "object", "required": ["data"], "properties": { "data": { "type": "object", "required": ["note"], "properties": { "note": { "$ref": "#/components/schemas/NoteSummary" } } } } }, "NoteDetail": { "type": "object", "required": ["id", "driveId", "title", "body", "blocks", "createdAt", "updatedAt"], "properties": { "id": { "type": "string" }, "driveId": { "type": "string" }, "parentId": { "type": "string", "nullable": true }, "title": { "type": "string" }, "body": { "type": "string" }, "blocks": { "type": "array", "items": { "type": "object" } }, "color": { "type": "string", "nullable": true }, "createdByUserId": { "type": "string", "nullable": true }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } }, "NoteDetailResponse": { "type": "object", "required": ["data"], "properties": { "data": { "type": "object", "required": ["note"], "properties": { "note": { "$ref": "#/components/schemas/NoteDetail" } } } } }, "UpdateNoteInput": { "type": "object", "properties": { "title": { "type": "string", "maxLength": 120 }, "body": { "type": "string", "maxLength": 250000 }, "blocks": { "type": "array", "items": { "type": "object" }, "description": "BlockNote block array" } } }, "DocLayout": { "type": "object", "required": ["mode", "pageSize", "orientation", "margins", "showPageNumbers"], "properties": { "mode": { "type": "string", "const": "pages" }, "pageSize": { "type": "string", "const": "letter" }, "orientation": { "type": "string", "enum": ["portrait", "landscape"] }, "margins": { "type": "string", "enum": ["normal", "narrow", "wide"] }, "backgroundColor": { "type": "string", "nullable": true }, "showPageNumbers": { "type": "boolean" } } }, "DocSummary": { "type": "object", "required": ["id", "driveId", "title", "excerpt", "layout", "createdAt", "updatedAt"], "properties": { "id": { "type": "string" }, "driveId": { "type": "string" }, "parentId": { "type": "string", "nullable": true }, "title": { "type": "string" }, "excerpt": { "type": "string", "description": "First ~160 chars of doc plaintext" }, "color": { "type": "string", "nullable": true }, "layout": { "$ref": "#/components/schemas/DocLayout" }, "createdByUserId": { "type": "string", "nullable": true }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } }, "DocDetail": { "type": "object", "required": ["id", "driveId", "title", "content", "plainText", "layout", "createdAt", "updatedAt"], "properties": { "id": { "type": "string" }, "driveId": { "type": "string" }, "parentId": { "type": "string", "nullable": true }, "title": { "type": "string" }, "content": { "type": "object", "description": "PagedDocContent structure with type='doc' and pages array" }, "plainText": { "type": "string" }, "color": { "type": "string", "nullable": true }, "layout": { "$ref": "#/components/schemas/DocLayout" }, "createdByUserId": { "type": "string", "nullable": true }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } }, "ListWorkspaceDocsResponse": { "type": "object", "required": ["data"], "properties": { "data": { "type": "object", "required": ["docs", "page"], "properties": { "docs": { "type": "array", "items": { "$ref": "#/components/schemas/DocSummary" } }, "page": { "$ref": "#/components/schemas/PaginationInfo" } } } } }, "DocResponse": { "type": "object", "required": ["data"], "properties": { "data": { "type": "object", "required": ["doc"], "properties": { "doc": { "$ref": "#/components/schemas/DocSummary" } } } } }, "DocDetailResponse": { "type": "object", "required": ["data"], "properties": { "data": { "type": "object", "required": ["doc"], "properties": { "doc": { "$ref": "#/components/schemas/DocDetail" } } } } }, "CreateDocInput": { "type": "object", "properties": { "title": { "type": "string", "maxLength": 120 }, "content": { "type": "object", "description": "PagedDocContent structure" }, "layout": { "type": "object", "properties": { "orientation": { "type": "string", "enum": ["portrait", "landscape"] }, "margins": { "type": "string", "enum": ["normal", "narrow", "wide"] }, "backgroundColor": { "type": "string", "nullable": true }, "showPageNumbers": { "type": "boolean" } } }, "driveId": { "type": "string" }, "parentId": { "type": "string", "nullable": true } } }, "UpdateDocInput": { "type": "object", "properties": { "title": { "type": "string", "maxLength": 120 }, "content": { "type": "object", "description": "PagedDocContent structure" }, "layout": { "type": "object", "properties": { "orientation": { "type": "string", "enum": ["portrait", "landscape"] }, "margins": { "type": "string", "enum": ["normal", "narrow", "wide"] }, "backgroundColor": { "type": "string", "nullable": true }, "showPageNumbers": { "type": "boolean" } } } } }, "DriveMountSummary": { "type": "object", "required": ["type", "syncStatus"], "properties": { "type": { "type": "string", "enum": ["native", "integration"] }, "providerKey": { "type": "string", "nullable": true }, "syncStatus": { "type": "string", "enum": ["idle", "syncing", "errored", "disabled"] } } }, "DriveSummary": { "type": "object", "required": ["id", "name", "slug", "kind", "accessMode", "isDefault", "mount", "createdAt", "updatedAt"], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "type": "string" }, "kind": { "type": "string", "enum": ["personal", "shared"] }, "accessMode": { "type": "string", "enum": ["workspace_default", "restricted"] }, "isDefault": { "type": "boolean" }, "ownerUserId": { "type": "string", "nullable": true }, "mount": { "$ref": "#/components/schemas/DriveMountSummary" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } }, "ListWorkspaceDrivesResponse": { "type": "object", "required": ["data"], "properties": { "data": { "type": "object", "required": ["drives"], "properties": { "drives": { "type": "array", "items": { "$ref": "#/components/schemas/DriveSummary" } } } } } }, "DriveFileSummary": { "type": "object", "required": ["id", "driveId", "name", "fileType", "createdAt", "updatedAt"], "properties": { "id": { "type": "string" }, "driveId": { "type": "string" }, "parentId": { "type": "string", "nullable": true }, "name": { "type": "string" }, "fileType": { "type": "string" }, "mimeType": { "type": "string", "nullable": true }, "sizeBytes": { "type": "integer", "nullable": true }, "color": { "type": "string", "nullable": true }, "createdByUserId": { "type": "string", "nullable": true }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } }, "ListDriveFilesResponse": { "type": "object", "required": ["data"], "properties": { "data": { "type": "object", "required": ["files", "page"], "properties": { "files": { "type": "array", "items": { "$ref": "#/components/schemas/DriveFileSummary" } }, "page": { "$ref": "#/components/schemas/PaginationInfo" } } } } }, "FileDetail": { "type": "object", "required": ["id", "driveId", "name", "fileType", "accessMode", "isTrashed", "createdAt", "updatedAt"], "properties": { "id": { "type": "string" }, "driveId": { "type": "string" }, "parentId": { "type": "string", "nullable": true }, "name": { "type": "string" }, "fileType": { "type": "string" }, "mimeType": { "type": "string", "nullable": true }, "sizeBytes": { "type": "integer", "nullable": true }, "color": { "type": "string", "nullable": true }, "accessMode": { "type": "string" }, "isTrashed": { "type": "boolean" }, "createdByUserId": { "type": "string", "nullable": true }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } }, "FileDetailResponse": { "type": "object", "required": ["data"], "properties": { "data": { "type": "object", "required": ["file"], "properties": { "file": { "$ref": "#/components/schemas/FileDetail" } } } } }, "UpdateFileInput": { "type": "object", "properties": { "name": { "type": "string", "maxLength": 120 }, "parentId": { "type": "string", "nullable": true }, "color": { "type": "string", "enum": ["red", "orange", "yellow", "green", "blue", "purple", "pink", "gray"], "nullable": true } } }, "CalendarEventLinkInput": { "type": "object", "required": ["linkType"], "properties": { "linkType": { "type": "string", "enum": ["file", "channel", "url"] }, "fileId": { "type": "string" }, "channelId": { "type": "string" }, "url": { "type": "string", "format": "uri" }, "label": { "type": "string", "maxLength": 200, "nullable": true } }, "description": "Discriminated by linkType: file requires fileId, channel requires channelId, url requires url" }, "CalendarRecurrenceRule": { "type": "object", "required": ["frequency", "interval"], "properties": { "frequency": { "type": "string", "enum": ["daily", "weekly", "monthly", "yearly"] }, "interval": { "type": "integer", "minimum": 1, "maximum": 99 }, "byDay": { "type": "array", "items": { "type": "string", "enum": ["MO", "TU", "WE", "TH", "FR", "SA", "SU"] }, "maxItems": 7 }, "count": { "type": "integer", "minimum": 1, "maximum": 999 }, "until": { "type": "string", "format": "date-time" } } }, "CreateCalendarEventInput": { "type": "object", "required": ["title", "startsAt", "endsAt", "timeZone"], "properties": { "title": { "type": "string", "minLength": 1, "maxLength": 200 }, "description": { "type": "string", "maxLength": 4000, "nullable": true }, "location": { "type": "string", "maxLength": 300, "nullable": true }, "startsAt": { "type": "string", "format": "date-time" }, "endsAt": { "type": "string", "format": "date-time" }, "timeZone": { "type": "string", "minLength": 1, "maxLength": 100 }, "isAllDay": { "type": "boolean" }, "visibility": { "type": "string", "enum": ["private", "invitees", "workspace"] }, "attendeeUserIds": { "type": "array", "items": { "type": "string" }, "maxItems": 50 }, "linkInputs": { "type": "array", "items": { "$ref": "#/components/schemas/CalendarEventLinkInput" }, "maxItems": 20 }, "recurrenceRule": { "oneOf": [ { "$ref": "#/components/schemas/CalendarRecurrenceRule" }, { "type": "null" } ] } } }, "UpdateCalendarEventInput": { "type": "object", "properties": { "title": { "type": "string", "minLength": 1, "maxLength": 200 }, "description": { "type": "string", "maxLength": 4000, "nullable": true }, "location": { "type": "string", "maxLength": 300, "nullable": true }, "startsAt": { "type": "string", "format": "date-time" }, "endsAt": { "type": "string", "format": "date-time" }, "timeZone": { "type": "string", "minLength": 1, "maxLength": 100 }, "isAllDay": { "type": "boolean" }, "visibility": { "type": "string", "enum": ["private", "invitees", "workspace"] }, "status": { "type": "string", "enum": ["active", "canceled"] }, "attendeeUserIds": { "type": "array", "items": { "type": "string" }, "maxItems": 50 }, "linkInputs": { "type": "array", "items": { "$ref": "#/components/schemas/CalendarEventLinkInput" }, "maxItems": 20 }, "recurrenceRule": { "oneOf": [ { "$ref": "#/components/schemas/CalendarRecurrenceRule" }, { "type": "null" } ] } } }, "ListCalendarEventsResponse": { "type": "object", "required": ["data"], "properties": { "data": { "type": "object", "description": "Calendar events data as returned by the calendar server library" } } }, "CalendarEventDetailResponse": { "type": "object", "required": ["data"], "properties": { "data": { "type": "object", "description": "Calendar event detail as returned by the calendar server library" } } }, "WorkspaceSearchInput": { "type": "object", "required": ["query"], "properties": { "query": { "type": "string", "minLength": 1, "maxLength": 400 }, "sourceKinds": { "type": "array", "items": { "type": "string", "enum": ["file", "task", "container_message", "kairo_message", "app_document"] }, "maxItems": 10 }, "limit": { "type": "integer", "minimum": 1, "maximum": 50, "default": 20 }, "cursor": { "type": "string" } } }, "WorkspaceSearchResponse": { "type": "object", "required": ["data"], "properties": { "data": { "type": "object", "description": "Search results as returned by the workspace search engine" } } }, "TaskboardStatus": { "type": "object", "required": ["id", "key", "name", "color", "isDefault", "isCompleted", "sortOrder"], "properties": { "id": { "type": "string" }, "key": { "type": "string" }, "name": { "type": "string" }, "color": { "type": "string" }, "isDefault": { "type": "boolean" }, "isCompleted": { "type": "boolean" }, "sortOrder": { "type": "integer" } } }, "TaskboardSummary": { "type": "object", "required": ["id", "name", "driveId", "statuses", "createdAt", "updatedAt"], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "driveId": { "type": "string" }, "color": { "type": "string", "nullable": true }, "identifierPrefix": { "type": "string", "nullable": true }, "description": { "type": "string", "nullable": true }, "defaultView": { "type": "string", "nullable": true }, "statuses": { "type": "array", "items": { "$ref": "#/components/schemas/TaskboardStatus" } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } }, "ListWorkspaceTaskboardsResponse": { "type": "object", "required": ["data"], "properties": { "data": { "type": "object", "required": ["taskboards"], "properties": { "taskboards": { "type": "array", "items": { "$ref": "#/components/schemas/TaskboardSummary" } } } } } }, "TaskAssignee": { "type": "object", "required": ["id", "email"], "properties": { "id": { "type": "string" }, "firstName": { "type": "string", "nullable": true }, "lastName": { "type": "string", "nullable": true }, "avatarUrl": { "type": "string", "nullable": true }, "email": { "type": "string", "format": "email" } } }, "TaskStatusInfo": { "type": "object", "required": ["id", "key", "name", "color", "isCompleted"], "properties": { "id": { "type": "string" }, "key": { "type": "string" }, "name": { "type": "string" }, "color": { "type": "string" }, "isCompleted": { "type": "boolean" } } }, "TaskSummary": { "type": "object", "required": ["id", "taskboardId", "taskNumber", "title", "priority", "labels", "assignees", "isCompleted", "createdAt", "updatedAt"], "properties": { "id": { "type": "string" }, "taskboardId": { "type": "string" }, "taskNumber": { "type": "integer" }, "identifier": { "type": "string", "nullable": true, "description": "Human-readable identifier like PREFIX-123" }, "title": { "type": "string" }, "description": { "type": "string", "nullable": true }, "status": { "oneOf": [ { "$ref": "#/components/schemas/TaskStatusInfo" }, { "type": "null" } ] }, "priority": { "type": "string", "enum": ["none", "low", "medium", "high", "urgent"] }, "labels": { "type": "array", "items": { "type": "string" } }, "dueDate": { "type": "string", "format": "date-time", "nullable": true }, "assignees": { "type": "array", "items": { "$ref": "#/components/schemas/TaskAssignee" } }, "isCompleted": { "type": "boolean" }, "completedAt": { "type": "string", "format": "date-time", "nullable": true }, "createdByUserId": { "type": "string", "nullable": true }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } }, "ListTaskboardTasksResponse": { "type": "object", "required": ["data"], "properties": { "data": { "type": "object", "required": ["tasks"], "properties": { "tasks": { "type": "array", "items": { "$ref": "#/components/schemas/TaskSummary" } } } } } }, "CreateTaskInput": { "type": "object", "required": ["title"], "properties": { "title": { "type": "string", "minLength": 1, "maxLength": 500 }, "description": { "type": "string", "maxLength": 50000 }, "statusId": { "type": "string", "description": "Status ID (defaults to the board's default status)" }, "priority": { "type": "string", "enum": ["none", "low", "medium", "high", "urgent"] }, "dueDate": { "type": "string", "format": "date-time", "nullable": true }, "labels": { "type": "array", "items": { "type": "string", "maxLength": 100 }, "maxItems": 20 }, "assigneeUserIds": { "type": "array", "items": { "type": "string" }, "maxItems": 20 } } }, "CreateTaskResponse": { "type": "object", "required": ["data"], "properties": { "data": { "type": "object", "required": ["task"], "properties": { "task": { "type": "object", "required": ["id", "taskboardId", "title", "statusId", "priority", "labels", "createdAt", "updatedAt"], "properties": { "id": { "type": "string" }, "taskboardId": { "type": "string" }, "title": { "type": "string" }, "description": { "type": "string" }, "statusId": { "type": "string" }, "priority": { "type": "string", "enum": ["none", "low", "medium", "high", "urgent"] }, "labels": { "type": "array", "items": { "type": "string" } }, "dueDate": { "type": "string", "format": "date-time", "nullable": true }, "assigneeUserIds": { "type": "array", "items": { "type": "string" } }, "createdByUserId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } } } } } }, "UpdateTaskInput": { "type": "object", "properties": { "title": { "type": "string", "minLength": 1, "maxLength": 500 }, "description": { "type": "string", "maxLength": 50000 }, "statusId": { "type": "string" }, "priority": { "type": "string", "enum": ["none", "low", "medium", "high", "urgent"] }, "dueDate": { "type": "string", "format": "date-time", "nullable": true }, "labels": { "type": "array", "items": { "type": "string", "maxLength": 100 }, "maxItems": 20 }, "assigneeUserIds": { "type": "array", "items": { "type": "string" }, "maxItems": 20 } } }, "ChannelSummary": { "type": "object", "required": ["id", "name", "slug", "type", "isDefault", "createdAt", "updatedAt"], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "type": "string" }, "description": { "type": "string", "nullable": true }, "topic": { "type": "string", "nullable": true }, "type": { "type": "string", "enum": ["public", "private"] }, "isDefault": { "type": "boolean" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } }, "ChannelListResponse": { "type": "object", "required": ["channels"], "properties": { "channels": { "type": "array", "items": { "$ref": "#/components/schemas/ChannelSummary" } } } }, "DmMemberSummary": { "type": "object", "required": ["userId", "email"], "properties": { "userId": { "type": "string" }, "firstName": { "type": "string", "nullable": true }, "lastName": { "type": "string", "nullable": true }, "email": { "type": "string", "format": "email" } } }, "DmSummary": { "type": "object", "required": ["id", "isGroup", "members", "createdAt", "updatedAt"], "properties": { "id": { "type": "string" }, "isGroup": { "type": "boolean" }, "name": { "type": "string", "nullable": true }, "members": { "type": "array", "items": { "$ref": "#/components/schemas/DmMemberSummary" } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } }, "DmListResponse": { "type": "object", "required": ["dms"], "properties": { "dms": { "type": "array", "items": { "$ref": "#/components/schemas/DmSummary" } } } }, "MessageTextPart": { "type": "object", "required": ["type", "text"], "properties": { "type": { "type": "string", "enum": ["text"] }, "text": { "type": "string" } } }, "MessageMentionPart": { "type": "object", "required": ["type", "userId", "displayName"], "properties": { "type": { "type": "string", "enum": ["mention"] }, "userId": { "type": "string" }, "displayName": { "type": "string" } } }, "MessageContentPart": { "oneOf": [ { "$ref": "#/components/schemas/MessageTextPart" }, { "$ref": "#/components/schemas/MessageMentionPart" } ], "discriminator": { "propertyName": "type" } }, "ContainerMessageSummary": { "type": "object", "required": ["id", "messageKind", "plaintext", "content", "createdAt", "updatedAt"], "properties": { "id": { "type": "string" }, "authorUserId": { "type": "string", "nullable": true }, "messageKind": { "type": "string" }, "plaintext": { "type": "string" }, "content": { "type": "array", "items": { "$ref": "#/components/schemas/MessageContentPart" } }, "replyToMessageId": { "type": "string", "nullable": true }, "editedAt": { "type": "string", "format": "date-time", "nullable": true }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } } }, "MessagesPage": { "type": "object", "required": ["limit", "hasMore", "nextCursor"], "properties": { "limit": { "type": "integer" }, "hasMore": { "type": "boolean" }, "nextCursor": { "type": "string", "nullable": true } } }, "MessagesListResponse": { "type": "object", "required": ["messages", "page"], "properties": { "messages": { "type": "array", "items": { "$ref": "#/components/schemas/ContainerMessageSummary" } }, "page": { "$ref": "#/components/schemas/MessagesPage" } } }, "SendMessageInput": { "type": "object", "required": ["content"], "properties": { "content": { "type": "array", "items": { "$ref": "#/components/schemas/MessageContentPart" }, "minItems": 1, "maxItems": 500 }, "replyToMessageId": { "type": "string", "nullable": true }, "threadRootMessageId": { "type": "string", "nullable": true } } }, "SendMessageResponse": { "type": "object", "required": ["message"], "properties": { "message": { "$ref": "#/components/schemas/ContainerMessageSummary" } } }, "MessageDetailResponse": { "type": "object", "required": ["message"], "properties": { "message": { "allOf": [ { "$ref": "#/components/schemas/ContainerMessageSummary" }, { "type": "object", "properties": { "containerType": { "type": "string" }, "containerId": { "type": "string" } } } ] } } }, "EditMessageInput": { "type": "object", "required": ["content"], "properties": { "content": { "type": "array", "items": { "$ref": "#/components/schemas/MessageContentPart" }, "minItems": 1, "maxItems": 500 } } }, "ThreadResponse": { "type": "object", "required": ["rootMessage", "replies"], "properties": { "rootMessage": { "allOf": [ { "$ref": "#/components/schemas/ContainerMessageSummary" }, { "type": "object", "properties": { "containerType": { "type": "string" }, "containerId": { "type": "string" } } } ] }, "replies": { "type": "array", "items": { "$ref": "#/components/schemas/ContainerMessageSummary" } } } }, "ThreadReplyInput": { "type": "object", "required": ["content"], "properties": { "content": { "type": "array", "items": { "$ref": "#/components/schemas/MessageContentPart" }, "minItems": 1, "maxItems": 500 } } }, "ReactionResponse": { "type": "object", "required": ["messageId", "emoji", "count"], "properties": { "messageId": { "type": "string" }, "emoji": { "type": "string" }, "count": { "type": "integer" } } }, "PinResponse": { "type": "object", "required": ["messageId", "pinned"], "properties": { "messageId": { "type": "string" }, "pinned": { "type": "boolean" } } } } } }