{ "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": { "ImageGenInfo": { "type": "object", "properties": { "files": { "type": "array", "items": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "integer", "format": "int64" }, "visible": { "type": "boolean" } } } }, "prompt": { "type": "string" }, "image_gen_id": { "type": "string" }, "is_owner": { "type": "boolean" }, "processing": { "type": "integer", "format": "int64" } } }, "ImageProcessPromptResponse": { "type": "object", "required": [ "task", "url", "reference_url", "image_gen_id", "prompt" ], "properties": { "task": { "$ref": "#/components/schemas/Task" }, "url": { "type": "string" }, "reference_url": { "type": "string" }, "image_gen_id": { "type": "string" }, "prompt": { "type": "string" } } }, "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" } } } } }, "Task": { "type": "object", "required": [ "id", "userId", "inputs", "output", "appId", "ocpTaskId", "taskType", "timestamp", "status", "category", "identifier" ], "properties": { "id": { "type": "integer", "format": "int64" }, "userId": { "type": "string" }, "inputs": { "type": "object", "additionalProperties": { "type": "object" } }, "output": { "type": "string" }, "appId": { "type": "string" }, "ocpTaskId": { "type": "integer", "format": "int64" }, "taskType": { "type": "string" }, "timestamp": { "type": "integer", "format": "int64" }, "status": { "type": "integer", "format": "int64" }, "category": { "type": "integer", "format": "int64" }, "identifier": { "type": "string" } } }, "TaskType": { "type": "object", "required": [ "id", "name", "description" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "description": { "type": "string" } } } } }, "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/TaskType" } } } } } } } } } } } } } }, "/ocs/v2.php/apps/assistant/api/{apiVersion}/task/{metaTaskId}": { "get": { "operationId": "assistant_api-get-assistant-task", "summary": "Get an assistant task", "description": "Get one specific task. It has to be a task owned by 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": "metaTaskId", "in": "path", "description": "ID of the 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 has been 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": [ "task" ], "properties": { "task": { "$ref": "#/components/schemas/Task" } } } } } } } } } }, "404": { "description": "Task has not been 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" } } } } } } } } } }, "delete": { "operationId": "assistant_api-delete-task", "summary": "Delete an assistant task", "description": "This will cancel the task if needed and then delete it from the server.", "tags": [ "task_management" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "apiVersion", "in": "path", "required": true, "schema": { "type": "string", "enum": [ "v1" ], "default": "v1" } }, { "name": "metaTaskId", "in": "path", "description": "ID of the 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 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" } } } } } } } }, "404": { "description": "Task 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" } } } } } } } } } } }, "/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": "taskType", "in": "query", "description": "Task type id. If null, tasks of all task types will be retrieved", "schema": { "type": "string", "nullable": true } }, { "name": "category", "in": "query", "description": "Task category. If null, tasks of all categories will be retrieved", "schema": { "type": "integer", "format": "int64", "nullable": true } }, { "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": "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/Task" } } } } } } } } } } }, "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" } } } } } } } } } } }, "/ocs/v2.php/apps/assistant/api/{apiVersion}/task/run": { "post": { "operationId": "assistant_api-run-text-processing-task", "summary": "Run a text processing task", "description": "This endpoint will run the task synchronously.", "tags": [ "text_processing" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "type", "in": "query", "description": "Task type id", "required": true, "schema": { "type": "string" } }, { "name": "inputs", "in": "query", "description": "Input parameters", "required": true, "schema": { "type": "string" } }, { "name": "appId", "in": "query", "description": "App id to be set in the created task", "required": true, "schema": { "type": "string" } }, { "name": "identifier", "in": "query", "description": "Identifier to be set in the created task", "required": true, "schema": { "type": "string" } }, { "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": "Task started 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": [ "task" ], "properties": { "task": { "$ref": "#/components/schemas/Task" } } } } } } } } } }, "400": { "description": "Running task 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" } } } } } } } } } } }, "/ocs/v2.php/apps/assistant/api/{apiVersion}/task/schedule": { "post": { "operationId": "assistant_api-schedule-text-processing-task", "summary": "Schedule a text processing task", "description": "This endpoint will schedule the task for it to run as soon as possible.", "tags": [ "text_processing" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "type", "in": "query", "description": "Task type id", "required": true, "schema": { "type": "string" } }, { "name": "inputs", "in": "query", "description": "Input parameters", "required": true, "schema": { "type": "string" } }, { "name": "appId", "in": "query", "description": "App id to be set in the created task", "required": true, "schema": { "type": "string" } }, { "name": "identifier", "in": "query", "description": "Identifier to be set in the created task", "required": true, "schema": { "type": "string" } }, { "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": "Task scheduled", "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": [ "task" ], "properties": { "task": { "$ref": "#/components/schemas/Task" } } } } } } } } } }, "400": { "description": "Scheduling task 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" } } } } } } } } } } }, "/ocs/v2.php/apps/assistant/api/{apiVersion}/task/run-or-schedule": { "post": { "operationId": "assistant_api-run-or-schedule-text-processing-task", "summary": "Run or schedule a text processing task", "description": "This endpoint will either run or schedule the task.\nThe choice between run or schedule depends on the estimated runtime declared by the actual provider that will process the task.", "tags": [ "text_processing" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "type", "in": "query", "description": "Task type id", "required": true, "schema": { "type": "string" } }, { "name": "inputs", "in": "query", "description": "Input parameters", "required": true, "schema": { "type": "string" } }, { "name": "appId", "in": "query", "description": "App id to be set in the created task", "required": true, "schema": { "type": "string" } }, { "name": "identifier", "in": "query", "description": "Identifier to be set in the created task", "required": true, "schema": { "type": "string" } }, { "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": "Task scheduled", "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": [ "task" ], "properties": { "task": { "$ref": "#/components/schemas/Task" } } } } } } } } } }, "400": { "description": "Scheduling task 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" } } } } } } } } } } }, "/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": [] } ], "parameters": [ { "name": "filePath", "in": "query", "description": "Path of the file to parse in the user's storage", "required": true, "schema": { "type": "string" } }, { "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" } } } } } } } } } } }, "/ocs/v2.php/apps/assistant/api/{apiVersion}/task/cancel/{metaTaskId}": { "put": { "operationId": "assistant_api-cancel-task", "summary": "Cancel a task", "description": "This endpoint will prevent a scheduled task to run by unscheduling it", "tags": [ "task_management" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "apiVersion", "in": "path", "required": true, "schema": { "type": "string", "enum": [ "v1" ], "default": "v1" } }, { "name": "metaTaskId", "in": "path", "description": "ID of the 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 canceled 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" } } } } } } } }, "404": { "description": "Task 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" } } } } } } } } } } }, "/ocs/v2.php/apps/assistant/api/{apiVersion}/i/process_prompt": { "post": { "operationId": "text2_image_api-process-prompt", "summary": "Run or schedule an image generation task", "tags": [ "image_generation" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "appId", "in": "query", "description": "App id to be set in the created task", "required": true, "schema": { "type": "string" } }, { "name": "identifier", "in": "query", "description": "Identifier to be set in the created task", "required": true, "schema": { "type": "string" } }, { "name": "prompt", "in": "query", "description": "Input prompt for the image", "required": true, "schema": { "type": "string" } }, { "name": "nResults", "in": "query", "description": "Number of images to generate", "schema": { "type": "integer", "format": "int64", "default": 1 } }, { "name": "displayPrompt", "in": "query", "description": "Option to include the prompt when displaying the result images", "schema": { "type": "integer", "default": 0, "enum": [ 0, 1 ] } }, { "name": "notifyReadyIfScheduled", "in": "query", "description": "Whether a notification will be produced when the tasks has run if it was scheduled", "schema": { "type": "integer", "default": 0, "enum": [ 0, 1 ] } }, { "name": "schedule", "in": "query", "description": "Force scheduling even if the task could run synchronously", "schema": { "type": "integer", "default": 0, "enum": [ 0, 1 ] } }, { "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": "Task started 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": [ "task" ], "properties": { "task": { "$ref": "#/components/schemas/ImageProcessPromptResponse" } } } } } } } } } }, "400": { "description": "Starting task 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": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } } } } } } } } }, "/ocs/v2.php/apps/assistant/api/{apiVersion}/i/info/{imageGenId}": { "get": { "operationId": "text2_image_api-get-generation-info", "summary": "Get image generation information", "tags": [ "image_generation" ], "security": [ {}, { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "apiVersion", "in": "path", "required": true, "schema": { "type": "string", "enum": [ "v1" ], "default": "v1" } }, { "name": "imageGenId", "in": "path", "description": "ID of the generation info", "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": "Returns the requested data", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "$ref": "#/components/schemas/ImageGenInfo" } } } } } } } }, "400": { "description": "The image generation does not exist", "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": "The image generation has been deleted", "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": "Other error", "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}/i/{imageGenId}/{fileNameId}": { "get": { "operationId": "text2_image_api-get-image", "summary": "Get one image of a generation", "tags": [ "image_generation" ], "security": [ {}, { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "apiVersion", "in": "path", "required": true, "schema": { "type": "string", "enum": [ "v1" ], "default": "v1" } }, { "name": "imageGenId", "in": "path", "description": "ID of the image generation", "required": true, "schema": { "type": "string" } }, { "name": "fileNameId", "in": "path", "description": "ID of the file name", "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": "Returns the image data", "content": { "*/*": { "schema": { "type": "string", "format": "binary" } } } }, "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" } } } } } } } } } }, "400": { "description": "Getting image 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": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } } } } } } } } }, "/ocs/v2.php/apps/assistant/api/{apiVersion}/i/cancel_generation": { "post": { "operationId": "text2_image_api-cancel-generation", "summary": "Cancel image generation", "description": "Does not need bruteforce protection since we respond with success anyways (In theory bruteforce may be possible by a response timing attack but the attacker won't gain access to the generation since its deleted during the attack.)", "tags": [ "image_generation" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "imageGenId", "in": "query", "description": "ID of the image generation", "required": true, "schema": { "type": "string" } }, { "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": "Generation canceled 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" } } } } } } }, "/ocs/v2.php/apps/assistant/api/{apiVersion}/i/visibility/{imageGenId}": { "post": { "operationId": "text2_image_api-set-visibility-of-image-files", "summary": "Set visibility of images in one generation", "tags": [ "image_generation" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "fileVisStatusArray", "in": "query", "description": "New file visibilities", "required": true, "schema": { "type": "string" } }, { "name": "apiVersion", "in": "path", "required": true, "schema": { "type": "string", "enum": [ "v1" ], "default": "v1" } }, { "name": "imageGenId", "in": "path", "description": "ID of the image generation", "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": "Visiblity set 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" } } } } } } } }, "400": { "description": "Setting visibility 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": "object", "required": [ "error" ], "properties": { "error": { "type": "string" } } } } } } } } } }, "401": { "description": "Setting visibility is not allowed", "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": "", "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}/i/notify/{imageGenId}": { "post": { "operationId": "text2_image_api-notify-when-ready", "summary": "Notify when image generation is ready", "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": [ "image_generation" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "apiVersion", "in": "path", "required": true, "schema": { "type": "string", "enum": [ "v1" ], "default": "v1" } }, { "name": "imageGenId", "in": "path", "description": "ID of the image generation", "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": "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" } } } } } } } } } } } } }, "/ocs/v2.php/apps/assistant/api/{apiVersion}/stt/transcribeAudio": { "post": { "operationId": "speech_to_text_api-transcribe-audio", "summary": "Transcribe uploaded audio file", "description": "Schedule audio transcription of an uploaded file and return the created task.", "tags": [ "speech_to_text_api" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "appId", "in": "query", "description": "App id to be set in the created task", "required": true, "schema": { "type": "string" } }, { "name": "identifier", "in": "query", "description": "Identifier to be set in the created task", "required": true, "schema": { "type": "string" } }, { "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": "Task started 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": [ "task" ], "properties": { "task": { "$ref": "#/components/schemas/Task" } } } } } } } } } }, "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" } } } } } }, "text/plain": { "schema": { "type": "string" } } } }, "400": { "description": "Starting task 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" } } } } } } } } } } }, "/ocs/v2.php/apps/assistant/api/{apiVersion}/stt/transcribeFile": { "post": { "operationId": "speech_to_text_api-transcribe-file", "summary": "Transcribe file from user's storage", "description": "Schedule audio transcription of a user's storage file and return the created task", "tags": [ "speech_to_text_api" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "path", "in": "query", "description": "Nextcloud file path", "required": true, "schema": { "type": "string" } }, { "name": "appId", "in": "query", "description": "App id to be set in the created task", "required": true, "schema": { "type": "string" } }, { "name": "identifier", "in": "query", "description": "Identifier to be set in the created task", "required": true, "schema": { "type": "string" } }, { "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": "Task started 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": [ "task" ], "properties": { "task": { "$ref": "#/components/schemas/Task" } } } } } } } } } }, "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" } } } } } }, "text/plain": { "schema": { "type": "string" } } } }, "400": { "description": "Starting task 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" } } } } } } } }, "404": { "description": "File 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" } } } } } } } } } } } }, "tags": [] }