{ "openapi": "3.0.3", "info": { "title": "spreed-bots", "version": "0.0.1", "description": "Chat, video & audio-conferencing using WebRTC", "license": { "name": "agpl" } }, "components": { "securitySchemes": { "basic_auth": { "type": "http", "scheme": "basic" }, "bearer_auth": { "type": "http", "scheme": "bearer" } }, "schemas": { "Capabilities": { "type": "object", "required": [ "features", "features-local", "config", "config-local", "version" ], "properties": { "features": { "type": "array", "items": { "type": "string" }, "minItems": 1 }, "features-local": { "type": "array", "items": { "type": "string" }, "minItems": 1 }, "config": { "type": "object", "required": [ "attachments", "call", "chat", "conversations", "federation", "previews", "signaling", "experiments" ], "properties": { "attachments": { "type": "object", "required": [ "allowed" ], "properties": { "allowed": { "type": "boolean" }, "folder": { "type": "string" } } }, "call": { "type": "object", "required": [ "enabled", "breakout-rooms", "recording", "recording-consent", "supported-reactions", "predefined-backgrounds", "predefined-backgrounds-v2", "can-upload-background", "sip-enabled", "sip-dialout-enabled", "can-enable-sip", "start-without-media", "max-duration", "blur-virtual-background", "end-to-end-encryption" ], "properties": { "enabled": { "type": "boolean" }, "breakout-rooms": { "type": "boolean" }, "recording": { "type": "boolean" }, "recording-consent": { "type": "integer", "format": "int64" }, "supported-reactions": { "type": "array", "items": { "type": "string" } }, "predefined-backgrounds": { "type": "array", "description": "List of file names relative to the spreed/img/backgrounds/ web path, e.g. `2_home.jpg`", "items": { "type": "string" } }, "predefined-backgrounds-v2": { "type": "array", "description": "List of file paths relative to the server web root with leading slash, e.g. `/apps/spreed/img/backgrounds/2_home.jpg`", "items": { "type": "string" } }, "can-upload-background": { "type": "boolean" }, "sip-enabled": { "type": "boolean" }, "sip-dialout-enabled": { "type": "boolean" }, "can-enable-sip": { "type": "boolean" }, "start-without-media": { "type": "boolean" }, "max-duration": { "type": "integer", "format": "int64" }, "blur-virtual-background": { "type": "boolean" }, "end-to-end-encryption": { "type": "boolean" } } }, "chat": { "type": "object", "required": [ "max-length", "read-privacy", "has-translation-providers", "has-translation-task-providers", "typing-privacy", "summary-threshold" ], "properties": { "max-length": { "type": "integer", "format": "int64" }, "read-privacy": { "type": "integer", "format": "int64" }, "has-translation-providers": { "type": "boolean" }, "has-translation-task-providers": { "type": "boolean" }, "typing-privacy": { "type": "integer", "format": "int64" }, "summary-threshold": { "type": "integer", "format": "int64", "minimum": 1 } } }, "conversations": { "type": "object", "required": [ "can-create", "force-passwords", "list-style", "description-length", "retention-event", "retention-phone", "retention-instant-meetings" ], "properties": { "can-create": { "type": "boolean" }, "force-passwords": { "type": "boolean" }, "list-style": { "type": "string", "enum": [ "two-lines", "compact" ] }, "description-length": { "type": "integer", "format": "int64", "minimum": 1 }, "retention-event": { "type": "integer", "format": "int64", "minimum": 0 }, "retention-phone": { "type": "integer", "format": "int64", "minimum": 0 }, "retention-instant-meetings": { "type": "integer", "format": "int64", "minimum": 0 } } }, "federation": { "type": "object", "required": [ "enabled", "incoming-enabled", "outgoing-enabled", "only-trusted-servers" ], "properties": { "enabled": { "type": "boolean" }, "incoming-enabled": { "type": "boolean" }, "outgoing-enabled": { "type": "boolean" }, "only-trusted-servers": { "type": "boolean" } } }, "previews": { "type": "object", "required": [ "max-gif-size" ], "properties": { "max-gif-size": { "type": "integer", "format": "int64" } } }, "signaling": { "type": "object", "required": [ "session-ping-limit" ], "properties": { "session-ping-limit": { "type": "integer", "format": "int64" }, "hello-v2-token-key": { "type": "string" } } }, "experiments": { "type": "object", "required": [ "enabled" ], "properties": { "enabled": { "type": "integer", "format": "int64", "minimum": 0 } } } } }, "config-local": { "type": "object", "additionalProperties": { "type": "array", "items": { "type": "string" }, "minItems": 1 } }, "version": { "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", "properties": { "spreed": { "$ref": "#/components/schemas/Capabilities" } } } } }, "paths": { "/ocs/v2.php/apps/spreed/api/{apiVersion}/bot/{token}/message": { "post": { "operationId": "bot-send-message", "summary": "Sends a new chat message to the given room", "description": "The author and timestamp are automatically set to the current user/guest and time.", "tags": [ "bot" ], "security": [ {}, { "bearer_auth": [] }, { "basic_auth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string", "description": "The message to send" }, "referenceId": { "type": "string", "default": "", "description": "For the message to be able to later identify it again" }, "replyTo": { "type": "integer", "format": "int64", "default": 0, "description": "Parent id which this message is a reply to" }, "silent": { "type": "boolean", "default": false, "description": "If sent silent the chat message will not create any notifications" } } } } } }, "parameters": [ { "name": "apiVersion", "in": "path", "required": true, "schema": { "type": "string", "enum": [ "v1" ], "default": "v1" } }, { "name": "token", "in": "path", "description": "Conversation token", "required": true, "schema": { "type": "string", "pattern": "^[a-z0-9]{4,30}$" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "201": { "description": "Message sent successfully", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "nullable": true } } } } } } } }, "400": { "description": "When the replyTo is invalid or message is empty", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "nullable": true } } } } } } } }, "401": { "description": "Sending message 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": { "nullable": true } } } } } } } }, "413": { "description": "Message too long", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "nullable": true } } } } } } } } } } }, "/ocs/v2.php/apps/spreed/api/{apiVersion}/bot/{token}/reaction/{messageId}": { "post": { "operationId": "bot-react", "summary": "Adds a reaction to a chat message", "tags": [ "bot" ], "security": [ {}, { "bearer_auth": [] }, { "basic_auth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "reaction" ], "properties": { "reaction": { "type": "string", "description": "Reaction to add" } } } } } }, "parameters": [ { "name": "apiVersion", "in": "path", "required": true, "schema": { "type": "string", "enum": [ "v1" ], "default": "v1" } }, { "name": "token", "in": "path", "description": "Conversation token", "required": true, "schema": { "type": "string", "pattern": "^[a-z0-9]{4,30}$" } }, { "name": "messageId", "in": "path", "description": "ID of the message", "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": "Reaction already exists", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "nullable": true } } } } } } } }, "201": { "description": "Reacted successfully", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "nullable": true } } } } } } } }, "400": { "description": "Reacting 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": { "nullable": true } } } } } } } }, "401": { "description": "Reacting 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": { "nullable": true } } } } } } } }, "404": { "description": "Reaction not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "nullable": true } } } } } } } } } }, "delete": { "operationId": "bot-delete-reaction", "summary": "Deletes a reaction from a chat message", "tags": [ "bot" ], "security": [ {}, { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "apiVersion", "in": "path", "required": true, "schema": { "type": "string", "enum": [ "v1" ], "default": "v1" } }, { "name": "token", "in": "path", "description": "Conversation token", "required": true, "schema": { "type": "string", "pattern": "^[a-z0-9]{4,30}$" } }, { "name": "messageId", "in": "path", "description": "ID of the message", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "reaction", "in": "query", "description": "Reaction to delete", "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": "Reaction deleted successfully", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "nullable": true } } } } } } } }, "400": { "description": "Reacting 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": { "nullable": true } } } } } } } }, "404": { "description": "Reaction not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "nullable": true } } } } } } } }, "401": { "description": "Reacting 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": { "nullable": true } } } } } } } } } } } }, "tags": [] }