From a067eecd5fdf414d7dded90afd84a472e6cb91a5 Mon Sep 17 00:00:00 2001 From: Chen Asraf Date: Mon, 26 Jan 2026 12:28:14 +0200 Subject: [PATCH] chore: openapi json formatting --- .prettierignore | 1 + openapi-administration.json | 872 +- openapi-full.json | 20098 ++++++++++++++++++---------------- 3 files changed, 11153 insertions(+), 9818 deletions(-) diff --git a/.prettierignore b/.prettierignore index 40baa51..5bf6a69 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,2 +1,3 @@ templates/ gen/ +openapi*.json diff --git a/openapi-administration.json b/openapi-administration.json index 87ffc2b..e935e51 100644 --- a/openapi-administration.json +++ b/openapi-administration.json @@ -1,414 +1,478 @@ { - "openapi": "3.0.3", - "info": { - "title": "forum-administration", - "version": "0.0.1", - "description": "A community-driven forum built right into your Nextcloud instance", - "license": { - "name": "agpl" - } - }, - "components": { - "securitySchemes": { - "basic_auth": { - "type": "http", - "scheme": "basic" - }, - "bearer_auth": { - "type": "http", - "scheme": "bearer" - } - }, - "schemas": { - "OCSMeta": { - "type": "object", - "required": ["status", "statuscode"], - "properties": { - "status": { - "type": "string" - }, - "statuscode": { - "type": "integer" - }, - "message": { - "type": "string" - }, - "totalitems": { - "type": "string" - }, - "itemsperpage": { - "type": "string" - } + "openapi": "3.0.3", + "info": { + "title": "forum-administration", + "version": "0.0.1", + "description": "A community-driven forum built right into your Nextcloud instance", + "license": { + "name": "agpl" } - } - } - }, - "paths": { - "/ocs/v2.php/apps/forum/api/admin/repair-seeds": { - "post": { - "operationId": "admin-repair-seeds", - "summary": "Run the repair seeds command to restore default forum data", - "description": "This endpoint requires admin access", - "tags": ["admin"], - "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": "Seeds repaired 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": ["success", "message"], - "properties": { - "success": { - "type": "boolean" - }, - "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": {} - } - } - } - } - } - } - }, - "403": { - "description": "Logged in account must be an admin", - "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/forum/api/admin/roles": { - "get": { - "operationId": "admin-get-roles", - "summary": "Get all available roles", - "description": "This endpoint requires admin access", - "tags": ["admin"], - "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 + "components": { + "securitySchemes": { + "basic_auth": { + "type": "http", + "scheme": "basic" + }, + "bearer_auth": { + "type": "http", + "scheme": "bearer" } - } - ], - "responses": { - "200": { - "description": "Roles list 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": ["roles"], - "properties": { - "roles": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - } - } - } - }, - "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": {} - } - } - } - } - } - } - }, - "403": { - "description": "Logged in account must be an admin", - "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/forum/api/admin/users/{userId}/roles": { - "post": { - "operationId": "admin-assign-role", - "summary": "Assign a role to a user", - "description": "This endpoint requires admin access", - "tags": ["admin"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["roleId"], - "properties": { - "roleId": { - "type": "integer", - "format": "int64", - "description": "The role ID to assign" - } - } - } - } - } }, - "parameters": [ - { - "name": "userId", - "in": "path", - "description": "The user ID", - "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": "Role assigned 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": ["success", "message"], - "properties": { - "success": { - "type": "boolean" - }, - "message": { - "type": "string" - } - } - } - } + "schemas": { + "OCSMeta": { + "type": "object", + "required": [ + "status", + "statuscode" + ], + "properties": { + "status": { + "type": "string" + }, + "statuscode": { + "type": "integer" + }, + "message": { + "type": "string" + }, + "totalitems": { + "type": "string" + }, + "itemsperpage": { + "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": {} - } - } - } - } - } - } - }, - "403": { - "description": "Logged in account must be an admin", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["ocs"], - "properties": { - "ocs": { - "type": "object", - "required": ["meta", "data"], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": {} - } - } - } - } - } - } - } } - } - } - }, - "tags": [ - { - "name": "forum_user", - "description": "Controller for forum users Note: Forum users are automatically created on first post/thread" - } - ] + }, + "paths": { + "/ocs/v2.php/apps/forum/api/admin/repair-seeds": { + "post": { + "operationId": "admin-repair-seeds", + "summary": "Run the repair seeds command to restore default forum data", + "description": "This endpoint requires admin access", + "tags": [ + "admin" + ], + "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": "Seeds repaired 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": [ + "success", + "message" + ], + "properties": { + "success": { + "type": "boolean" + }, + "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": {} + } + } + } + } + } + } + }, + "403": { + "description": "Logged in account must be an admin", + "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/forum/api/admin/roles": { + "get": { + "operationId": "admin-get-roles", + "summary": "Get all available roles", + "description": "This endpoint requires admin access", + "tags": [ + "admin" + ], + "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": "Roles list 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": [ + "roles" + ], + "properties": { + "roles": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + } + } + } + }, + "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": {} + } + } + } + } + } + } + }, + "403": { + "description": "Logged in account must be an admin", + "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/forum/api/admin/users/{userId}/roles": { + "post": { + "operationId": "admin-assign-role", + "summary": "Assign a role to a user", + "description": "This endpoint requires admin access", + "tags": [ + "admin" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "roleId" + ], + "properties": { + "roleId": { + "type": "integer", + "format": "int64", + "description": "The role ID to assign" + } + } + } + } + } + }, + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "The user ID", + "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": "Role assigned 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": [ + "success", + "message" + ], + "properties": { + "success": { + "type": "boolean" + }, + "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": {} + } + } + } + } + } + } + }, + "403": { + "description": "Logged in account must be an admin", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": {} + } + } + } + } + } + } + } + } + } + } + }, + "tags": [ + { + "name": "forum_user", + "description": "Controller for forum users Note: Forum users are automatically created on first post/thread" + } + ] } diff --git a/openapi-full.json b/openapi-full.json index 97fdcda..3c5b303 100644 --- a/openapi-full.json +++ b/openapi-full.json @@ -1,9463 +1,10733 @@ { - "openapi": "3.0.3", - "info": { - "title": "forum-full", - "version": "0.0.1", - "description": "A community-driven forum built right into your Nextcloud instance", - "license": { - "name": "agpl" - } - }, - "components": { - "securitySchemes": { - "basic_auth": { - "type": "http", - "scheme": "basic" - }, - "bearer_auth": { - "type": "http", - "scheme": "bearer" - } + "openapi": "3.0.3", + "info": { + "title": "forum-full", + "version": "0.0.1", + "description": "A community-driven forum built right into your Nextcloud instance", + "license": { + "name": "agpl" + } }, - "schemas": { - "OCSMeta": { - "type": "object", - "required": ["status", "statuscode"], - "properties": { - "status": { - "type": "string" - }, - "statuscode": { - "type": "integer" - }, - "message": { - "type": "string" - }, - "totalitems": { - "type": "string" - }, - "itemsperpage": { - "type": "string" - } - } - } - } - }, - "paths": { - "/ocs/v2.php/apps/forum/api/admin/dashboard": { - "get": { - "operationId": "admin-dashboard", - "summary": "Get dashboard statistics", - "tags": ["admin"], - "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 + "components": { + "securitySchemes": { + "basic_auth": { + "type": "http", + "scheme": "basic" + }, + "bearer_auth": { + "type": "http", + "scheme": "bearer" } - } - ], - "responses": { - "200": { - "description": "Dashboard stats 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", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - }, - "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/forum/api/admin/users": { - "get": { - "operationId": "admin-users", - "summary": "Get all forum users with their roles", - "tags": ["admin"], - "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": "Users list 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": ["users"], - "properties": { - "users": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - } - } - } - }, - "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/forum/api/admin/settings": { - "get": { - "operationId": "admin-get-settings", - "summary": "Get general forum settings", - "tags": ["admin"], - "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": "Settings 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", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - }, - "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": {} - } - } - } - } - } - } - } - } - }, - "put": { - "operationId": "admin-update-settings", - "summary": "Update general forum settings", - "tags": ["admin"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "requestBody": { - "required": false, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "title": { - "type": "string", - "nullable": true, - "default": null, - "description": "Forum title" - }, - "subtitle": { - "type": "string", - "nullable": true, - "default": null, - "description": "Forum subtitle" - }, - "allow_guest_access": { - "type": "boolean", - "nullable": true, - "default": null, - "description": "Allow unauthenticated users to view forum content" - } - } - } - } - } }, - "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": "Settings updated", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["ocs"], - "properties": { - "ocs": { - "type": "object", - "required": ["meta", "data"], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - }, - "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/forum/api/admin/users/{userId}/roles/{roleId}": { - "delete": { - "operationId": "admin-remove-role", - "summary": "Remove a role from a user", - "tags": ["admin"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "userId", - "in": "path", - "description": "The user ID", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "roleId", - "in": "path", - "description": "The role ID to remove", - "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": "Role removed 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": ["success", "message"], - "properties": { - "success": { - "type": "boolean" - }, - "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/forum/api/bbcodes": { - "get": { - "operationId": "bb_code-index", - "summary": "Get all BBCodes (excludes builtin codes)", - "tags": ["bb_code"], - "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": "BBCodes returned", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["ocs"], - "properties": { - "ocs": { - "type": "object", - "required": ["meta", "data"], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - } - }, - "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": "bb_code-create", - "summary": "Create a new BBCode", - "tags": ["bb_code"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { + "schemas": { + "OCSMeta": { "type": "object", - "required": ["tag", "replacement", "example"], + "required": [ + "status", + "statuscode" + ], "properties": { - "tag": { - "type": "string", - "description": "BBCode tag name" - }, - "replacement": { - "type": "string", - "description": "Replacement pattern" - }, - "example": { - "type": "string", - "description": "Example usage" - }, - "description": { - "type": "string", - "nullable": true, - "default": null, - "description": "Optional description" - }, - "enabled": { - "type": "boolean", - "default": true, - "description": "Whether BBCode is enabled" - }, - "parseInner": { - "type": "boolean", - "default": true, - "description": "Whether to parse inner BBCode tags" - } - } - } - } - } - }, - "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": { - "201": { - "description": "BBCode 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", - "additionalProperties": { - "type": "object" - } - } - } + "status": { + "type": "string" + }, + "statuscode": { + "type": "integer" + }, + "message": { + "type": "string" + }, + "totalitems": { + "type": "string" + }, + "itemsperpage": { + "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/forum/api/bbcodes/enabled": { - "get": { - "operationId": "bb_code-enabled", - "summary": "Get enabled BBCodes", - "tags": ["bb_code"], - "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": "Enabled BBCodes returned", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["ocs"], - "properties": { - "ocs": { - "type": "object", - "required": ["meta", "data"], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } + "paths": { + "/ocs/v2.php/apps/forum/api/admin/dashboard": { + "get": { + "operationId": "admin-dashboard", + "summary": "Get dashboard statistics", + "tags": [ + "admin" + ], + "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 } - } } - } - } - } - } - }, - "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/forum/api/bbcodes/builtin": { - "get": { - "operationId": "bb_code-builtin", - "summary": "Get builtin BBCodes (for help dialog)", - "tags": ["bb_code"], - "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": "Builtin BBCodes returned", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["ocs"], - "properties": { - "ocs": { - "type": "object", - "required": ["meta", "data"], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - } - }, - "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/forum/api/bbcodes/{id}": { - "get": { - "operationId": "bb_code-show", - "summary": "Get a single BBCode", - "tags": ["bb_code"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "BBCode 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": "BBCode 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", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - }, - "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": {} - } - } - } - } - } - } - } - } - }, - "put": { - "operationId": "bb_code-update", - "summary": "Update a BBCode", - "tags": ["bb_code"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "requestBody": { - "required": false, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "tag": { - "type": "string", - "nullable": true, - "default": null, - "description": "BBCode tag name" - }, - "replacement": { - "type": "string", - "nullable": true, - "default": null, - "description": "Replacement pattern" - }, - "example": { - "type": "string", - "nullable": true, - "default": null, - "description": "Example usage" - }, - "description": { - "type": "string", - "nullable": true, - "default": null, - "description": "Description" - }, - "enabled": { - "type": "boolean", - "nullable": true, - "default": null, - "description": "Whether BBCode is enabled" - }, - "parseInner": { - "type": "boolean", - "nullable": true, - "default": null, - "description": "Whether to parse inner BBCode tags" - } - } - } - } - } - }, - "parameters": [ - { - "name": "id", - "in": "path", - "description": "BBCode 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": "BBCode updated", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["ocs"], - "properties": { - "ocs": { - "type": "object", - "required": ["meta", "data"], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - }, - "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": "bb_code-destroy", - "summary": "Delete a BBCode", - "tags": ["bb_code"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "BBCode 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": "BBCode 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": ["success"], - "properties": { - "success": { - "type": "boolean" - } - } - } - } - } - } - } - } - } - }, - "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/forum/api/threads/{threadId}/bookmark": { - "post": { - "operationId": "bookmark-bookmark-thread", - "summary": "Add a bookmark for a thread", - "tags": ["bookmark"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "threadId", - "in": "path", - "description": "Thread 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": "Thread bookmarked", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["ocs"], - "properties": { - "ocs": { - "type": "object", - "required": ["meta", "data"], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - }, - "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": "bookmark-unbookmark-thread", - "summary": "Remove a bookmark from a thread", - "tags": ["bookmark"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "threadId", - "in": "path", - "description": "Thread 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": "Bookmark removed", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["ocs"], - "properties": { - "ocs": { - "type": "object", - "required": ["meta", "data"], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - }, - "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": "bookmark-is-thread-bookmarked", - "summary": "Check if current user has bookmarked a thread", - "tags": ["bookmark"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "threadId", - "in": "path", - "description": "Thread 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": "Bookmark status 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", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - }, - "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/forum/api/bookmarks": { - "get": { - "operationId": "bookmark-index", - "summary": "Get all bookmarked threads for the current user (paginated) Includes read marker information for unread status", - "tags": ["bookmark"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "page", - "in": "query", - "description": "Page number (1-indexed)", - "schema": { - "type": "integer", - "format": "int64", - "default": 1 - } - }, - { - "name": "perPage", - "in": "query", - "description": "Number of threads per page", - "schema": { - "type": "integer", - "format": "int64", - "default": 20 - } - }, - { - "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": "Bookmarked threads returned with pagination and read markers", - "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": ["threads", "pagination", "readMarkers"], - "properties": { - "threads": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "type": "object" + ], + "responses": { + "200": { + "description": "Dashboard stats 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", + "additionalProperties": { + "type": "object" + } + } + } + } + } } - } - }, - "pagination": { - "type": "object", - "required": ["page", "perPage", "total", "totalPages"], - "properties": { - "page": { - "type": "integer", - "format": "int64" - }, - "perPage": { - "type": "integer", - "format": "int64" - }, - "total": { - "type": "integer", - "format": "int64" - }, - "totalPages": { - "type": "integer", - "format": "int64" + } + } + }, + "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": {} + } + } + } } - } - }, - "readMarkers": { - "type": "object", - "additionalProperties": { + } + } + } + } + } + }, + "/ocs/v2.php/apps/forum/api/admin/users": { + "get": { + "operationId": "admin-users", + "summary": "Get all forum users with their roles", + "tags": [ + "admin" + ], + "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": "Users list 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": [ + "users" + ], + "properties": { + "users": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + } + } + } + }, + "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/forum/api/admin/settings": { + "get": { + "operationId": "admin-get-settings", + "summary": "Get general forum settings", + "tags": [ + "admin" + ], + "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": "Settings 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", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "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": {} + } + } + } + } + } + } + } + } + }, + "put": { + "operationId": "admin-update-settings", + "summary": "Update general forum settings", + "tags": [ + "admin" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "requestBody": { + "required": false, + "content": { + "application/json": { + "schema": { "type": "object", - "required": ["threadId", "lastReadPostId", "readAt"], "properties": { - "threadId": { - "type": "integer", - "format": "int64" - }, - "lastReadPostId": { - "type": "integer", - "format": "int64" - }, - "readAt": { - "type": "integer", - "format": "int64" - } + "title": { + "type": "string", + "nullable": true, + "default": null, + "description": "Forum title" + }, + "subtitle": { + "type": "string", + "nullable": true, + "default": null, + "description": "Forum subtitle" + }, + "allow_guest_access": { + "type": "boolean", + "nullable": true, + "default": null, + "description": "Allow unauthenticated users to view forum content" + } } - } } - } } - } } - } - } - } - } - }, - "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/forum/api/headers": { - "get": { - "operationId": "cat_header-index", - "summary": "Get all category headers", - "tags": ["cat_header"], - "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": "Category headers returned", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["ocs"], - "properties": { - "ocs": { - "type": "object", - "required": ["meta", "data"], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - } - } - } - }, - "post": { - "operationId": "cat_header-create", - "summary": "Create a new category header", - "tags": ["cat_header"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["name"], - "properties": { - "name": { - "type": "string", - "description": "Category header name" - }, - "description": { - "type": "string", - "nullable": true, - "default": null, - "description": "Category header description" - }, - "sortOrder": { - "type": "integer", - "format": "int64", - "default": 0, - "description": "Sort order" - } - } - } - } - } - }, - "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": { - "201": { - "description": "Category header 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", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - }, - "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/forum/api/headers/{id}": { - "get": { - "operationId": "cat_header-show", - "summary": "Get a single category header", - "tags": ["cat_header"], - "security": [ - {}, - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "Category header 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": "Category header 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", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - } - } - }, - "put": { - "operationId": "cat_header-update", - "summary": "Update a category header", - "tags": ["cat_header"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "requestBody": { - "required": false, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "name": { - "type": "string", - "nullable": true, - "default": null, - "description": "Category header name" - }, - "description": { - "type": "string", - "nullable": true, - "default": null, - "description": "Category header description" - }, - "sortOrder": { - "type": "integer", - "format": "int64", - "nullable": true, - "default": null, - "description": "Sort order" - } - } - } - } - } - }, - "parameters": [ - { - "name": "id", - "in": "path", - "description": "Category header 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": "Category header updated", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["ocs"], - "properties": { - "ocs": { - "type": "object", - "required": ["meta", "data"], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - }, - "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": "cat_header-destroy", - "summary": "Delete a category header", - "tags": ["cat_header"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "Category header ID", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "migrateToHeaderId", - "in": "query", - "description": "Header ID to migrate categories to (null to delete categories)", - "schema": { - "type": "integer", - "format": "int64", - "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": "Category header 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": ["success"], - "properties": { - "success": { - "type": "boolean" - }, - "categoriesAffected": { - "type": "integer", - "format": "int64" - } - } - } - } - } - } - } - } - } - }, - "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/forum/api/headers/reorder": { - "post": { - "operationId": "cat_header-reorder", - "summary": "Reorder category headers", - "tags": ["cat_header"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["headers"], - "properties": { - "headers": { - "type": "array", - "description": "Array of headers with new sort orders", - "items": { - "type": "object", - "required": ["id", "sortOrder"], - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "sortOrder": { - "type": "integer", - "format": "int64" - } - } - } - } - } - } - } - } - }, - "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": "Headers reordered 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": ["success"], - "properties": { - "success": { - "type": "boolean" - } - } - } - } - } - } - } - } - } - }, - "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/forum/api/categories": { - "get": { - "operationId": "category-index", - "summary": "Get all category headers with nested categories", - "tags": ["category"], - "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": "Category headers with nested categories returned", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["ocs"], - "properties": { - "ocs": { - "type": "object", - "required": ["meta", "data"], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - } - } - } - }, - "post": { - "operationId": "category-create", - "summary": "Create a new category", - "tags": ["category"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["headerId", "name", "slug"], - "properties": { - "headerId": { - "type": "integer", - "format": "int64", - "description": "Category header ID" - }, - "name": { - "type": "string", - "description": "Category name" - }, - "slug": { - "type": "string", - "description": "Category slug" - }, - "description": { - "type": "string", - "nullable": true, - "default": null, - "description": "Category description" - }, - "sortOrder": { - "type": "integer", - "format": "int64", - "default": 0, - "description": "Sort order" - } - } - } - } - } - }, - "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": { - "201": { - "description": "Category 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", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - }, - "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/forum/api/headers/{headerId}/categories": { - "get": { - "operationId": "category-by-header", - "summary": "Get categories by header ID", - "tags": ["category"], - "security": [ - {}, - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "headerId", - "in": "path", - "description": "Category header 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": "Categories returned", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["ocs"], - "properties": { - "ocs": { - "type": "object", - "required": ["meta", "data"], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - } - } - } - } - }, - "/ocs/v2.php/apps/forum/api/categories/{id}": { - "get": { - "operationId": "category-show", - "summary": "Get a single category", - "tags": ["category"], - "security": [ - {}, - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "Category 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": "Category 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", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - } - } - }, - "put": { - "operationId": "category-update", - "summary": "Update a category", - "tags": ["category"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "requestBody": { - "required": false, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "headerId": { - "type": "integer", - "format": "int64", - "nullable": true, - "default": null, - "description": "Category header ID" - }, - "name": { - "type": "string", - "nullable": true, - "default": null, - "description": "Category name" - }, - "description": { - "type": "string", - "nullable": true, - "default": null, - "description": "Category description" - }, - "slug": { - "type": "string", - "nullable": true, - "default": null, - "description": "Category slug" - }, - "sortOrder": { - "type": "integer", - "format": "int64", - "nullable": true, - "default": null, - "description": "Sort order" - } - } - } - } - } - }, - "parameters": [ - { - "name": "id", - "in": "path", - "description": "Category 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": "Category updated", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["ocs"], - "properties": { - "ocs": { - "type": "object", - "required": ["meta", "data"], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - }, - "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": "category-destroy", - "summary": "Delete a category", - "tags": ["category"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "Category ID", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "migrateToCategoryId", - "in": "query", - "description": "Category ID to migrate threads to (null to soft-delete threads)", - "schema": { - "type": "integer", - "format": "int64", - "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": "Category 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": ["success"], - "properties": { - "success": { - "type": "boolean" - }, - "threadsAffected": { - "type": "integer", - "format": "int64" - } - } - } - } - } - } - } - } - } - }, - "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/forum/api/categories/slug/{slug}": { - "get": { - "operationId": "category-by-slug", - "summary": "Get a category by slug", - "tags": ["category"], - "security": [ - {}, - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "slug", - "in": "path", - "description": "Category slug", - "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": "Category 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", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - } - } - } - }, - "/ocs/v2.php/apps/forum/api/categories/{id}/thread-count": { - "get": { - "operationId": "category-get-thread-count", - "summary": "Get thread count for a category", - "tags": ["category"], - "security": [ - {}, - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "Category 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": "Thread count 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": ["count"], - "properties": { - "count": { - "type": "integer", - "format": "int64" - } - } - } - } - } - } - } - } - } - } - } - } - }, - "/ocs/v2.php/apps/forum/api/categories/{id}/permissions/{permission}": { - "get": { - "operationId": "category-check-permission", - "summary": "Check if current user has a specific permission on a category", - "tags": ["category"], - "security": [ - {}, - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "Category ID", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "permission", - "in": "path", - "description": "Permission name (canView, canPost, canReply, canModerate)", - "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": "Permission check result", - "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": ["hasPermission"], - "properties": { - "hasPermission": { - "type": "boolean" - } - } - } - } - } - } - } - } - } - } - } - } - }, - "/ocs/v2.php/apps/forum/api/categories/{id}/permissions": { - "get": { - "operationId": "category-get-permissions", - "summary": "Get permissions for a category", - "tags": ["category"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "Category 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": "Permissions returned", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["ocs"], - "properties": { - "ocs": { - "type": "object", - "required": ["meta", "data"], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - } - }, - "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": "category-update-permissions", - "summary": "Update permissions for a category", - "tags": ["category"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["permissions"], - "properties": { - "permissions": { - "type": "array", - "description": "Permissions array", - "items": { - "type": "object", - "required": ["roleId", "canView", "canModerate"], - "properties": { - "roleId": { - "type": "integer", - "format": "int64" - }, - "canView": { - "type": "boolean" - }, - "canModerate": { - "type": "boolean" - } - } - } - } - } - } - } - } - }, - "parameters": [ - { - "name": "id", - "in": "path", - "description": "Category 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": "Permissions updated", - "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": ["success"], - "properties": { - "success": { - "type": "boolean" - } - } - } - } - } - } - } - } - } - }, - "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/forum/api/categories/reorder": { - "post": { - "operationId": "category-reorder", - "summary": "Reorder categories", - "tags": ["category"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["categories"], - "properties": { - "categories": { - "type": "array", - "description": "Array of categories with new sort orders", - "items": { - "type": "object", - "required": ["id", "sortOrder"], - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "sortOrder": { - "type": "integer", - "format": "int64" - } - } - } - } - } - } - } - } - }, - "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": "Categories reordered 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": ["success"], - "properties": { - "success": { - "type": "boolean" - } - } - } - } - } - } - } - } - } - }, - "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/forum/api/drafts/thread/{categoryId}": { - "get": { - "operationId": "draft-get-thread-draft", - "summary": "Get a thread draft for a category", - "tags": ["draft"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "categoryId", - "in": "path", - "description": "Category 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": "Draft found or null", - "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": ["draft"], - "properties": { - "draft": { - "type": "object", - "nullable": true, - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - } - } - }, - "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": {} - } - } - } - } - } - } - } - } - }, - "put": { - "operationId": "draft-save-thread-draft", - "summary": "Save (create or update) a thread draft for a category", - "tags": ["draft"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["content"], - "properties": { - "title": { - "type": "string", - "nullable": true, - "description": "Draft title (can be empty)" - }, - "content": { - "type": "string", - "description": "Draft content" - } - } - } - } - } - }, - "parameters": [ - { - "name": "categoryId", - "in": "path", - "description": "Category 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": "Draft 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": ["draft"], - "properties": { - "draft": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - } - } - }, - "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": "draft-delete-thread-draft", - "summary": "Delete a thread draft for a category", - "tags": ["draft"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "categoryId", - "in": "path", - "description": "Category 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": "Draft 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": ["success"], - "properties": { - "success": { - "type": "boolean" - } - } - } - } - } - } - } - } - } - }, - "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/forum/api/drafts/thread": { - "get": { - "operationId": "draft-list-thread-drafts", - "summary": "Get all thread drafts for the current user", - "tags": ["draft"], - "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": "List of drafts 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": ["drafts"], - "properties": { - "drafts": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - } - } - } - }, - "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/forum/api/users": { - "get": { - "operationId": "forum_user-index", - "summary": "Get all forum users", - "tags": ["forum_user"], - "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": "Forum users returned", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["ocs"], - "properties": { - "ocs": { - "type": "object", - "required": ["meta", "data"], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - } - } - } - }, - "post": { - "operationId": "forum_user-create", - "summary": "Create forum user Note: This is typically not needed as forum users are auto-created on first post", - "tags": ["forum_user"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["userId"], - "properties": { - "userId": { - "type": "string", - "description": "Nextcloud user ID" - } - } - } - } - } - }, - "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": { - "201": { - "description": "Forum user 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", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - }, - "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/forum/api/users/autocomplete": { - "get": { - "operationId": "forum_user-autocomplete", - "summary": "Search Nextcloud users for autocomplete Returns users matching the search query in the format expected by NcRichContenteditable Excludes the current user from results (users cannot mention themselves)", - "tags": ["forum_user"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "search", - "in": "query", - "description": "Search query (matches against user ID and display name)", - "schema": { - "type": "string", - "default": "" - } - }, - { - "name": "limit", - "in": "query", - "description": "Maximum number of results to return", - "schema": { - "type": "integer", - "format": "int64", - "default": 10 - } - }, - { - "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": "Users returned", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["ocs"], - "properties": { - "ocs": { - "type": "object", - "required": ["meta", "data"], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "required": ["id", "label", "icon", "source"], - "properties": { - "id": { - "type": "string" - }, - "label": { - "type": "string" - }, - "icon": { - "type": "string" - }, - "source": { - "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/forum/api/users/{userId}": { - "get": { - "operationId": "forum_user-show", - "summary": "Get forum user by Nextcloud user ID Special case: use \"me\" to get current forum user", - "tags": ["forum_user"], - "security": [ - {}, - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "userId", - "in": "path", - "description": "Nextcloud user ID or \"me\" for current user", - "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": "Forum user 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", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - }, - "404": { - "description": "Forum user not found (user has not posted yet) or guest user accessing \"me\"", - "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/forum/api/threads/{threadId}/posts": { - "get": { - "operationId": "post-by-thread", - "summary": "Get posts by thread", - "tags": ["post"], - "security": [ - {}, - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "threadId", - "in": "path", - "description": "Thread ID", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "limit", - "in": "query", - "description": "Maximum number of posts to return", - "schema": { - "type": "integer", - "format": "int64", - "default": 50 - } - }, - { - "name": "offset", - "in": "query", - "description": "Offset for pagination", - "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": "Posts returned", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["ocs"], - "properties": { - "ocs": { - "type": "object", - "required": ["meta", "data"], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - } - } - } - } - }, - "/ocs/v2.php/apps/forum/api/threads/{threadId}/posts/paginated": { - "get": { - "operationId": "post-by-thread-paginated", - "summary": "Get paginated posts by thread with first post separated", - "tags": ["post"], - "security": [ - {}, - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "threadId", - "in": "path", - "description": "Thread ID", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "page", - "in": "query", - "description": "Page number (1-indexed)", - "schema": { - "type": "integer", - "format": "int64", - "default": 0 - } - }, - { - "name": "perPage", - "in": "query", - "description": "Number of replies per page", - "schema": { - "type": "integer", - "format": "int64", - "default": 20 - } - }, - { - "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": "Posts returned with pagination metadata", - "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": ["firstPost", "replies", "pagination"], - "properties": { - "firstPost": { - "type": "object", - "nullable": true, - "additionalProperties": { - "type": "object" - } - }, - "replies": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - }, - "pagination": { - "type": "object", - "required": [ - "page", - "perPage", - "total", - "totalPages", - "startPage", - "lastReadPostId" - ], - "properties": { - "page": { - "type": "integer", - "format": "int64" - }, - "perPage": { - "type": "integer", - "format": "int64" - }, - "total": { - "type": "integer", - "format": "int64" - }, - "totalPages": { - "type": "integer", - "format": "int64" - }, - "startPage": { - "type": "integer", - "format": "int64" - }, - "lastReadPostId": { - "type": "integer", - "format": "int64", - "nullable": true - } - } - } - } - } - } - } - } - } - } - } - } - } - } - }, - "/ocs/v2.php/apps/forum/api/users/{authorId}/posts": { - "get": { - "operationId": "post-by-author", - "summary": "Get posts by author", - "tags": ["post"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "authorId", - "in": "path", - "description": "Author user ID", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "limit", - "in": "query", - "description": "Maximum number of posts to return", - "schema": { - "type": "integer", - "format": "int64", - "default": 50 - } - }, - { - "name": "offset", - "in": "query", - "description": "Offset for pagination", - "schema": { - "type": "integer", - "format": "int64", - "default": 0 - } - }, - { - "name": "excludeFirstPosts", - "in": "query", - "description": "Whether to exclude first posts (1 or 0)", - "schema": { - "type": "string", - "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": "Posts returned", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["ocs"], - "properties": { - "ocs": { - "type": "object", - "required": ["meta", "data"], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - } - }, - "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/forum/api/posts/{id}": { - "get": { - "operationId": "post-show", - "summary": "Get a single post", - "tags": ["post"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "Post 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": "Post 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", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - }, - "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": {} - } - } - } - } - } - } - } - } - }, - "put": { - "operationId": "post-update", - "summary": "Update a post", - "tags": ["post"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "requestBody": { - "required": false, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "content": { - "type": "string", - "nullable": true, - "default": null, - "description": "Post content" - } - } - } - } - } - }, - "parameters": [ - { - "name": "id", - "in": "path", - "description": "Post 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": "Post updated", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["ocs"], - "properties": { - "ocs": { - "type": "object", - "required": ["meta", "data"], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - }, - "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": "post-destroy", - "summary": "Delete a post (soft delete)", - "tags": ["post"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "Post 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": "Post 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": ["success"], - "properties": { - "success": { - "type": "boolean" - } - } - } - } - } - } - } - } - } - }, - "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/forum/api/posts": { - "post": { - "operationId": "post-create", - "summary": "Create a new post", - "tags": ["post"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["threadId", "content"], - "properties": { - "threadId": { - "type": "integer", - "format": "int64", - "description": "Thread ID" - }, - "content": { - "type": "string", - "description": "Post content" - } - } - } - } - } - }, - "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": { - "201": { - "description": "Post 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", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - }, - "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/forum/api/posts/{postId}/history": { - "get": { - "operationId": "post_history-get-history", - "summary": "Get edit history for a post", - "description": "Returns the current version of the post and all historical versions, ordered from newest to oldest.", - "tags": ["post_history"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "postId", - "in": "path", - "description": "Post 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": "Post history 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": ["current", "history"], - "properties": { - "current": { - "type": "object", - "additionalProperties": { - "type": "object" - } - }, - "history": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - } - } - } - }, - "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/forum/api/posts/{postId}/reactions": { - "get": { - "operationId": "reaction-by-post", - "summary": "Get reactions by post", - "tags": ["reaction"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "postId", - "in": "path", - "description": "Post 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": "Reactions returned", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["ocs"], - "properties": { - "ocs": { - "type": "object", - "required": ["meta", "data"], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - } - }, - "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/forum/api/reactions/by-posts": { - "post": { - "operationId": "reaction-by-posts", - "summary": "Get reactions for multiple posts (for performance)", - "tags": ["reaction"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["postIds"], - "properties": { - "postIds": { - "type": "array", - "description": "Array of post IDs", - "items": { - "type": "integer", - "format": "int64" - } - } - } - } - } - } - }, - "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": "Reactions returned", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["ocs"], - "properties": { - "ocs": { - "type": "object", - "required": ["meta", "data"], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - } - }, - "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/forum/api/reactions/{id}": { - "get": { - "operationId": "reaction-show", - "summary": "Get a single reaction", - "tags": ["reaction"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "Reaction 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": "Reaction 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", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - }, - "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": "reaction-destroy", - "summary": "Delete a reaction", - "tags": ["reaction"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "Reaction 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": "Reaction 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": ["success"], - "properties": { - "success": { - "type": "boolean" - } - } - } - } - } - } - } - } - } - }, - "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/forum/api/reactions": { - "post": { - "operationId": "reaction-create", - "summary": "Create a new reaction", - "tags": ["reaction"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["postId", "reactionType"], - "properties": { - "postId": { - "type": "integer", - "format": "int64", - "description": "Post ID" - }, - "reactionType": { - "type": "string", - "description": "Type of reaction" - } - } - } - } - } - }, - "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": { - "201": { - "description": "Reaction 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", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - }, - "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/forum/api/reactions/toggle": { - "post": { - "operationId": "reaction-toggle", - "summary": "Toggle a reaction (add if not exists, remove if exists)", - "tags": ["reaction"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["postId", "reactionType"], - "properties": { - "postId": { - "type": "integer", - "format": "int64", - "description": "Post ID" - }, - "reactionType": { - "type": "string", - "description": "Type of reaction (emoji)" - } - } - } - } - } - }, - "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": "Reaction toggled", - "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" - }, - "reaction": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - } - } - }, - "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/forum/api/read-markers": { - "get": { - "operationId": "read_marker-index", - "summary": "Get read markers for multiple threads", - "tags": ["read_marker"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "threadIds", - "in": "query", - "description": "Array of thread IDs (comma-separated in query string)", - "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": "Read markers returned (keyed by thread ID)", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["ocs"], - "properties": { - "ocs": { - "type": "object", - "required": ["meta", "data"], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "additionalProperties": { - "type": "object", - "required": ["threadId", "lastReadPostId", "readAt"], - "properties": { - "threadId": { - "type": "integer", - "format": "int64" - }, - "lastReadPostId": { - "type": "integer", - "format": "int64" - }, - "readAt": { - "type": "integer", - "format": "int64" - } - } - } - } - } - } - } - } - } - } - }, - "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": "read_marker-create", - "summary": "Mark a thread as read", - "tags": ["read_marker"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["threadId", "lastReadPostId"], - "properties": { - "threadId": { - "type": "integer", - "format": "int64", - "description": "Thread ID" - }, - "lastReadPostId": { - "type": "integer", - "format": "int64", - "description": "Last read post ID" - } - } - } - } - } - }, - "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": "Thread marked as read", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["ocs"], - "properties": { - "ocs": { - "type": "object", - "required": ["meta", "data"], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - }, - "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/forum/api/threads/{threadId}/read-marker": { - "get": { - "operationId": "read_marker-show", - "summary": "Get read marker for a specific thread", - "tags": ["read_marker"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "threadId", - "in": "path", - "description": "Thread 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": "Read marker 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", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - }, - "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/forum/api/read-markers/{id}": { - "delete": { - "operationId": "read_marker-destroy", - "summary": "Delete a read marker", - "tags": ["read_marker"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "Read marker 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": "Read marker 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": ["success"], - "properties": { - "success": { - "type": "boolean" - } - } - } - } - } - } - } - } - } - }, - "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/forum/api/roles": { - "get": { - "operationId": "role-index", - "summary": "Get all roles", - "tags": ["role"], - "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": "Roles returned", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["ocs"], - "properties": { - "ocs": { - "type": "object", - "required": ["meta", "data"], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - } - }, - "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": "role-create", - "summary": "Create a new role", - "tags": ["role"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["name"], - "properties": { - "name": { - "type": "string", - "description": "Role name" - }, - "description": { - "type": "string", - "nullable": true, - "default": null, - "description": "Role description" - }, - "colorLight": { - "type": "string", - "nullable": true, - "default": null, - "description": "Light mode color" - }, - "colorDark": { - "type": "string", - "nullable": true, - "default": null, - "description": "Dark mode color" - }, - "canAccessAdminTools": { - "type": "boolean", - "default": false, - "description": "Can access admin tools" - }, - "canEditRoles": { - "type": "boolean", - "default": false, - "description": "Can edit roles" - }, - "canEditCategories": { - "type": "boolean", - "default": false, - "description": "Can edit categories" - } - } - } - } - } - }, - "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": { - "201": { - "description": "Role 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", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - }, - "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/forum/api/roles/{id}": { - "get": { - "operationId": "role-show", - "summary": "Get a single role", - "tags": ["role"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "Role 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": "Role 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", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - }, - "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": {} - } - } - } - } - } - } - } - } - }, - "put": { - "operationId": "role-update", - "summary": "Update a role", - "tags": ["role"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "requestBody": { - "required": false, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "name": { - "type": "string", - "nullable": true, - "default": null, - "description": "Role name" - }, - "description": { - "type": "string", - "nullable": true, - "default": null, - "description": "Role description" - }, - "colorLight": { - "type": "string", - "nullable": true, - "default": null, - "description": "Light mode color" - }, - "colorDark": { - "type": "string", - "nullable": true, - "default": null, - "description": "Dark mode color" - }, - "canAccessAdminTools": { - "type": "boolean", - "nullable": true, - "default": null, - "description": "Can access admin tools" - }, - "canEditRoles": { - "type": "boolean", - "nullable": true, - "default": null, - "description": "Can edit roles" - }, - "canEditCategories": { - "type": "boolean", - "nullable": true, - "default": null, - "description": "Can edit categories" - } - } - } - } - } - }, - "parameters": [ - { - "name": "id", - "in": "path", - "description": "Role 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": "Role updated", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["ocs"], - "properties": { - "ocs": { - "type": "object", - "required": ["meta", "data"], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - }, - "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": "role-destroy", - "summary": "Delete a role", - "tags": ["role"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "Role 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": "Role 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": ["success"], - "properties": { - "success": { - "type": "boolean" - } - } - } - } - } - } - } - } - } - }, - "403": { - "description": "Cannot delete system roles", - "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/forum/api/roles/{id}/permissions": { - "get": { - "operationId": "role-get-permissions", - "summary": "Get permissions for a role", - "tags": ["role"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "Role 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": "Permissions returned", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["ocs"], - "properties": { - "ocs": { - "type": "object", - "required": ["meta", "data"], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - } - }, - "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": "role-update-permissions", - "summary": "Update permissions for a role", - "tags": ["role"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["permissions"], - "properties": { - "permissions": { - "type": "array", - "description": "Permissions array", - "items": { - "type": "object", - "required": ["categoryId", "canView", "canModerate"], - "properties": { - "categoryId": { - "type": "integer", - "format": "int64" - }, - "canView": { - "type": "boolean" - }, - "canModerate": { - "type": "boolean" - } - } - } - } - } - } - } - } - }, - "parameters": [ - { - "name": "id", - "in": "path", - "description": "Role 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": "Permissions updated", - "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": ["success"], - "properties": { - "success": { - "type": "boolean" - } - } - } - } - } - } - } - } - } - }, - "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/forum/api/search": { - "get": { - "operationId": "search-index", - "summary": "Search forum threads and posts", - "tags": ["search"], - "security": [ - {}, - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "q", - "in": "query", - "description": "Search query (supports quoted phrases, AND/OR operators, parentheses, -exclusions)", - "schema": { - "type": "string", - "default": "" - } - }, - { - "name": "searchThreads", - "in": "query", - "description": "Include threads in search (title + first post content)", - "schema": { - "type": "boolean", - "default": true - } - }, - { - "name": "searchPosts", - "in": "query", - "description": "Include reply posts in search", - "schema": { - "type": "boolean", - "default": true - } - }, - { - "name": "categoryId", - "in": "query", - "description": "Optional category ID filter", - "schema": { - "type": "integer", - "format": "int64", - "nullable": true, - "default": null - } - }, - { - "name": "limit", - "in": "query", - "description": "Maximum results per type", - "schema": { - "type": "integer", - "format": "int64", - "default": 50 - } - }, - { - "name": "offset", - "in": "query", - "description": "Results offset per type", - "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": "Search results 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": ["threads", "posts", "threadCount", "postCount", "query"], - "properties": { - "threads": { - "type": "object", - "additionalProperties": { - "type": "object" - } - }, - "posts": { - "type": "object", - "additionalProperties": { - "type": "object" - } - }, - "threadCount": { - "type": "integer", - "format": "int64" - }, - "postCount": { - "type": "integer", - "format": "int64" - }, - "query": { - "type": "string" - } - } - } - } - } - } - } - } - } - } - } - } - }, - "/ocs/v2.php/apps/forum/api/settings": { - "get": { - "operationId": "settings-get-public-settings", - "summary": "Get public forum settings (title, subtitle, and guest access)", - "description": "This endpoint is publicly accessible to all users. For admin-only settings, use AdminController::getSettings()", - "tags": ["settings"], - "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": "Settings 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": ["title", "subtitle", "allow_guest_access"], - "properties": { - "title": { - "type": "string" - }, - "subtitle": { - "type": "string" - }, - "allow_guest_access": { - "type": "boolean" - } - } - } - } - } - } - } - } - } - } - } - } - }, - "/ocs/v2.php/apps/forum/api/threads": { - "get": { - "operationId": "thread-index", - "summary": "Get all threads", - "tags": ["thread"], - "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": "Threads returned", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["ocs"], - "properties": { - "ocs": { - "type": "object", - "required": ["meta", "data"], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - } - } - } - }, - "post": { - "operationId": "thread-create", - "summary": "Create a new thread with initial post", - "tags": ["thread"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["categoryId", "title", "content"], - "properties": { - "categoryId": { - "type": "integer", - "format": "int64", - "description": "Category ID" - }, - "title": { - "type": "string", - "description": "Thread title" - }, - "content": { - "type": "string", - "description": "Initial post content" - } - } - } - } - } - }, - "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": { - "201": { - "description": "Thread 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", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - }, - "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/forum/api/categories/{categoryId}/threads": { - "get": { - "operationId": "thread-by-category", - "summary": "Get threads by category", - "tags": ["thread"], - "security": [ - {}, - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "categoryId", - "in": "path", - "description": "Category ID", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "limit", - "in": "query", - "description": "Maximum number of threads to return", - "schema": { - "type": "integer", - "format": "int64", - "default": 50 - } - }, - { - "name": "offset", - "in": "query", - "description": "Offset for pagination", - "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": "Threads returned", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["ocs"], - "properties": { - "ocs": { - "type": "object", - "required": ["meta", "data"], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - } - } - } - } - }, - "/ocs/v2.php/apps/forum/api/categories/{categoryId}/threads/paginated": { - "get": { - "operationId": "thread-by-category-paginated", - "summary": "Get paginated threads by category", - "tags": ["thread"], - "security": [ - {}, - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "categoryId", - "in": "path", - "description": "Category ID", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "page", - "in": "query", - "description": "Page number (1-indexed)", - "schema": { - "type": "integer", - "format": "int64", - "default": 1 - } - }, - { - "name": "perPage", - "in": "query", - "description": "Number of threads per page", - "schema": { - "type": "integer", - "format": "int64", - "default": 20 - } - }, - { - "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": "Threads returned with pagination metadata", - "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": ["threads", "pagination"], - "properties": { - "threads": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - }, - "pagination": { - "type": "object", - "required": ["page", "perPage", "total", "totalPages"], - "properties": { - "page": { - "type": "integer", - "format": "int64" - }, - "perPage": { - "type": "integer", - "format": "int64" - }, - "total": { - "type": "integer", - "format": "int64" - }, - "totalPages": { - "type": "integer", - "format": "int64" - } - } - } - } - } - } - } - } - } - } - } - } - } - } - }, - "/ocs/v2.php/apps/forum/api/users/{authorId}/threads": { - "get": { - "operationId": "thread-by-author", - "summary": "Get threads by author", - "tags": ["thread"], - "security": [ - {}, - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "authorId", - "in": "path", - "description": "Author user ID", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "limit", - "in": "query", - "description": "Maximum number of threads to return", - "schema": { - "type": "integer", - "format": "int64", - "default": 50 - } - }, - { - "name": "offset", - "in": "query", - "description": "Offset for pagination", - "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": "Threads returned", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["ocs"], - "properties": { - "ocs": { - "type": "object", - "required": ["meta", "data"], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - } - } - } - } - }, - "/ocs/v2.php/apps/forum/api/threads/{id}": { - "get": { - "operationId": "thread-show", - "summary": "Get a single thread", - "tags": ["thread"], - "security": [ - {}, - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "Thread ID", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "incrementView", - "in": "query", - "description": "Whether to increment view count (1 or 0)", - "schema": { - "type": "string", - "default": "1" - } - }, - { - "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": "Thread 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", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - } - } - }, - "put": { - "operationId": "thread-update", - "summary": "Update a thread", - "tags": ["thread"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "requestBody": { - "required": false, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "title": { - "type": "string", - "nullable": true, - "default": null, - "description": "Thread title" - }, - "isLocked": { - "type": "boolean", - "nullable": true, - "default": null, - "description": "Whether the thread is locked" - }, - "isPinned": { - "type": "boolean", - "nullable": true, - "default": null, - "description": "Whether the thread is pinned" - }, - "isHidden": { - "type": "boolean", - "nullable": true, - "default": null, - "description": "Whether the thread is hidden" - } - } - } - } - } - }, - "parameters": [ - { - "name": "id", - "in": "path", - "description": "Thread 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": "Thread updated", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["ocs"], - "properties": { - "ocs": { - "type": "object", - "required": ["meta", "data"], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - }, - "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": "thread-destroy", - "summary": "Delete a thread (soft delete)", - "tags": ["thread"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "Thread 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": "Thread 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": ["success", "categorySlug"], - "properties": { - "success": { - "type": "boolean" - }, - "categorySlug": { - "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/forum/api/threads/slug/{slug}": { - "get": { - "operationId": "thread-by-slug", - "summary": "Get a thread by slug", - "tags": ["thread"], - "security": [ - {}, - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "slug", - "in": "path", - "description": "Thread slug", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "incrementView", - "in": "query", - "description": "Whether to increment view count (1 or 0)", - "schema": { - "type": "string", - "default": "1" - } - }, - { - "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": "Thread 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", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - } - } - } - }, - "/ocs/v2.php/apps/forum/api/threads/{id}/move": { - "put": { - "operationId": "thread-move", - "summary": "Move thread to a different category", - "tags": ["thread"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["categoryId"], - "properties": { - "categoryId": { - "type": "integer", - "format": "int64", - "description": "New category ID" - } - } - } - } - } - }, - "parameters": [ - { - "name": "id", - "in": "path", - "description": "Thread 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": "Thread moved 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", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - }, - "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/forum/api/threads/{id}/lock": { - "put": { - "operationId": "thread-set-locked", - "summary": "Toggle thread lock status", - "tags": ["thread"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["locked"], - "properties": { - "locked": { - "type": "boolean", - "description": "New lock status" - } - } - } - } - } - }, - "parameters": [ - { - "name": "id", - "in": "path", - "description": "Thread 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": "Thread lock status updated", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["ocs"], - "properties": { - "ocs": { - "type": "object", - "required": ["meta", "data"], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - }, - "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/forum/api/threads/{id}/pin": { - "put": { - "operationId": "thread-set-pinned", - "summary": "Toggle thread pin status", - "tags": ["thread"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["pinned"], - "properties": { - "pinned": { - "type": "boolean", - "description": "New pin status" - } - } - } - } - } - }, - "parameters": [ - { - "name": "id", - "in": "path", - "description": "Thread 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": "Thread pin status updated", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["ocs"], - "properties": { - "ocs": { - "type": "object", - "required": ["meta", "data"], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - }, - "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/forum/api/threads/{threadId}/subscribe": { - "post": { - "operationId": "thread_subscription-subscribe", - "summary": "Subscribe current user to a thread to receive notifications", - "tags": ["thread_subscription"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "threadId", - "in": "path", - "description": "Thread 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": "User subscribed to thread", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["ocs"], - "properties": { - "ocs": { - "type": "object", - "required": ["meta", "data"], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - }, - "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": "thread_subscription-unsubscribe", - "summary": "Unsubscribe current user from a thread", - "tags": ["thread_subscription"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "threadId", - "in": "path", - "description": "Thread 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": "User unsubscribed from thread", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["ocs"], - "properties": { - "ocs": { - "type": "object", - "required": ["meta", "data"], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - }, - "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": "thread_subscription-is-subscribed", - "summary": "Check if current user is subscribed to a thread", - "tags": ["thread_subscription"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "threadId", - "in": "path", - "description": "Thread 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": "Subscription status 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", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - }, - "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/forum/api/thread-subscriptions": { - "get": { - "operationId": "thread_subscription-get-user-subscriptions", - "summary": "Get all threads the current user is subscribed to", - "tags": ["thread_subscription"], - "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": "Thread subscriptions returned", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["ocs"], - "properties": { - "ocs": { - "type": "object", - "required": ["meta", "data"], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - } - }, - "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/forum/api/user-preferences": { - "get": { - "operationId": "user_preferences-index", - "summary": "Get all user preferences", - "tags": ["user_preferences"], - "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": "Preferences 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", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - }, - "401": { - "description": "User not authenticated", - "content": { - "application/json": { - "schema": { - "anyOf": [ + }, + "parameters": [ { - "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" - } - } - } - } + "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": "Settings updated", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "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/forum/api/admin/users/{userId}/roles/{roleId}": { + "delete": { + "operationId": "admin-remove-role", + "summary": "Remove a role from a user", + "tags": [ + "admin" + ], + "security": [ + { + "bearer_auth": [] }, { - "type": "object", - "required": ["ocs"], - "properties": { - "ocs": { - "type": "object", - "required": ["meta", "data"], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": {} - } - } - } + "basic_auth": [] } - ] - } - } - } - } - } - }, - "put": { - "operationId": "user_preferences-update", - "summary": "Update user preferences", - "description": "Request body should contain key-value pairs of preferences to update", - "tags": ["user_preferences"], - "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": "Preferences updated", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["ocs"], - "properties": { - "ocs": { - "type": "object", - "required": ["meta", "data"], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - }, - "401": { - "description": "User not authenticated", - "content": { - "application/json": { - "schema": { - "anyOf": [ + ], + "parameters": [ { - "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" - } - } - } - } + "name": "userId", + "in": "path", + "description": "The user ID", + "required": true, + "schema": { + "type": "string" } - } }, { - "type": "object", - "required": ["ocs"], - "properties": { - "ocs": { - "type": "object", - "required": ["meta", "data"], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": {} - } + "name": "roleId", + "in": "path", + "description": "The role ID to remove", + "required": true, + "schema": { + "type": "integer", + "format": "int64" } - } - } - ] - } - } - } - }, - "400": { - "description": "Invalid preference key or value", - "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" - } - } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true } - } } - } - } - } - } - } - } - } - }, - "/ocs/v2.php/apps/forum/api/users/{userId}/roles": { - "get": { - "operationId": "user_role-by-user", - "summary": "Get user role assignments for a user", - "description": "Returns Role objects enriched with userRoleId for managing role assignments.", - "tags": ["user_role"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "userId", - "in": "path", - "description": "Nextcloud user ID", - "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": "User role 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": "array", - "items": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - } - }, - "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/forum/api/roles/{roleId}/users": { - "get": { - "operationId": "user_role-by-role", - "summary": "Get users with a specific role", - "tags": ["user_role"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "roleId", - "in": "path", - "description": "Role 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": "User roles returned", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["ocs"], - "properties": { - "ocs": { - "type": "object", - "required": ["meta", "data"], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - } - }, - "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/forum/api/user-roles": { - "post": { - "operationId": "user_role-create", - "summary": "Assign a role to a user", - "tags": ["user_role"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["userId", "roleId"], - "properties": { - "userId": { - "type": "string", - "description": "Nextcloud user ID" - }, - "roleId": { - "type": "integer", - "format": "int64", - "description": "Role ID" - } - } - } - } - } - }, - "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": { - "201": { - "description": "Role assigned to user", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["ocs"], - "properties": { - "ocs": { - "type": "object", - "required": ["meta", "data"], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - } - } - } - } - } - }, - "409": { - "description": "User already has this role", - "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" - } - } - } - } - } - } - } - } - } - }, - "403": { - "description": "Cannot assign guest role to users", - "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/forum/api/user-roles/{id}": { - "delete": { - "operationId": "user_role-destroy", - "summary": "Remove a role from a user", - "tags": ["user_role"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "User role 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": "Role removed from user", - "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": ["success"], - "properties": { - "success": { - "type": "boolean" - } - } - } - } - } - } - } - } - } - }, - "403": { - "description": "Cannot remove guest role from users", - "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/forum/api/admin/repair-seeds": { - "post": { - "operationId": "admin-repair-seeds", - "summary": "Run the repair seeds command to restore default forum data", - "description": "This endpoint requires admin access", - "tags": ["admin"], - "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": "Seeds repaired 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": ["success", "message"], - "properties": { - "success": { - "type": "boolean" - }, - "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": {} - } - } - } - } - } - } - }, - "403": { - "description": "Logged in account must be an admin", - "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/forum/api/admin/roles": { - "get": { - "operationId": "admin-get-roles", - "summary": "Get all available roles", - "description": "This endpoint requires admin access", - "tags": ["admin"], - "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": "Roles list 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": ["roles"], - "properties": { - "roles": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "type": "object" + ], + "responses": { + "200": { + "description": "Role removed 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": [ + "success", + "message" + ], + "properties": { + "success": { + "type": "boolean" + }, + "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": {} + } + } + } } - } } - } } - } } - } } - } } - }, - "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": {} - } - } - } - } - } - } - }, - "403": { - "description": "Logged in account must be an admin", - "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/forum/api/admin/users/{userId}/roles": { - "post": { - "operationId": "admin-assign-role", - "summary": "Assign a role to a user", - "description": "This endpoint requires admin access", - "tags": ["admin"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["roleId"], - "properties": { - "roleId": { - "type": "integer", - "format": "int64", - "description": "The role ID to assign" - } - } - } - } - } }, - "parameters": [ - { - "name": "userId", - "in": "path", - "description": "The user ID", - "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": "Role assigned 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": ["success", "message"], - "properties": { - "success": { - "type": "boolean" - }, - "message": { - "type": "string" - } - } + "/ocs/v2.php/apps/forum/api/bbcodes": { + "get": { + "operationId": "bb_code-index", + "summary": "Get all BBCodes (excludes builtin codes)", + "tags": [ + "bb_code" + ], + "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 } - } } - } - } - } - } - }, - "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": {} - } + ], + "responses": { + "200": { + "description": "BBCodes returned", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + } + }, + "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": {} + } + } + } + } + } + } } - } } - } - } - }, - "403": { - "description": "Logged in account must be an admin", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["ocs"], - "properties": { - "ocs": { - "type": "object", - "required": ["meta", "data"], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": {} - } + }, + "post": { + "operationId": "bb_code-create", + "summary": "Create a new BBCode", + "tags": [ + "bb_code" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "tag", + "replacement", + "example" + ], + "properties": { + "tag": { + "type": "string", + "description": "BBCode tag name" + }, + "replacement": { + "type": "string", + "description": "Replacement pattern" + }, + "example": { + "type": "string", + "description": "Example usage" + }, + "description": { + "type": "string", + "nullable": true, + "default": null, + "description": "Optional description" + }, + "enabled": { + "type": "boolean", + "default": true, + "description": "Whether BBCode is enabled" + }, + "parseInner": { + "type": "boolean", + "default": true, + "description": "Whether to parse inner BBCode tags" + } + } + } + } + } + }, + "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": { + "201": { + "description": "BBCode 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", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "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/forum/api/bbcodes/enabled": { + "get": { + "operationId": "bb_code-enabled", + "summary": "Get enabled BBCodes", + "tags": [ + "bb_code" + ], + "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": "Enabled BBCodes returned", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + } + }, + "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/forum/api/bbcodes/builtin": { + "get": { + "operationId": "bb_code-builtin", + "summary": "Get builtin BBCodes (for help dialog)", + "tags": [ + "bb_code" + ], + "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": "Builtin BBCodes returned", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + } + }, + "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/forum/api/bbcodes/{id}": { + "get": { + "operationId": "bb_code-show", + "summary": "Get a single BBCode", + "tags": [ + "bb_code" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "BBCode 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": "BBCode 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", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "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": {} + } + } + } + } + } + } + } + } + }, + "put": { + "operationId": "bb_code-update", + "summary": "Update a BBCode", + "tags": [ + "bb_code" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "requestBody": { + "required": false, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "tag": { + "type": "string", + "nullable": true, + "default": null, + "description": "BBCode tag name" + }, + "replacement": { + "type": "string", + "nullable": true, + "default": null, + "description": "Replacement pattern" + }, + "example": { + "type": "string", + "nullable": true, + "default": null, + "description": "Example usage" + }, + "description": { + "type": "string", + "nullable": true, + "default": null, + "description": "Description" + }, + "enabled": { + "type": "boolean", + "nullable": true, + "default": null, + "description": "Whether BBCode is enabled" + }, + "parseInner": { + "type": "boolean", + "nullable": true, + "default": null, + "description": "Whether to parse inner BBCode tags" + } + } + } + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "BBCode 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": "BBCode updated", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "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": "bb_code-destroy", + "summary": "Delete a BBCode", + "tags": [ + "bb_code" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "BBCode 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": "BBCode 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": [ + "success" + ], + "properties": { + "success": { + "type": "boolean" + } + } + } + } + } + } + } + } + } + }, + "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/forum/api/threads/{threadId}/bookmark": { + "post": { + "operationId": "bookmark-bookmark-thread", + "summary": "Add a bookmark for a thread", + "tags": [ + "bookmark" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "threadId", + "in": "path", + "description": "Thread 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": "Thread bookmarked", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "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": "bookmark-unbookmark-thread", + "summary": "Remove a bookmark from a thread", + "tags": [ + "bookmark" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "threadId", + "in": "path", + "description": "Thread 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": "Bookmark removed", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "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": "bookmark-is-thread-bookmarked", + "summary": "Check if current user has bookmarked a thread", + "tags": [ + "bookmark" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "threadId", + "in": "path", + "description": "Thread 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": "Bookmark status 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", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "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/forum/api/bookmarks": { + "get": { + "operationId": "bookmark-index", + "summary": "Get all bookmarked threads for the current user (paginated) Includes read marker information for unread status", + "tags": [ + "bookmark" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "page", + "in": "query", + "description": "Page number (1-indexed)", + "schema": { + "type": "integer", + "format": "int64", + "default": 1 + } + }, + { + "name": "perPage", + "in": "query", + "description": "Number of threads per page", + "schema": { + "type": "integer", + "format": "int64", + "default": 20 + } + }, + { + "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": "Bookmarked threads returned with pagination and read markers", + "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": [ + "threads", + "pagination", + "readMarkers" + ], + "properties": { + "threads": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + }, + "pagination": { + "type": "object", + "required": [ + "page", + "perPage", + "total", + "totalPages" + ], + "properties": { + "page": { + "type": "integer", + "format": "int64" + }, + "perPage": { + "type": "integer", + "format": "int64" + }, + "total": { + "type": "integer", + "format": "int64" + }, + "totalPages": { + "type": "integer", + "format": "int64" + } + } + }, + "readMarkers": { + "type": "object", + "additionalProperties": { + "type": "object", + "required": [ + "threadId", + "lastReadPostId", + "readAt" + ], + "properties": { + "threadId": { + "type": "integer", + "format": "int64" + }, + "lastReadPostId": { + "type": "integer", + "format": "int64" + }, + "readAt": { + "type": "integer", + "format": "int64" + } + } + } + } + } + } + } + } + } + } + } + } + }, + "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/forum/api/headers": { + "get": { + "operationId": "cat_header-index", + "summary": "Get all category headers", + "tags": [ + "cat_header" + ], + "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": "Category headers returned", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + } + } + } + }, + "post": { + "operationId": "cat_header-create", + "summary": "Create a new category header", + "tags": [ + "cat_header" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "description": "Category header name" + }, + "description": { + "type": "string", + "nullable": true, + "default": null, + "description": "Category header description" + }, + "sortOrder": { + "type": "integer", + "format": "int64", + "default": 0, + "description": "Sort order" + } + } + } + } + } + }, + "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": { + "201": { + "description": "Category header 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", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "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/forum/api/headers/{id}": { + "get": { + "operationId": "cat_header-show", + "summary": "Get a single category header", + "tags": [ + "cat_header" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Category header 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": "Category header 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", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + } + } + }, + "put": { + "operationId": "cat_header-update", + "summary": "Update a category header", + "tags": [ + "cat_header" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "requestBody": { + "required": false, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "nullable": true, + "default": null, + "description": "Category header name" + }, + "description": { + "type": "string", + "nullable": true, + "default": null, + "description": "Category header description" + }, + "sortOrder": { + "type": "integer", + "format": "int64", + "nullable": true, + "default": null, + "description": "Sort order" + } + } + } + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Category header 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": "Category header updated", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "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": "cat_header-destroy", + "summary": "Delete a category header", + "tags": [ + "cat_header" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Category header ID", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "migrateToHeaderId", + "in": "query", + "description": "Header ID to migrate categories to (null to delete categories)", + "schema": { + "type": "integer", + "format": "int64", + "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": "Category header 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": [ + "success" + ], + "properties": { + "success": { + "type": "boolean" + }, + "categoriesAffected": { + "type": "integer", + "format": "int64" + } + } + } + } + } + } + } + } + } + }, + "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/forum/api/headers/reorder": { + "post": { + "operationId": "cat_header-reorder", + "summary": "Reorder category headers", + "tags": [ + "cat_header" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "headers" + ], + "properties": { + "headers": { + "type": "array", + "description": "Array of headers with new sort orders", + "items": { + "type": "object", + "required": [ + "id", + "sortOrder" + ], + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "sortOrder": { + "type": "integer", + "format": "int64" + } + } + } + } + } + } + } + } + }, + "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": "Headers reordered 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": [ + "success" + ], + "properties": { + "success": { + "type": "boolean" + } + } + } + } + } + } + } + } + } + }, + "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/forum/api/categories": { + "get": { + "operationId": "category-index", + "summary": "Get all category headers with nested categories", + "tags": [ + "category" + ], + "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": "Category headers with nested categories returned", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + } + } + } + }, + "post": { + "operationId": "category-create", + "summary": "Create a new category", + "tags": [ + "category" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "headerId", + "name", + "slug" + ], + "properties": { + "headerId": { + "type": "integer", + "format": "int64", + "description": "Category header ID" + }, + "name": { + "type": "string", + "description": "Category name" + }, + "slug": { + "type": "string", + "description": "Category slug" + }, + "description": { + "type": "string", + "nullable": true, + "default": null, + "description": "Category description" + }, + "sortOrder": { + "type": "integer", + "format": "int64", + "default": 0, + "description": "Sort order" + } + } + } + } + } + }, + "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": { + "201": { + "description": "Category 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", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "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/forum/api/headers/{headerId}/categories": { + "get": { + "operationId": "category-by-header", + "summary": "Get categories by header ID", + "tags": [ + "category" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "headerId", + "in": "path", + "description": "Category header 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": "Categories returned", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/forum/api/categories/{id}": { + "get": { + "operationId": "category-show", + "summary": "Get a single category", + "tags": [ + "category" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Category 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": "Category 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", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + } + } + }, + "put": { + "operationId": "category-update", + "summary": "Update a category", + "tags": [ + "category" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "requestBody": { + "required": false, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "headerId": { + "type": "integer", + "format": "int64", + "nullable": true, + "default": null, + "description": "Category header ID" + }, + "name": { + "type": "string", + "nullable": true, + "default": null, + "description": "Category name" + }, + "description": { + "type": "string", + "nullable": true, + "default": null, + "description": "Category description" + }, + "slug": { + "type": "string", + "nullable": true, + "default": null, + "description": "Category slug" + }, + "sortOrder": { + "type": "integer", + "format": "int64", + "nullable": true, + "default": null, + "description": "Sort order" + } + } + } + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Category 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": "Category updated", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "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": "category-destroy", + "summary": "Delete a category", + "tags": [ + "category" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Category ID", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "migrateToCategoryId", + "in": "query", + "description": "Category ID to migrate threads to (null to soft-delete threads)", + "schema": { + "type": "integer", + "format": "int64", + "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": "Category 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": [ + "success" + ], + "properties": { + "success": { + "type": "boolean" + }, + "threadsAffected": { + "type": "integer", + "format": "int64" + } + } + } + } + } + } + } + } + } + }, + "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/forum/api/categories/slug/{slug}": { + "get": { + "operationId": "category-by-slug", + "summary": "Get a category by slug", + "tags": [ + "category" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "slug", + "in": "path", + "description": "Category slug", + "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": "Category 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", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/forum/api/categories/{id}/thread-count": { + "get": { + "operationId": "category-get-thread-count", + "summary": "Get thread count for a category", + "tags": [ + "category" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Category 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": "Thread count 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": [ + "count" + ], + "properties": { + "count": { + "type": "integer", + "format": "int64" + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/forum/api/categories/{id}/permissions/{permission}": { + "get": { + "operationId": "category-check-permission", + "summary": "Check if current user has a specific permission on a category", + "tags": [ + "category" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Category ID", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "permission", + "in": "path", + "description": "Permission name (canView, canPost, canReply, canModerate)", + "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": "Permission check result", + "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": [ + "hasPermission" + ], + "properties": { + "hasPermission": { + "type": "boolean" + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/forum/api/categories/{id}/permissions": { + "get": { + "operationId": "category-get-permissions", + "summary": "Get permissions for a category", + "tags": [ + "category" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Category 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": "Permissions returned", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + } + }, + "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": "category-update-permissions", + "summary": "Update permissions for a category", + "tags": [ + "category" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "permissions" + ], + "properties": { + "permissions": { + "type": "array", + "description": "Permissions array", + "items": { + "type": "object", + "required": [ + "roleId", + "canView", + "canModerate" + ], + "properties": { + "roleId": { + "type": "integer", + "format": "int64" + }, + "canView": { + "type": "boolean" + }, + "canModerate": { + "type": "boolean" + } + } + } + } + } + } + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Category 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": "Permissions updated", + "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": [ + "success" + ], + "properties": { + "success": { + "type": "boolean" + } + } + } + } + } + } + } + } + } + }, + "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/forum/api/categories/reorder": { + "post": { + "operationId": "category-reorder", + "summary": "Reorder categories", + "tags": [ + "category" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "categories" + ], + "properties": { + "categories": { + "type": "array", + "description": "Array of categories with new sort orders", + "items": { + "type": "object", + "required": [ + "id", + "sortOrder" + ], + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "sortOrder": { + "type": "integer", + "format": "int64" + } + } + } + } + } + } + } + } + }, + "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": "Categories reordered 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": [ + "success" + ], + "properties": { + "success": { + "type": "boolean" + } + } + } + } + } + } + } + } + } + }, + "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/forum/api/drafts/thread/{categoryId}": { + "get": { + "operationId": "draft-get-thread-draft", + "summary": "Get a thread draft for a category", + "tags": [ + "draft" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "categoryId", + "in": "path", + "description": "Category 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": "Draft found or null", + "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": [ + "draft" + ], + "properties": { + "draft": { + "type": "object", + "nullable": true, + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + } + } + }, + "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": {} + } + } + } + } + } + } + } + } + }, + "put": { + "operationId": "draft-save-thread-draft", + "summary": "Save (create or update) a thread draft for a category", + "tags": [ + "draft" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "content" + ], + "properties": { + "title": { + "type": "string", + "nullable": true, + "description": "Draft title (can be empty)" + }, + "content": { + "type": "string", + "description": "Draft content" + } + } + } + } + } + }, + "parameters": [ + { + "name": "categoryId", + "in": "path", + "description": "Category 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": "Draft 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": [ + "draft" + ], + "properties": { + "draft": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + } + } + }, + "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": "draft-delete-thread-draft", + "summary": "Delete a thread draft for a category", + "tags": [ + "draft" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "categoryId", + "in": "path", + "description": "Category 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": "Draft 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": [ + "success" + ], + "properties": { + "success": { + "type": "boolean" + } + } + } + } + } + } + } + } + } + }, + "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/forum/api/drafts/thread": { + "get": { + "operationId": "draft-list-thread-drafts", + "summary": "Get all thread drafts for the current user", + "tags": [ + "draft" + ], + "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": "List of drafts 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": [ + "drafts" + ], + "properties": { + "drafts": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + } + } + } + }, + "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/forum/api/users": { + "get": { + "operationId": "forum_user-index", + "summary": "Get all forum users", + "tags": [ + "forum_user" + ], + "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": "Forum users returned", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + } + } + } + }, + "post": { + "operationId": "forum_user-create", + "summary": "Create forum user Note: This is typically not needed as forum users are auto-created on first post", + "tags": [ + "forum_user" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "userId" + ], + "properties": { + "userId": { + "type": "string", + "description": "Nextcloud user ID" + } + } + } + } + } + }, + "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": { + "201": { + "description": "Forum user 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", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "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/forum/api/users/autocomplete": { + "get": { + "operationId": "forum_user-autocomplete", + "summary": "Search Nextcloud users for autocomplete Returns users matching the search query in the format expected by NcRichContenteditable Excludes the current user from results (users cannot mention themselves)", + "tags": [ + "forum_user" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "search", + "in": "query", + "description": "Search query (matches against user ID and display name)", + "schema": { + "type": "string", + "default": "" + } + }, + { + "name": "limit", + "in": "query", + "description": "Maximum number of results to return", + "schema": { + "type": "integer", + "format": "int64", + "default": 10 + } + }, + { + "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": "Users returned", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "required": [ + "id", + "label", + "icon", + "source" + ], + "properties": { + "id": { + "type": "string" + }, + "label": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "source": { + "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/forum/api/users/{userId}": { + "get": { + "operationId": "forum_user-show", + "summary": "Get forum user by Nextcloud user ID Special case: use \"me\" to get current forum user", + "tags": [ + "forum_user" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "Nextcloud user ID or \"me\" for current user", + "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": "Forum user 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", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "404": { + "description": "Forum user not found (user has not posted yet) or guest user accessing \"me\"", + "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/forum/api/threads/{threadId}/posts": { + "get": { + "operationId": "post-by-thread", + "summary": "Get posts by thread", + "tags": [ + "post" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "threadId", + "in": "path", + "description": "Thread ID", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "limit", + "in": "query", + "description": "Maximum number of posts to return", + "schema": { + "type": "integer", + "format": "int64", + "default": 50 + } + }, + { + "name": "offset", + "in": "query", + "description": "Offset for pagination", + "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": "Posts returned", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/forum/api/threads/{threadId}/posts/paginated": { + "get": { + "operationId": "post-by-thread-paginated", + "summary": "Get paginated posts by thread with first post separated", + "tags": [ + "post" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "threadId", + "in": "path", + "description": "Thread ID", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "page", + "in": "query", + "description": "Page number (1-indexed)", + "schema": { + "type": "integer", + "format": "int64", + "default": 0 + } + }, + { + "name": "perPage", + "in": "query", + "description": "Number of replies per page", + "schema": { + "type": "integer", + "format": "int64", + "default": 20 + } + }, + { + "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": "Posts returned with pagination metadata", + "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": [ + "firstPost", + "replies", + "pagination" + ], + "properties": { + "firstPost": { + "type": "object", + "nullable": true, + "additionalProperties": { + "type": "object" + } + }, + "replies": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + }, + "pagination": { + "type": "object", + "required": [ + "page", + "perPage", + "total", + "totalPages", + "startPage", + "lastReadPostId" + ], + "properties": { + "page": { + "type": "integer", + "format": "int64" + }, + "perPage": { + "type": "integer", + "format": "int64" + }, + "total": { + "type": "integer", + "format": "int64" + }, + "totalPages": { + "type": "integer", + "format": "int64" + }, + "startPage": { + "type": "integer", + "format": "int64" + }, + "lastReadPostId": { + "type": "integer", + "format": "int64", + "nullable": true + } + } + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/forum/api/users/{authorId}/posts": { + "get": { + "operationId": "post-by-author", + "summary": "Get posts by author", + "tags": [ + "post" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "authorId", + "in": "path", + "description": "Author user ID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "limit", + "in": "query", + "description": "Maximum number of posts to return", + "schema": { + "type": "integer", + "format": "int64", + "default": 50 + } + }, + { + "name": "offset", + "in": "query", + "description": "Offset for pagination", + "schema": { + "type": "integer", + "format": "int64", + "default": 0 + } + }, + { + "name": "excludeFirstPosts", + "in": "query", + "description": "Whether to exclude first posts (1 or 0)", + "schema": { + "type": "string", + "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": "Posts returned", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + } + }, + "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/forum/api/posts/{id}": { + "get": { + "operationId": "post-show", + "summary": "Get a single post", + "tags": [ + "post" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Post 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": "Post 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", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "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": {} + } + } + } + } + } + } + } + } + }, + "put": { + "operationId": "post-update", + "summary": "Update a post", + "tags": [ + "post" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "requestBody": { + "required": false, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "content": { + "type": "string", + "nullable": true, + "default": null, + "description": "Post content" + } + } + } + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Post 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": "Post updated", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "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": "post-destroy", + "summary": "Delete a post (soft delete)", + "tags": [ + "post" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Post 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": "Post 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": [ + "success" + ], + "properties": { + "success": { + "type": "boolean" + } + } + } + } + } + } + } + } + } + }, + "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/forum/api/posts": { + "post": { + "operationId": "post-create", + "summary": "Create a new post", + "tags": [ + "post" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "threadId", + "content" + ], + "properties": { + "threadId": { + "type": "integer", + "format": "int64", + "description": "Thread ID" + }, + "content": { + "type": "string", + "description": "Post content" + } + } + } + } + } + }, + "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": { + "201": { + "description": "Post 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", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "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/forum/api/posts/{postId}/history": { + "get": { + "operationId": "post_history-get-history", + "summary": "Get edit history for a post", + "description": "Returns the current version of the post and all historical versions, ordered from newest to oldest.", + "tags": [ + "post_history" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "postId", + "in": "path", + "description": "Post 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": "Post history 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": [ + "current", + "history" + ], + "properties": { + "current": { + "type": "object", + "additionalProperties": { + "type": "object" + } + }, + "history": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + } + } + } + }, + "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/forum/api/posts/{postId}/reactions": { + "get": { + "operationId": "reaction-by-post", + "summary": "Get reactions by post", + "tags": [ + "reaction" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "postId", + "in": "path", + "description": "Post 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": "Reactions returned", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + } + }, + "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/forum/api/reactions/by-posts": { + "post": { + "operationId": "reaction-by-posts", + "summary": "Get reactions for multiple posts (for performance)", + "tags": [ + "reaction" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "postIds" + ], + "properties": { + "postIds": { + "type": "array", + "description": "Array of post IDs", + "items": { + "type": "integer", + "format": "int64" + } + } + } + } + } + } + }, + "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": "Reactions returned", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + } + }, + "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/forum/api/reactions/{id}": { + "get": { + "operationId": "reaction-show", + "summary": "Get a single reaction", + "tags": [ + "reaction" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Reaction 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": "Reaction 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", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "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": "reaction-destroy", + "summary": "Delete a reaction", + "tags": [ + "reaction" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Reaction 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": "Reaction 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": [ + "success" + ], + "properties": { + "success": { + "type": "boolean" + } + } + } + } + } + } + } + } + } + }, + "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/forum/api/reactions": { + "post": { + "operationId": "reaction-create", + "summary": "Create a new reaction", + "tags": [ + "reaction" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "postId", + "reactionType" + ], + "properties": { + "postId": { + "type": "integer", + "format": "int64", + "description": "Post ID" + }, + "reactionType": { + "type": "string", + "description": "Type of reaction" + } + } + } + } + } + }, + "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": { + "201": { + "description": "Reaction 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", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "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/forum/api/reactions/toggle": { + "post": { + "operationId": "reaction-toggle", + "summary": "Toggle a reaction (add if not exists, remove if exists)", + "tags": [ + "reaction" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "postId", + "reactionType" + ], + "properties": { + "postId": { + "type": "integer", + "format": "int64", + "description": "Post ID" + }, + "reactionType": { + "type": "string", + "description": "Type of reaction (emoji)" + } + } + } + } + } + }, + "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": "Reaction toggled", + "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" + }, + "reaction": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + } + } + }, + "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/forum/api/read-markers": { + "get": { + "operationId": "read_marker-index", + "summary": "Get read markers for multiple threads", + "tags": [ + "read_marker" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "threadIds", + "in": "query", + "description": "Array of thread IDs (comma-separated in query string)", + "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": "Read markers returned (keyed by thread ID)", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "additionalProperties": { + "type": "object", + "required": [ + "threadId", + "lastReadPostId", + "readAt" + ], + "properties": { + "threadId": { + "type": "integer", + "format": "int64" + }, + "lastReadPostId": { + "type": "integer", + "format": "int64" + }, + "readAt": { + "type": "integer", + "format": "int64" + } + } + } + } + } + } + } + } + } + } + }, + "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": "read_marker-create", + "summary": "Mark a thread as read", + "tags": [ + "read_marker" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "threadId", + "lastReadPostId" + ], + "properties": { + "threadId": { + "type": "integer", + "format": "int64", + "description": "Thread ID" + }, + "lastReadPostId": { + "type": "integer", + "format": "int64", + "description": "Last read post ID" + } + } + } + } + } + }, + "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": "Thread marked as read", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "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/forum/api/threads/{threadId}/read-marker": { + "get": { + "operationId": "read_marker-show", + "summary": "Get read marker for a specific thread", + "tags": [ + "read_marker" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "threadId", + "in": "path", + "description": "Thread 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": "Read marker 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", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "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/forum/api/read-markers/{id}": { + "delete": { + "operationId": "read_marker-destroy", + "summary": "Delete a read marker", + "tags": [ + "read_marker" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Read marker 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": "Read marker 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": [ + "success" + ], + "properties": { + "success": { + "type": "boolean" + } + } + } + } + } + } + } + } + } + }, + "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/forum/api/roles": { + "get": { + "operationId": "role-index", + "summary": "Get all roles", + "tags": [ + "role" + ], + "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": "Roles returned", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + } + }, + "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": "role-create", + "summary": "Create a new role", + "tags": [ + "role" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "description": "Role name" + }, + "description": { + "type": "string", + "nullable": true, + "default": null, + "description": "Role description" + }, + "colorLight": { + "type": "string", + "nullable": true, + "default": null, + "description": "Light mode color" + }, + "colorDark": { + "type": "string", + "nullable": true, + "default": null, + "description": "Dark mode color" + }, + "canAccessAdminTools": { + "type": "boolean", + "default": false, + "description": "Can access admin tools" + }, + "canEditRoles": { + "type": "boolean", + "default": false, + "description": "Can edit roles" + }, + "canEditCategories": { + "type": "boolean", + "default": false, + "description": "Can edit categories" + } + } + } + } + } + }, + "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": { + "201": { + "description": "Role 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", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "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/forum/api/roles/{id}": { + "get": { + "operationId": "role-show", + "summary": "Get a single role", + "tags": [ + "role" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Role 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": "Role 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", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "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": {} + } + } + } + } + } + } + } + } + }, + "put": { + "operationId": "role-update", + "summary": "Update a role", + "tags": [ + "role" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "requestBody": { + "required": false, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "nullable": true, + "default": null, + "description": "Role name" + }, + "description": { + "type": "string", + "nullable": true, + "default": null, + "description": "Role description" + }, + "colorLight": { + "type": "string", + "nullable": true, + "default": null, + "description": "Light mode color" + }, + "colorDark": { + "type": "string", + "nullable": true, + "default": null, + "description": "Dark mode color" + }, + "canAccessAdminTools": { + "type": "boolean", + "nullable": true, + "default": null, + "description": "Can access admin tools" + }, + "canEditRoles": { + "type": "boolean", + "nullable": true, + "default": null, + "description": "Can edit roles" + }, + "canEditCategories": { + "type": "boolean", + "nullable": true, + "default": null, + "description": "Can edit categories" + } + } + } + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Role 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": "Role updated", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "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": "role-destroy", + "summary": "Delete a role", + "tags": [ + "role" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Role 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": "Role 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": [ + "success" + ], + "properties": { + "success": { + "type": "boolean" + } + } + } + } + } + } + } + } + } + }, + "403": { + "description": "Cannot delete system roles", + "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/forum/api/roles/{id}/permissions": { + "get": { + "operationId": "role-get-permissions", + "summary": "Get permissions for a role", + "tags": [ + "role" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Role 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": "Permissions returned", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + } + }, + "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": "role-update-permissions", + "summary": "Update permissions for a role", + "tags": [ + "role" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "permissions" + ], + "properties": { + "permissions": { + "type": "array", + "description": "Permissions array", + "items": { + "type": "object", + "required": [ + "categoryId", + "canView", + "canModerate" + ], + "properties": { + "categoryId": { + "type": "integer", + "format": "int64" + }, + "canView": { + "type": "boolean" + }, + "canModerate": { + "type": "boolean" + } + } + } + } + } + } + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Role 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": "Permissions updated", + "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": [ + "success" + ], + "properties": { + "success": { + "type": "boolean" + } + } + } + } + } + } + } + } + } + }, + "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/forum/api/search": { + "get": { + "operationId": "search-index", + "summary": "Search forum threads and posts", + "tags": [ + "search" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "q", + "in": "query", + "description": "Search query (supports quoted phrases, AND/OR operators, parentheses, -exclusions)", + "schema": { + "type": "string", + "default": "" + } + }, + { + "name": "searchThreads", + "in": "query", + "description": "Include threads in search (title + first post content)", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "searchPosts", + "in": "query", + "description": "Include reply posts in search", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "categoryId", + "in": "query", + "description": "Optional category ID filter", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true, + "default": null + } + }, + { + "name": "limit", + "in": "query", + "description": "Maximum results per type", + "schema": { + "type": "integer", + "format": "int64", + "default": 50 + } + }, + { + "name": "offset", + "in": "query", + "description": "Results offset per type", + "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": "Search results 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": [ + "threads", + "posts", + "threadCount", + "postCount", + "query" + ], + "properties": { + "threads": { + "type": "object", + "additionalProperties": { + "type": "object" + } + }, + "posts": { + "type": "object", + "additionalProperties": { + "type": "object" + } + }, + "threadCount": { + "type": "integer", + "format": "int64" + }, + "postCount": { + "type": "integer", + "format": "int64" + }, + "query": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/forum/api/settings": { + "get": { + "operationId": "settings-get-public-settings", + "summary": "Get public forum settings (title, subtitle, and guest access)", + "description": "This endpoint is publicly accessible to all users. For admin-only settings, use AdminController::getSettings()", + "tags": [ + "settings" + ], + "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": "Settings 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": [ + "title", + "subtitle", + "allow_guest_access" + ], + "properties": { + "title": { + "type": "string" + }, + "subtitle": { + "type": "string" + }, + "allow_guest_access": { + "type": "boolean" + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/forum/api/threads": { + "get": { + "operationId": "thread-index", + "summary": "Get all threads", + "tags": [ + "thread" + ], + "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": "Threads returned", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + } + } + } + }, + "post": { + "operationId": "thread-create", + "summary": "Create a new thread with initial post", + "tags": [ + "thread" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "categoryId", + "title", + "content" + ], + "properties": { + "categoryId": { + "type": "integer", + "format": "int64", + "description": "Category ID" + }, + "title": { + "type": "string", + "description": "Thread title" + }, + "content": { + "type": "string", + "description": "Initial post content" + } + } + } + } + } + }, + "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": { + "201": { + "description": "Thread 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", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "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/forum/api/categories/{categoryId}/threads": { + "get": { + "operationId": "thread-by-category", + "summary": "Get threads by category", + "tags": [ + "thread" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "categoryId", + "in": "path", + "description": "Category ID", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "limit", + "in": "query", + "description": "Maximum number of threads to return", + "schema": { + "type": "integer", + "format": "int64", + "default": 50 + } + }, + { + "name": "offset", + "in": "query", + "description": "Offset for pagination", + "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": "Threads returned", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/forum/api/categories/{categoryId}/threads/paginated": { + "get": { + "operationId": "thread-by-category-paginated", + "summary": "Get paginated threads by category", + "tags": [ + "thread" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "categoryId", + "in": "path", + "description": "Category ID", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "page", + "in": "query", + "description": "Page number (1-indexed)", + "schema": { + "type": "integer", + "format": "int64", + "default": 1 + } + }, + { + "name": "perPage", + "in": "query", + "description": "Number of threads per page", + "schema": { + "type": "integer", + "format": "int64", + "default": 20 + } + }, + { + "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": "Threads returned with pagination metadata", + "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": [ + "threads", + "pagination" + ], + "properties": { + "threads": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + }, + "pagination": { + "type": "object", + "required": [ + "page", + "perPage", + "total", + "totalPages" + ], + "properties": { + "page": { + "type": "integer", + "format": "int64" + }, + "perPage": { + "type": "integer", + "format": "int64" + }, + "total": { + "type": "integer", + "format": "int64" + }, + "totalPages": { + "type": "integer", + "format": "int64" + } + } + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/forum/api/users/{authorId}/threads": { + "get": { + "operationId": "thread-by-author", + "summary": "Get threads by author", + "tags": [ + "thread" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "authorId", + "in": "path", + "description": "Author user ID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "limit", + "in": "query", + "description": "Maximum number of threads to return", + "schema": { + "type": "integer", + "format": "int64", + "default": 50 + } + }, + { + "name": "offset", + "in": "query", + "description": "Offset for pagination", + "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": "Threads returned", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/forum/api/threads/{id}": { + "get": { + "operationId": "thread-show", + "summary": "Get a single thread", + "tags": [ + "thread" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Thread ID", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "incrementView", + "in": "query", + "description": "Whether to increment view count (1 or 0)", + "schema": { + "type": "string", + "default": "1" + } + }, + { + "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": "Thread 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", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + } + } + }, + "put": { + "operationId": "thread-update", + "summary": "Update a thread", + "tags": [ + "thread" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "requestBody": { + "required": false, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "title": { + "type": "string", + "nullable": true, + "default": null, + "description": "Thread title" + }, + "isLocked": { + "type": "boolean", + "nullable": true, + "default": null, + "description": "Whether the thread is locked" + }, + "isPinned": { + "type": "boolean", + "nullable": true, + "default": null, + "description": "Whether the thread is pinned" + }, + "isHidden": { + "type": "boolean", + "nullable": true, + "default": null, + "description": "Whether the thread is hidden" + } + } + } + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Thread 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": "Thread updated", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "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": "thread-destroy", + "summary": "Delete a thread (soft delete)", + "tags": [ + "thread" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Thread 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": "Thread 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": [ + "success", + "categorySlug" + ], + "properties": { + "success": { + "type": "boolean" + }, + "categorySlug": { + "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/forum/api/threads/slug/{slug}": { + "get": { + "operationId": "thread-by-slug", + "summary": "Get a thread by slug", + "tags": [ + "thread" + ], + "security": [ + {}, + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "slug", + "in": "path", + "description": "Thread slug", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "incrementView", + "in": "query", + "description": "Whether to increment view count (1 or 0)", + "schema": { + "type": "string", + "default": "1" + } + }, + { + "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": "Thread 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", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/forum/api/threads/{id}/move": { + "put": { + "operationId": "thread-move", + "summary": "Move thread to a different category", + "tags": [ + "thread" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "categoryId" + ], + "properties": { + "categoryId": { + "type": "integer", + "format": "int64", + "description": "New category ID" + } + } + } + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Thread 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": "Thread moved 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", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "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/forum/api/threads/{id}/lock": { + "put": { + "operationId": "thread-set-locked", + "summary": "Toggle thread lock status", + "tags": [ + "thread" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "locked" + ], + "properties": { + "locked": { + "type": "boolean", + "description": "New lock status" + } + } + } + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Thread 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": "Thread lock status updated", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "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/forum/api/threads/{id}/pin": { + "put": { + "operationId": "thread-set-pinned", + "summary": "Toggle thread pin status", + "tags": [ + "thread" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "pinned" + ], + "properties": { + "pinned": { + "type": "boolean", + "description": "New pin status" + } + } + } + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Thread 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": "Thread pin status updated", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "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/forum/api/threads/{threadId}/subscribe": { + "post": { + "operationId": "thread_subscription-subscribe", + "summary": "Subscribe current user to a thread to receive notifications", + "tags": [ + "thread_subscription" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "threadId", + "in": "path", + "description": "Thread 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": "User subscribed to thread", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "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": "thread_subscription-unsubscribe", + "summary": "Unsubscribe current user from a thread", + "tags": [ + "thread_subscription" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "threadId", + "in": "path", + "description": "Thread 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": "User unsubscribed from thread", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "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": "thread_subscription-is-subscribed", + "summary": "Check if current user is subscribed to a thread", + "tags": [ + "thread_subscription" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "threadId", + "in": "path", + "description": "Thread 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": "Subscription status 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", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "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/forum/api/thread-subscriptions": { + "get": { + "operationId": "thread_subscription-get-user-subscriptions", + "summary": "Get all threads the current user is subscribed to", + "tags": [ + "thread_subscription" + ], + "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": "Thread subscriptions returned", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + } + }, + "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/forum/api/user-preferences": { + "get": { + "operationId": "user_preferences-index", + "summary": "Get all user preferences", + "tags": [ + "user_preferences" + ], + "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": "Preferences 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", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "401": { + "description": "User 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": {} + } + } + } + } + ] + } + } + } + } + } + }, + "put": { + "operationId": "user_preferences-update", + "summary": "Update user preferences", + "description": "Request body should contain key-value pairs of preferences to update", + "tags": [ + "user_preferences" + ], + "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": "Preferences updated", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "401": { + "description": "User 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": {} + } + } + } + } + ] + } + } + } + }, + "400": { + "description": "Invalid preference key or value", + "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/forum/api/users/{userId}/roles": { + "get": { + "operationId": "user_role-by-user", + "summary": "Get user role assignments for a user", + "description": "Returns Role objects enriched with userRoleId for managing role assignments.", + "tags": [ + "user_role" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "Nextcloud user ID", + "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": "User role 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": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + } + }, + "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/forum/api/roles/{roleId}/users": { + "get": { + "operationId": "user_role-by-role", + "summary": "Get users with a specific role", + "tags": [ + "user_role" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "roleId", + "in": "path", + "description": "Role 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": "User roles returned", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + } + }, + "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/forum/api/user-roles": { + "post": { + "operationId": "user_role-create", + "summary": "Assign a role to a user", + "tags": [ + "user_role" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "userId", + "roleId" + ], + "properties": { + "userId": { + "type": "string", + "description": "Nextcloud user ID" + }, + "roleId": { + "type": "integer", + "format": "int64", + "description": "Role ID" + } + } + } + } + } + }, + "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": { + "201": { + "description": "Role assigned to user", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "409": { + "description": "User already has this role", + "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" + } + } + } + } + } + } + } + } + } + }, + "403": { + "description": "Cannot assign guest role to users", + "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/forum/api/user-roles/{id}": { + "delete": { + "operationId": "user_role-destroy", + "summary": "Remove a role from a user", + "tags": [ + "user_role" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "User role 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": "Role removed from user", + "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": [ + "success" + ], + "properties": { + "success": { + "type": "boolean" + } + } + } + } + } + } + } + } + } + }, + "403": { + "description": "Cannot remove guest role from users", + "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/forum/api/admin/repair-seeds": { + "post": { + "operationId": "admin-repair-seeds", + "summary": "Run the repair seeds command to restore default forum data", + "description": "This endpoint requires admin access", + "tags": [ + "admin" + ], + "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": "Seeds repaired 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": [ + "success", + "message" + ], + "properties": { + "success": { + "type": "boolean" + }, + "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": {} + } + } + } + } + } + } + }, + "403": { + "description": "Logged in account must be an admin", + "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/forum/api/admin/roles": { + "get": { + "operationId": "admin-get-roles", + "summary": "Get all available roles", + "description": "This endpoint requires admin access", + "tags": [ + "admin" + ], + "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": "Roles list 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": [ + "roles" + ], + "properties": { + "roles": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + } + } + } + }, + "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": {} + } + } + } + } + } + } + }, + "403": { + "description": "Logged in account must be an admin", + "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/forum/api/admin/users/{userId}/roles": { + "post": { + "operationId": "admin-assign-role", + "summary": "Assign a role to a user", + "description": "This endpoint requires admin access", + "tags": [ + "admin" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "roleId" + ], + "properties": { + "roleId": { + "type": "integer", + "format": "int64", + "description": "The role ID to assign" + } + } + } + } + } + }, + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "The user ID", + "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": "Role assigned 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": [ + "success", + "message" + ], + "properties": { + "success": { + "type": "boolean" + }, + "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": {} + } + } + } + } + } + } + }, + "403": { + "description": "Logged in account must be an admin", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": {} + } + } + } + } + } + } } - } } - } } - } } - } - } - }, - "tags": [ - { - "name": "forum_user", - "description": "Controller for forum users Note: Forum users are automatically created on first post/thread" - } - ] + }, + "tags": [ + { + "name": "forum_user", + "description": "Controller for forum users Note: Forum users are automatically created on first post/thread" + } + ] }