{ "openapi": "3.0.3", "info": { "title": "assistant", "version": "0.0.1", "description": "Process and transform text", "license": { "name": "agpl" } }, "components": { "securitySchemes": { "basic_auth": { "type": "http", "scheme": "basic" }, "bearer_auth": { "type": "http", "scheme": "bearer" } }, "schemas": { "Assignment": { "type": "object", "required": [ "id", "user_id", "prompt", "recurrence", "created_at", "updated_at", "starts_at", "last_run_at", "timezone" ], "properties": { "id": { "type": "integer", "format": "int64" }, "user_id": { "type": "string" }, "prompt": { "type": "string" }, "recurrence": { "type": "string" }, "created_at": { "type": "integer", "format": "int64" }, "updated_at": { "type": "integer", "format": "int64" }, "starts_at": { "type": "integer", "format": "int64" }, "last_run_at": { "type": "integer", "format": "int64" }, "timezone": { "type": "string" } } }, "ChatAgencyMessage": { "allOf": [ { "$ref": "#/components/schemas/ChatMessage" }, { "type": "object", "required": [ "sessionAgencyPendingActions" ], "properties": { "sessionAgencyPendingActions": { "type": "object", "additionalProperties": { "type": "object" } } } } ] }, "ChatMessage": { "type": "object", "required": [ "id", "session_id", "role", "content", "timestamp", "attachments", "ocp_task_id", "sources" ], "properties": { "id": { "type": "integer", "format": "int64" }, "session_id": { "type": "integer", "format": "int64" }, "role": { "type": "string" }, "content": { "type": "string" }, "timestamp": { "type": "integer", "format": "int64" }, "attachments": { "type": "array", "items": { "type": "object", "required": [ "type", "fileId" ], "properties": { "type": { "type": "string" }, "fileId": { "type": "integer", "format": "int64" } } } }, "ocp_task_id": { "type": "integer", "format": "int64" }, "sources": { "type": "string" } } }, "ChatSession": { "type": "object", "required": [ "id", "user_id", "title", "timestamp", "agency_conversation_token", "agency_pending_actions", "summary", "is_remembered", "is_summary_up_to_date", "assignment_id" ], "properties": { "id": { "type": "integer", "format": "int64" }, "user_id": { "type": "string" }, "title": { "type": "string", "nullable": true }, "timestamp": { "type": "integer", "format": "int64", "nullable": true }, "agency_conversation_token": { "type": "string", "nullable": true }, "agency_pending_actions": { "type": "string", "nullable": true }, "summary": { "type": "string", "nullable": true }, "is_remembered": { "type": "boolean" }, "is_summary_up_to_date": { "type": "boolean" }, "assignment_id": { "type": "integer", "format": "int64", "nullable": true } } }, "ChatSessionCheck": { "type": "object", "required": [ "messageTaskId", "titleTaskId", "sessionTitle", "sessionAgencyPendingActions", "is_remembered" ], "properties": { "messageTaskId": { "type": "integer", "format": "int64", "nullable": true }, "titleTaskId": { "type": "integer", "format": "int64", "nullable": true }, "sessionTitle": { "type": "string", "nullable": true }, "sessionAgencyPendingActions": { "type": "object", "nullable": true, "additionalProperties": { "type": "object" } }, "is_remembered": { "type": "boolean", "nullable": true } } }, "OCSMeta": { "type": "object", "required": [ "status", "statuscode" ], "properties": { "status": { "type": "string" }, "statuscode": { "type": "integer" }, "message": { "type": "string" }, "totalitems": { "type": "string" }, "itemsperpage": { "type": "string" } } }, "PublicCapabilities": { "type": "object", "required": [ "assistant" ], "properties": { "assistant": { "type": "object", "required": [ "version" ], "properties": { "version": { "type": "string" }, "enabled": { "type": "boolean" } } }, "client_integration": { "type": "object", "additionalProperties": { "type": "object", "required": [ "version", "context-menu" ], "properties": { "version": { "type": "number", "format": "double" }, "context-menu": { "type": "array", "items": { "type": "object", "required": [ "name", "url", "method", "mimetype_filters", "icon" ], "properties": { "name": { "type": "string" }, "url": { "type": "string" }, "method": { "type": "string" }, "mimetype_filters": { "type": "string" }, "icon": { "type": "string" } } } } } } } } }, "ShapeDescriptor": { "type": "object", "required": [ "name", "description", "type" ], "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "type": { "type": "string" } } }, "TaskProcessingTask": { "type": "object", "required": [ "appId", "completionExpectedAt", "customId", "id", "input", "lastUpdated", "output", "progress", "status", "type", "userId", "endedAt", "scheduledAt", "startedAt" ], "properties": { "appId": { "type": "string" }, "completionExpectedAt": { "type": "integer", "format": "int64", "nullable": true }, "customId": { "type": "string", "nullable": true }, "id": { "type": "integer", "format": "int64" }, "input": { "type": "object", "additionalProperties": { "oneOf": [ { "type": "array", "items": { "oneOf": [ { "type": "number" }, { "type": "string" } ] } }, { "type": "number" }, { "type": "string" } ] } }, "lastUpdated": { "type": "integer", "format": "int64" }, "output": { "type": "object", "nullable": true, "additionalProperties": { "oneOf": [ { "type": "array", "items": { "oneOf": [ { "type": "number" }, { "type": "string" } ] } }, { "type": "number" }, { "type": "string" } ] } }, "progress": { "type": "number", "format": "double", "nullable": true }, "status": { "type": "string" }, "type": { "type": "string" }, "userId": { "type": "string", "nullable": true }, "endedAt": { "type": "integer", "format": "int64", "nullable": true }, "scheduledAt": { "type": "integer", "format": "int64", "nullable": true }, "startedAt": { "type": "integer", "format": "int64", "nullable": true } } }, "TaskProcessingTaskType": { "type": "object", "required": [ "id", "name", "description", "inputShape", "optionalInputShape", "outputShape", "optionalOutputShape", "priority", "category", "preferredProviderName" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "description": { "type": "string" }, "inputShape": { "type": "object", "additionalProperties": { "$ref": "#/components/schemas/ShapeDescriptor" } }, "optionalInputShape": { "type": "object", "additionalProperties": { "$ref": "#/components/schemas/ShapeDescriptor" } }, "outputShape": { "type": "object", "additionalProperties": { "$ref": "#/components/schemas/ShapeDescriptor" } }, "optionalOutputShape": { "type": "object", "additionalProperties": { "$ref": "#/components/schemas/ShapeDescriptor" } }, "priority": { "type": "integer", "format": "int64" }, "category": { "type": "object", "required": [ "id", "name" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" } } }, "preferredProviderName": { "type": "string", "nullable": true } } } } }, "paths": { "/ocs/v2.php/apps/assistant/api/{apiVersion}/task-types": { "get": { "operationId": "assistant_api-get-available-task-types", "summary": "Get available task types", "description": "Get all available task types that the assistant can handle.", "tags": [ "task_management" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "apiVersion", "in": "path", "required": true, "schema": { "type": "string", "enum": [ "v1" ], "default": "v1" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "Available task types returned", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "types" ], "properties": { "types": { "type": "array", "items": { "$ref": "#/components/schemas/TaskProcessingTaskType" } } } } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } }, "/ocs/v2.php/apps/assistant/api/{apiVersion}/tasks": { "get": { "operationId": "assistant_api-get-user-tasks", "summary": "Get user's tasks", "description": "Get a list of assistant tasks for the current user.", "tags": [ "task_management" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "apiVersion", "in": "path", "required": true, "schema": { "type": "string", "enum": [ "v1" ], "default": "v1" } }, { "name": "taskTypeId", "in": "query", "description": "Task type id. If null, tasks of all task types will be retrieved", "schema": { "type": "string", "nullable": true, "default": null } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "User tasks returned", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "tasks" ], "properties": { "tasks": { "type": "array", "items": { "$ref": "#/components/schemas/TaskProcessingTask" } } } } } } } } } } }, "404": { "description": "No tasks found", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "string" } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } }, "/ocs/v2.php/apps/assistant/api/{apiVersion}/parse-file": { "post": { "operationId": "assistant_api-parse-text-from-file", "summary": "Extract text from file", "description": "Parse and extract text content of a file (if the file type is supported)", "tags": [ "assistant_api" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "filePath": { "type": "string", "nullable": true, "default": null, "description": "Path of the file to parse in the user's storage" }, "fileId": { "type": "integer", "format": "int64", "nullable": true, "default": null, "description": "Id of the file to parse in the user's storage" } } } } } }, "parameters": [ { "name": "apiVersion", "in": "path", "required": true, "schema": { "type": "string", "enum": [ "v1" ], "default": "v1" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "Text parsed from file successfully", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "parsedText" ], "properties": { "parsedText": { "type": "string" } } } } } } } } } }, "400": { "description": "Parsing text from file is not possible", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "string" } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } }, "/ocs/v2.php/apps/assistant/api/{apiVersion}/task/{ocpTaskId}/notify": { "get": { "operationId": "assistant_api-get-notify-when-ready", "summary": "Get the notification request for a task when it has finished", "description": "Does not need bruteforce protection since we respond with success anyways as we don't want to keep the front-end waiting. However, we still use rate limiting to prevent timing attacks.", "tags": [ "assistant_api" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "apiVersion", "in": "path", "required": true, "schema": { "type": "string", "enum": [ "v1" ], "default": "v1" } }, { "name": "ocpTaskId", "in": "path", "description": "ID of the target task", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "Task notification request retrieved successfully", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "id", "ocp_task_id", "timestamp" ], "properties": { "id": { "type": "integer", "format": "int64" }, "ocp_task_id": { "type": "integer", "format": "int64" }, "timestamp": { "type": "integer", "format": "int64" } } } } } } } } } }, "500": { "description": "", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } } } }, "text/plain": { "schema": { "type": "string" } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } }, "post": { "operationId": "assistant_api-notify-when-ready", "summary": "Notify when the task has finished", "description": "Does not need bruteforce protection since we respond with success anyways as we don't want to keep the front-end waiting. However, we still use rate limiting to prevent timing attacks.", "tags": [ "assistant_api" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "apiVersion", "in": "path", "required": true, "schema": { "type": "string", "enum": [ "v1" ], "default": "v1" } }, { "name": "ocpTaskId", "in": "path", "description": "ID of the target task", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "Ready notification enabled successfully", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "string" } } } } } } } }, "500": { "description": "", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } } } }, "text/plain": { "schema": { "type": "string" } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } }, "delete": { "operationId": "assistant_api-cancel-notify-when-ready", "summary": "Cancel an existing notification when a task has finished", "description": "Does not need bruteforce protection since we respond with success anyways as we don't want to keep the front-end waiting. However, we still use rate limiting to prevent timing attacks.", "tags": [ "assistant_api" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "apiVersion", "in": "path", "required": true, "schema": { "type": "string", "enum": [ "v1" ], "default": "v1" } }, { "name": "ocpTaskId", "in": "path", "description": "ID of the target task", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "Ready notification deleted successfully", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "string" } } } } } } } }, "500": { "description": "", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } } } }, "text/plain": { "schema": { "type": "string" } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } }, "/ocs/v2.php/apps/assistant/api/{apiVersion}/input-file": { "post": { "operationId": "assistant_api-upload-input-file", "summary": "Upload input file", "description": "Upload an input file for a task that is being prepared", "tags": [ "assistant_api" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "filename": { "type": "string", "nullable": true, "default": null, "description": "The input file name" } } } } } }, "parameters": [ { "name": "apiVersion", "in": "path", "required": true, "schema": { "type": "string", "enum": [ "v1" ], "default": "v1" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "The input file was uploaded", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "fileId", "filePath" ], "properties": { "fileId": { "type": "integer", "format": "int64" }, "filePath": { "type": "string" } } } } } } } } } }, "400": { "description": "Impossible to upload an input file", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "string" } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } }, "/ocs/v2.php/apps/assistant/api/{apiVersion}/file/{fileId}/display": { "get": { "operationId": "assistant_api-display-user-file", "summary": "Get a file of the current user", "tags": [ "assistant_api" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "apiVersion", "in": "path", "required": true, "schema": { "type": "string", "enum": [ "v1" ], "default": "v1" } }, { "name": "fileId", "in": "path", "description": "The ID of the file that is requested", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "The file is returned", "content": { "*/*": { "schema": { "type": "string", "format": "binary" } } } }, "404": { "description": "The file was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } } } } } }, "500": { "description": "", "content": { "text/plain": { "schema": { "type": "string" } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } }, "/ocs/v2.php/apps/assistant/api/{apiVersion}/file/{fileId}/info": { "get": { "operationId": "assistant_api-get-user-file-info", "summary": "Get user file info", "description": "Get information about a file of the current user", "tags": [ "assistant_api" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "apiVersion", "in": "path", "required": true, "schema": { "type": "string", "enum": [ "v1" ], "default": "v1" } }, { "name": "fileId", "in": "path", "description": "The file ID for which the info is requested", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "The file info is returned", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "name", "path", "owner", "size" ], "properties": { "name": { "type": "string" }, "path": { "type": "string" }, "owner": { "type": "string" }, "size": { "type": "integer", "format": "int64" } } } } } } } } } }, "404": { "description": "The file was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } }, "/ocs/v2.php/apps/assistant/api/{apiVersion}/task/{ocpTaskId}/file/{fileId}/share": { "post": { "operationId": "assistant_api-share-output-file", "summary": "Share an output file", "description": "Save and share a file that was produced by a task", "tags": [ "assistant_api" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "apiVersion", "in": "path", "required": true, "schema": { "type": "string", "enum": [ "v1" ], "default": "v1" } }, { "name": "ocpTaskId", "in": "path", "description": "The task ID", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "fileId", "in": "path", "description": "The file ID", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "The file was saved and shared", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "shareToken" ], "properties": { "shareToken": { "type": "string" } } } } } } } } } }, "404": { "description": "The file was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } }, "/ocs/v2.php/apps/assistant/api/{apiVersion}/task/{ocpTaskId}/file/{fileId}/save": { "post": { "operationId": "assistant_api-save-output-file", "summary": "Save an output file", "description": "Save a file that was produced by a task", "tags": [ "assistant_api" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "apiVersion", "in": "path", "required": true, "schema": { "type": "string", "enum": [ "v1" ], "default": "v1" } }, { "name": "ocpTaskId", "in": "path", "description": "The task ID", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "fileId", "in": "path", "description": "The file ID", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "The file was saved", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "shareToken" ], "properties": { "shareToken": { "type": "string" } } } } } } } } } }, "404": { "description": "The file was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } }, "/ocs/v2.php/apps/assistant/api/{apiVersion}/task/{ocpTaskId}/output-file/{fileId}/preview": { "get": { "operationId": "assistant_api-get-output-file-preview", "summary": "Get task output file preview", "description": "Generate and get a preview of a task output file", "tags": [ "assistant_api" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "apiVersion", "in": "path", "required": true, "schema": { "type": "string", "enum": [ "v1" ], "default": "v1" } }, { "name": "ocpTaskId", "in": "path", "description": "The task ID", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "fileId", "in": "path", "description": "The task output file ID", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "x", "in": "query", "description": "Optional preview width in pixels", "schema": { "type": "integer", "format": "int64", "nullable": true, "default": 100 } }, { "name": "y", "in": "query", "description": "Optional preview height in pixels", "schema": { "type": "integer", "format": "int64", "nullable": true, "default": 100 } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "The file preview has been generated and is returned", "content": { "*/*": { "schema": { "type": "string", "format": "binary" } } } }, "404": { "description": "The output file is not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "string" } } } } } } } }, "303": { "description": "Fallback to the file type icon URL", "headers": { "Location": { "schema": { "type": "string" } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } }, "/ocs/v2.php/apps/assistant/api/{apiVersion}/task/{ocpTaskId}/output-file/{fileId}/download": { "get": { "operationId": "assistant_api-get-output-file", "summary": "Get task output file", "description": "Get a real task output file", "tags": [ "assistant_api" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "apiVersion", "in": "path", "required": true, "schema": { "type": "string", "enum": [ "v1" ], "default": "v1" } }, { "name": "ocpTaskId", "in": "path", "description": "The task ID", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "fileId", "in": "path", "description": "The task output file ID", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "The file preview has been generated and is returned", "content": { "*/*": { "schema": { "type": "string", "format": "binary" } } } }, "404": { "description": "The output file is not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "string" } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } }, "/ocs/v2.php/apps/assistant/api/{apiVersion}/file-action/{fileId}/{taskTypeId}": { "post": { "operationId": "assistant_api-run-file-action", "summary": "Run a file action", "description": "Launch a task to process a file and store the result in a new file in the same directory", "tags": [ "assistant_api" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "apiVersion", "in": "path", "required": true, "schema": { "type": "string", "enum": [ "v1" ], "default": "v1" } }, { "name": "fileId", "in": "path", "description": "The input file ID", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "taskTypeId", "in": "path", "description": "The task type of the operation to perform", "required": true, "schema": { "type": "string" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "The task has been scheduled successfully", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "version", "tooltip" ], "properties": { "version": { "type": "number", "format": "double" }, "tooltip": { "type": "string" } } } } } } } } } }, "400": { "description": "There was an issue while scheduling the task", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } }, "/ocs/v2.php/apps/assistant/api/{apiVersion}/assistant-folder-path": { "get": { "operationId": "assistant_api-get-assistant-folder-path", "summary": "Get the assistant folder's path", "description": "Returns the assistant folder's path inside the user's home mount", "tags": [ "assistant_api" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "apiVersion", "in": "path", "required": true, "schema": { "type": "string", "enum": [ "v1" ], "default": "v1" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "The path is returned in the form: //files/Assistant", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "path" ], "properties": { "path": { "type": "string" } } } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "anyOf": [ { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } } }, { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } ] } } } } } } }, "/ocs/v2.php/apps/assistant/api/{apiVersion}/skills": { "get": { "operationId": "agent_skills_api-list-skills", "summary": "List available skills for the current user", "description": "Returns each skill's name and description, as parsed from the YAML frontmatter of its SKILL.md file. Includes admin-configured global skills when configured.", "tags": [ "agent_skills" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "apiVersion", "in": "path", "required": true, "schema": { "type": "string", "enum": [ "v1" ], "default": "v1" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "Skills listed successfully", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "skills" ], "properties": { "skills": { "type": "array", "items": { "type": "object", "required": [ "name", "description" ], "properties": { "name": { "type": "string" }, "description": { "type": "string" } } } } } } } } } } } } }, "404": { "description": "Skills folder not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } } } } } }, "500": { "description": "Skills could not be listed", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } } } } } }, "401": { "description": "User is not authenticated", "content": { "application/json": { "schema": { "anyOf": [ { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } } }, { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } ] } } } } } }, "post": { "operationId": "agent_skills_api-store-skill", "summary": "Store a skill", "description": "Create or overwrite a skill in the user's storage. The `action` field of the response is 'created' if a new SKILL.md was written, or 'overwritten' if an existing one was replaced.", "tags": [ "agent_skills" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "skillName", "description", "content" ], "properties": { "skillName": { "type": "string", "description": "The skill's folder name (also used as the frontmatter `name`)" }, "description": { "type": "string", "description": "Short, agent-facing description of when to use the skill" }, "content": { "type": "string", "description": "Markdown body to write after the frontmatter" } } } } } }, "parameters": [ { "name": "apiVersion", "in": "path", "required": true, "schema": { "type": "string", "enum": [ "v1" ], "default": "v1" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "Existing skill overwritten", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "action" ], "properties": { "action": { "type": "string" } } } } } } } } } }, "201": { "description": "New skill created", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "action" ], "properties": { "action": { "type": "string" } } } } } } } } } }, "400": { "description": "Invalid skill name", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } } } } } }, "401": { "description": "User is not authenticated", "content": { "application/json": { "schema": { "anyOf": [ { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } } }, { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } ] } } } }, "500": { "description": "Skill could not be stored", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } } } } } } } } }, "/ocs/v2.php/apps/assistant/api/{apiVersion}/skills/{skillName}": { "get": { "operationId": "agent_skills_api-load-skill", "summary": "Load a skill's full content", "description": "Returns the full content of the SKILL.md file (frontmatter + body) for the given skill. If the skill is not present in the user's skills, the admin-configured global skills folder is used as a fallback when configured.", "tags": [ "agent_skills" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "apiVersion", "in": "path", "required": true, "schema": { "type": "string", "enum": [ "v1" ], "default": "v1" } }, { "name": "skillName", "in": "path", "description": "The skill's folder name", "required": true, "schema": { "type": "string" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "Skill content returned", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "content" ], "properties": { "content": { "type": "string" } } } } } } } } } }, "400": { "description": "Skill name is too long", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } } } } } }, "404": { "description": "Skill not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } } } } } }, "500": { "description": "Skill could not be loaded", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } } } } } }, "401": { "description": "User is not authenticated", "content": { "application/json": { "schema": { "anyOf": [ { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } } }, { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } ] } } } } } } }, "/ocs/v2.php/apps/assistant/chat/sessions": { "post": { "operationId": "chattyllm-new-session-restful", "summary": "Create chat session", "description": "Create a new chat session, add a system message with user instructions", "tags": [ "chat_api" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "timestamp": { "type": "integer", "format": "int64", "nullable": true, "default": null, "description": "The session creation date" }, "title": { "type": "string", "nullable": true, "default": null, "description": "The session title" } } } } } }, "parameters": [ { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "Chat session has been successfully created", "content": { "application/json": { "schema": { "type": "object", "required": [ "session" ], "properties": { "session": { "$ref": "#/components/schemas/ChatSession" } } } } } }, "500": { "description": "", "content": { "application/json": { "schema": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } }, "text/plain": { "schema": { "type": "string" } } } }, "401": { "description": "User is either not logged in or not found", "content": { "application/json": { "schema": { "anyOf": [ { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } }, { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } ] } } } } } }, "get": { "operationId": "chattyllm-get-sessions", "summary": "Get chat sessions", "description": "Get all chat sessions for the current user", "tags": [ "chat_api" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "isAssignment", "in": "query", "description": "Whether to get only the sessions for assignments (true) or not (false) defaults to false", "schema": { "type": "boolean", "nullable": true, "default": false } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "The session list has been obtained successfully", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ChatSession" } } } } }, "500": { "description": "", "content": { "application/json": { "schema": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } }, "401": { "description": "Not logged in", "content": { "application/json": { "schema": { "anyOf": [ { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } }, { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } ] } } } } } } }, "/ocs/v2.php/apps/assistant/chat/sessions/{sessionId}": { "put": { "operationId": "chattyllm-update-chat-session-restful", "summary": "Update session", "tags": [ "chat_api" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "title": { "type": "string", "nullable": true, "default": null, "description": "The new chat session title" }, "is_remembered": { "type": "boolean", "nullable": true, "default": null, "description": "The new is_remembered status: Whether to remember the insights from this chat session across all chat session" } } } } } }, "parameters": [ { "name": "sessionId", "in": "path", "description": "The chat session ID", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "The title has been updated successfully", "content": { "application/json": { "schema": { "type": "object" } } } }, "500": { "description": "", "content": { "application/json": { "schema": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } }, "404": { "description": "The session was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } }, "401": { "description": "User is not logged in", "content": { "application/json": { "schema": { "anyOf": [ { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } }, { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } ] } } } } } }, "delete": { "operationId": "chattyllm-delete-session-restful", "summary": "Delete a chat session", "description": "Delete a chat session by ID", "tags": [ "chat_api" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "sessionId", "in": "path", "description": "The session ID", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "The session has been deleted successfully", "content": { "application/json": { "schema": { "type": "object" } } } }, "500": { "description": "", "content": { "application/json": { "schema": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } }, "401": { "description": "Not logged in", "content": { "application/json": { "schema": { "anyOf": [ { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } }, { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } ] } } } } } } }, "/ocs/v2.php/apps/assistant/chat/new_session": { "put": { "operationId": "chattyllm-new-session", "summary": "Create chat session", "description": "Create a new chat session, add a system message with user instructions", "tags": [ "chat_api" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "timestamp": { "type": "integer", "format": "int64", "nullable": true, "default": null, "description": "The session creation date" }, "title": { "type": "string", "nullable": true, "default": null, "description": "The session title" } } } } } }, "parameters": [ { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "Chat session has been successfully created", "content": { "application/json": { "schema": { "type": "object", "required": [ "session" ], "properties": { "session": { "$ref": "#/components/schemas/ChatSession" } } } } } }, "500": { "description": "", "content": { "application/json": { "schema": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } }, "text/plain": { "schema": { "type": "string" } } } }, "401": { "description": "User is either not logged in or not found", "content": { "application/json": { "schema": { "anyOf": [ { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } }, { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } ] } } } } } } }, "/ocs/v2.php/apps/assistant/chat/update_session": { "patch": { "operationId": "chattyllm-update-session-title", "summary": "Update session title", "description": "Update the title of a chat session", "tags": [ "chat_api" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "sessionId", "title" ], "properties": { "sessionId": { "type": "integer", "format": "int64", "description": "The chat session ID" }, "title": { "type": "string", "description": "The new chat session title" } } } } } }, "parameters": [ { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "The title has been updated successfully", "content": { "application/json": { "schema": { "type": "object" } } } }, "500": { "description": "", "content": { "application/json": { "schema": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } }, "401": { "description": "Not logged in", "content": { "application/json": { "schema": { "anyOf": [ { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } }, { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } ] } } } }, "404": { "description": "Session not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } } } } }, "/ocs/v2.php/apps/assistant/chat/delete_session": { "delete": { "operationId": "chattyllm-delete-session", "summary": "Delete a chat session", "description": "Delete a chat session by ID", "tags": [ "chat_api" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "sessionId", "in": "query", "description": "The session ID", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "The session has been deleted successfully", "content": { "application/json": { "schema": { "type": "object" } } } }, "500": { "description": "", "content": { "application/json": { "schema": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } }, "401": { "description": "Not logged in", "content": { "application/json": { "schema": { "anyOf": [ { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } }, { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } ] } } } } } } }, "/ocs/v2.php/apps/assistant/chat/new_message": { "put": { "operationId": "chattyllm-new-message", "summary": "Add a message", "description": "Add a new chat message to the session", "tags": [ "chat_api" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "sessionId", "role", "content" ], "properties": { "sessionId": { "type": "integer", "format": "int64", "description": "The chat session ID" }, "role": { "type": "string", "description": "Role of the message (human, assistant etc...)" }, "content": { "type": "string", "description": "Content of the message" }, "timestamp": { "type": "integer", "format": "int64", "nullable": true, "default": null, "description": "Date of the message" }, "attachments": { "type": "array", "nullable": true, "default": null, "description": "List of attachment objects", "items": { "type": "object", "required": [ "type", "file_id" ], "properties": { "type": { "type": "string" }, "file_id": { "type": "integer", "format": "int64" } } } }, "firstHumanMessage": { "type": "boolean", "default": false, "description": "Is it the first human message of the session?" } } } } } }, "parameters": [ { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "The session list has been obtained successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatMessage" } } } }, "500": { "description": "", "content": { "application/json": { "schema": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } }, "401": { "description": "Not logged in", "content": { "application/json": { "schema": { "anyOf": [ { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } }, { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } ] } } } }, "400": { "description": "Message is malformed", "content": { "application/json": { "schema": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } }, "404": { "description": "Session was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } } } } }, "/ocs/v2.php/apps/assistant/chat/delete_message": { "delete": { "operationId": "chattyllm-delete-message", "summary": "Delete a message", "description": "Delete a chat message by ID", "tags": [ "chat_api" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "messageId", "in": "query", "description": "The message ID", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "sessionId", "in": "query", "description": "The session ID", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "The message has been successfully deleted", "content": { "application/json": { "schema": { "type": "object" } } } }, "500": { "description": "", "content": { "application/json": { "schema": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } }, "401": { "description": "Not logged in", "content": { "application/json": { "schema": { "anyOf": [ { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } }, { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } ] } } } }, "404": { "description": "The session was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } } } } }, "/ocs/v2.php/apps/assistant/chat/messages": { "get": { "operationId": "chattyllm-get-messages", "summary": "Get session messages", "description": "Get chat messages for the session without the system message", "tags": [ "chat_api" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "sessionId", "in": "query", "description": "The session ID", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "limit", "in": "query", "description": "The max number of messages to return", "schema": { "type": "integer", "format": "int64", "default": 20 } }, { "name": "cursor", "in": "query", "description": "The index of the first result to return", "schema": { "type": "integer", "format": "int64", "default": 0 } }, { "name": "filterByRole", "in": "query", "description": "Only role to include in the response", "schema": { "type": "string", "default": "" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "The message list has been successfully obtained", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ChatMessage" } } } } }, "500": { "description": "", "content": { "application/json": { "schema": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } }, "401": { "description": "Not logged in", "content": { "application/json": { "schema": { "anyOf": [ { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } }, { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } ] } } } }, "404": { "description": "The session was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } } } } }, "/ocs/v2.php/apps/assistant/chat/sessions/{sessionId}/messages/{messageId}": { "get": { "operationId": "chattyllm-get-message", "summary": "Get a message", "description": "Get a chat message in a session", "tags": [ "chat_api" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "sessionId", "in": "path", "description": "The session ID", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "messageId", "in": "path", "description": "The message ID", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "The message has been successfully obtained", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatMessage" } } } }, "500": { "description": "", "content": { "application/json": { "schema": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } }, "401": { "description": "Not logged in", "content": { "application/json": { "schema": { "anyOf": [ { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } }, { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } ] } } } }, "404": { "description": "The session or the message was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } } } } }, "/ocs/v2.php/apps/assistant/chat/generate": { "get": { "operationId": "chattyllm-generate-for-session", "summary": "Generate a new assistant message", "description": "Schedule a task to generate a new message for a session", "tags": [ "chat_api" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "sessionId", "in": "query", "description": "The session ID", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "agencyConfirm", "in": "query", "description": "Potential agency sensitive actions confirmation (1: accept, 0: reject)", "schema": { "type": "integer", "format": "int64", "default": 0 } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "The task has been successfully scheduled", "content": { "application/json": { "schema": { "type": "object", "required": [ "taskId" ], "properties": { "taskId": { "type": "integer", "format": "int64" } } } } } }, "500": { "description": "", "content": { "application/json": { "schema": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } }, "text/plain": { "schema": { "type": "string" } } } }, "401": { "description": "Not logged in", "content": { "application/json": { "schema": { "anyOf": [ { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } }, { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } ] } } } }, "400": { "description": "Task was not scheduled", "content": { "application/json": { "schema": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } }, "404": { "description": "Session was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } } } } }, "/ocs/v2.php/apps/assistant/chat/regenerate": { "get": { "operationId": "chattyllm-regenerate-for-session", "summary": "Regenerate response for a message", "description": "Delete the message with the given message ID and all following ones, then schedule a task to generate a new message for the session", "tags": [ "chat_api" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "sessionId", "in": "query", "description": "The chat session ID", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "messageId", "in": "query", "description": "The chat message ID", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "The task has been successfully scheduled", "content": { "application/json": { "schema": { "type": "object", "required": [ "taskId" ], "properties": { "taskId": { "type": "integer", "format": "int64" } } } } } }, "500": { "description": "", "content": { "application/json": { "schema": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } }, "text/plain": { "schema": { "type": "string" } } } }, "401": { "description": "Not logged in", "content": { "application/json": { "schema": { "anyOf": [ { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } }, { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } ] } } } }, "400": { "description": "Task was not scheduled", "content": { "application/json": { "schema": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } }, "404": { "description": "Session was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } } } } }, "/ocs/v2.php/apps/assistant/chat/check_session": { "get": { "operationId": "chattyllm-check-session", "summary": "Check the status of a session", "description": "Used by the frontend to determine if it should poll a generation task status.", "tags": [ "chat_api" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "sessionId", "in": "query", "description": "The chat session ID", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "The session status has been successfully obtained", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatSessionCheck" } } } }, "401": { "description": "Not logged in", "content": { "application/json": { "schema": { "anyOf": [ { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } }, { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } ] } } } }, "400": { "description": "Task processing failed, impossible to check the related tasks", "content": { "application/json": { "schema": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } }, "404": { "description": "Session was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } }, "500": { "description": "", "content": { "text/plain": { "schema": { "type": "string" } } } } } } }, "/ocs/v2.php/apps/assistant/chat/check_generation": { "get": { "operationId": "chattyllm-check-message-generation-task", "summary": "Check the status of a generation task. The value of slow_pickup will be set to true if the task is not being picked up.", "description": "Used by the frontend to poll a generation task status. If the task succeeds, a new message is stored and returned.", "tags": [ "chat_api" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "taskId", "in": "query", "description": "The message generation task ID", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "sessionId", "in": "query", "description": "The chat session ID", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "The task was successful, a message has been generated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatAgencyMessage" } } } }, "417": { "description": "The task is still running or has not been picked up yet", "content": { "application/json": { "schema": { "type": "object", "required": [ "task_status", "slow_pickup" ], "properties": { "task_status": { "type": "integer", "format": "int64" }, "slow_pickup": { "type": "boolean" }, "task_output": { "type": "object", "nullable": true, "additionalProperties": { "oneOf": [ { "type": "array", "items": { "oneOf": [ { "type": "number" }, { "type": "string" } ] } }, { "type": "number" }, { "type": "string" } ] } } } } } } }, "400": { "description": "Task processing failed", "content": { "application/json": { "schema": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" }, "task_status": { "type": "integer", "format": "int64" }, "userFacingErrorMessage": { "type": "string", "nullable": true } } } } } }, "500": { "description": "", "content": { "application/json": { "schema": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } }, "text/plain": { "schema": { "type": "string" } } } }, "401": { "description": "Not logged in", "content": { "application/json": { "schema": { "anyOf": [ { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } }, { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } ] } } } }, "404": { "description": "Session was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } } } } }, "/ocs/v2.php/apps/assistant/chat/generate_title": { "get": { "operationId": "chattyllm-generate-title", "summary": "Generate a session title", "description": "Schedule a task to generate a title for a chat session", "tags": [ "chat_api" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "sessionId", "in": "query", "description": "The chat session ID", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "The task has been successfully scheduled", "content": { "application/json": { "schema": { "type": "object", "required": [ "taskId" ], "properties": { "taskId": { "type": "integer", "format": "int64" } } } } } }, "500": { "description": "", "content": { "application/json": { "schema": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } }, "401": { "description": "Not logged in", "content": { "application/json": { "schema": { "anyOf": [ { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } }, { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } ] } } } }, "400": { "description": "Task was not scheduled", "content": { "application/json": { "schema": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } }, "404": { "description": "Session was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } } } } }, "/ocs/v2.php/apps/assistant/chat/check_title_generation": { "get": { "operationId": "chattyllm-check-title-generation-task", "summary": "Check the status of a title generation task", "description": "Used by the frontend to poll a title generation task status. If the task succeeds, the new title is set and returned.", "tags": [ "chat_api" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "taskId", "in": "query", "description": "The title generation task ID", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "sessionId", "in": "query", "description": "The chat session ID", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "Title has been successfully generated", "content": { "application/json": { "schema": { "type": "object", "required": [ "result" ], "properties": { "result": { "type": "string" } } } } } }, "417": { "description": "The task is still running or has not been picked up yet", "content": { "application/json": { "schema": { "type": "object", "required": [ "task_status" ], "properties": { "task_status": { "type": "integer", "format": "int64" } } } } } }, "500": { "description": "", "content": { "application/json": { "schema": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } }, "text/plain": { "schema": { "type": "string" } } } }, "401": { "description": "Not logged in", "content": { "application/json": { "schema": { "anyOf": [ { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } }, { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } ] } } } }, "400": { "description": "Task processing failed", "content": { "application/json": { "schema": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } }, "404": { "description": "Session was not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } } } } }, "/ocs/v2.php/apps/assistant/assignments": { "post": { "operationId": "assignments_api-create-user-assignment", "summary": "Create a new assignment", "tags": [ "assignments" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "title", "prompt", "startsAt", "recurrence" ], "properties": { "title": { "type": "string", "description": "The title of the new assignment" }, "prompt": { "type": "string", "description": "The prompt to be sent to the assistant when the assignment is executed" }, "startsAt": { "type": "integer", "format": "int64", "description": "The timestamp when the assignment should start being executed" }, "recurrence": { "type": "string", "description": "The recurrence rule for the assignment, in RRULE format (e.g. \"FREQ=DAILY;INTERVAL=1\" for a daily assignment)" }, "timezone": { "type": "string", "nullable": true, "description": "The timezone for this assignment (either the timezone name or a timezone offset, e.g. \"Europe/Berlin\" or \"+0100\" for UTC+1). Defaults to the user's current timezone" } } } } } }, "parameters": [ { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "User assignments returned", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "assignment" ], "properties": { "assignment": { "$ref": "#/components/schemas/Assignment" } } } } } } } } } }, "403": { "description": "User not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "string" } } } } } } } }, "500": { "description": "", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "string" } } } } } } } }, "400": { "description": "Validation error", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "string" } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } }, "get": { "operationId": "assignments_api-get-user-assignments", "summary": "Get user's assignments", "description": "Get a list of assignments for the current user.", "tags": [ "assignments" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "User assignments returned", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "assignments" ], "properties": { "assignments": { "type": "array", "items": { "$ref": "#/components/schemas/Assignment" } } } } } } } } } } }, "403": { "description": "User not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "string" } } } } } } } }, "500": { "description": "", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "string" } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } }, "/ocs/v2.php/apps/assistant/assignments/{id}": { "get": { "operationId": "assignments_api-get-user-assignment", "summary": "Get user's assignment", "tags": [ "assignments" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "id", "in": "path", "description": "The id of the assignment to return", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "User tasks returned", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "assignment" ], "properties": { "assignment": { "$ref": "#/components/schemas/Assignment" } } } } } } } } } }, "403": { "description": "User not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "string" } } } } } } } }, "404": { "description": "Assignment not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "string" } } } } } } } }, "500": { "description": "", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "string" } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } }, "patch": { "operationId": "assignments_api-update-user-assignment", "summary": "Update a user's assignment", "tags": [ "assignments" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "prompt": { "type": "string", "nullable": true, "description": "The prompt to be sent to the assistant when the assignment is executed" }, "recurrence": { "type": "string", "nullable": true, "description": "The recurrence rule for the assignment, in RRULE format" }, "startsAt": { "type": "integer", "format": "int64", "nullable": true, "description": "The timestamp when the assignment should start being executed" }, "timezone": { "type": "string", "nullable": true, "description": "The timezone for this assignment, omit to leave the current value in place. the value should be either the timezone name or a timezone offset, e.g. \"Europe/Berlin\" or \"+0100\" for UTC+1" } } } } } }, "parameters": [ { "name": "id", "in": "path", "description": "The id of the assignment", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "User tasks returned", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "assignment" ], "properties": { "assignment": { "$ref": "#/components/schemas/Assignment" } } } } } } } } } }, "403": { "description": "User not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "string" } } } } } } } }, "400": { "description": "Malformed input", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "string" } } } } } } } }, "404": { "description": "Assignment not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "string" } } } } } } } }, "500": { "description": "", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "string" } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } }, "delete": { "operationId": "assignments_api-delete-user-assignment", "summary": "Delete a user's assignment", "tags": [ "assignments" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "id", "in": "path", "description": "The id of the assignment to delete", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "User assignment deleted or not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "string" } } } } } } } }, "403": { "description": "User not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "string" } } } } } } } }, "500": { "description": "", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "string" } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } } }, "tags": [] }