From bf59b47b2a893c61ad6d0b60e660c7b79f1d055f Mon Sep 17 00:00:00 2001 From: Chen Asraf Date: Mon, 17 Nov 2025 01:32:49 +0200 Subject: [PATCH] build: exclude openapi from precommit formatting --- .lintstagedrc.cjs | 6 +- openapi.json | 15921 +++++++++++++++++++++++--------------------- 2 files changed, 8477 insertions(+), 7450 deletions(-) diff --git a/.lintstagedrc.cjs b/.lintstagedrc.cjs index 7ab4698..bb3e67f 100644 --- a/.lintstagedrc.cjs +++ b/.lintstagedrc.cjs @@ -1,6 +1,10 @@ module.exports = { '*.{ts,vue}': ['eslint --fix'], - '*.{scss,vue,ts,md,json}': ['prettier --write'], + '*.{scss,vue,ts,md}': ['prettier --write'], + '*.json': (files) => { + const filtered = files.filter(file => !file.includes('openapi.json')); + return filtered.length > 0 ? `prettier --write ${filtered.join(' ')}` : []; + }, '*.php': [() => 'make php-cs-fixer'], '*Controller.php': [() => 'make openapi', () => 'git add openapi.json'], } diff --git a/openapi.json b/openapi.json index f4d338b..0f05b34 100644 --- a/openapi.json +++ b/openapi.json @@ -1,7619 +1,8642 @@ { - "openapi": "3.0.3", - "info": { - "title": "forum", - "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", + "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" - } - } - } - } - } }, - "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/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" - } - } - } - } - } - } - } - } - } - }, - "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/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" - } - } - } - } - } - } - } - } - } - }, - "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": "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" - } - } - } - } - } - } - } - } - }, - "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": "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" - } - } - } - } - } - } - } - } - } - }, - "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-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" - } - } - } - } - } - } - } - } - } - }, - "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/{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" - } - } - } - } - } - } - } - } - }, - "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": "category-update", - "summary": "Update a category", - "tags": ["category"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "requestBody": { - "required": false, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "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" - } - } - } - } - } - } - } - } - }, - "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/{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" - } - } - } - } - } - } - } - } - } - }, - "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/{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" - } - } - } - } - } - } - } - } - } - }, - "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/{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/users": { - "get": { - "operationId": "forum_user-index", - "summary": "Get all user statistics", - "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": "User statistics 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": "forum_user-create", - "summary": "Create user stats Note: This is typically not needed as stats 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": "User stats 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/{userId}": { - "get": { - "operationId": "forum_user-show", - "summary": "Get user statistics by Nextcloud user ID Special case: use \"me\" to get current user stats", - "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": "User 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" - } - } - } - } - } - } - } - } - }, - "404": { - "description": "User has no stats (hasn't posted yet)", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["ocs"], - "properties": { - "ocs": { - "type": "object", - "required": ["meta", "data"], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": { - "type": "object", - "required": ["error"], - "properties": { - "error": { - "type": "string" - } - } - } - } - } - } - } - } - } - }, - "401": { - "description": "User not authenticated (when using \"me\")", - "content": { - "application/json": { - "schema": { - "anyOf": [ + "paths": { + "/ocs/v2.php/apps/forum/api/admin/dashboard": { + "get": { + "operationId": "admin-dashboard", + "summary": "Get dashboard statistics", + "tags": [ + "admin" + ], + "security": [ { - "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" - } - } - } - } - } - } + "bearer_auth": [] }, { - "type": "object", - "required": ["ocs"], - "properties": { - "ocs": { - "type": "object", - "required": ["meta", "data"], - "properties": { - "meta": { - "$ref": "#/components/schemas/OCSMeta" - }, - "data": {} - } - } - } + "basic_auth": [] } - ] - } - } - } - } - } - } - }, - "/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" + ], + "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": "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/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": {} + } + } + } + } } - } } - } } - } } - } } - }, - "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" - } + "/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 } - } } - } - } - } - } - }, - "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" + ], + "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/posts/slug/{slug}": { - "get": { - "operationId": "post-by-slug", - "summary": "Get a post by slug", - "tags": ["post"], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "slug", - "in": "path", - "description": "Post 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": "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": {} + } + } + } + } + } } - } } - } } - } } - }, - "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" - }, - "slug": { - "type": "string", - "nullable": true, - "default": null, - "description": "Post slug (auto-generated if not provided)" - } - } - } - } - } }, - "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" - } + "/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 } - } } - } - } - } - } - }, - "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" + ], + "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": {} + } + } + } + } } - } } - } } - } } - } - } - }, - "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": [] } - } - } - } - } - } - } - } - }, - "/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" + ], + "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" + } + } + } + } + } + }, + "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": {} + } + } + } + } + } + } } - } } - } } - } }, - "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" + "/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": {} - } - } - } - } - } - } - } - } - } - }, - "/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": {} + } + } + } + } } - } } - } } - } } - } - } - }, - "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": { + "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/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" - } + "/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 } - } } - } - } - } - } - }, - "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": "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/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" - } - } - } + "/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 } - } } - } - } - } - } - }, - "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" - } + ], + "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": {} + } + } + } + } } - } } - } } - } } - } } - }, - "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" - } + "/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" } - } - } - } - } - } - } - }, - "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" - } + }, + { + "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/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" + ], + "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": {} - } - } - } - } - } - } - } - } - } - }, - "/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": {} + } + } + } + } } - } } - } } - } } - } - } - }, - "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": {} + } + } + } + } + } + } } - } } - } - } - } - } - }, - "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" - }, - "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" - } + }, + "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": {} + } + } + } + } + } + } + } } - } } - } }, - "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" - } + "/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 } - } } - } - } - } - } - }, - "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" - } + ], + "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" + } + } + } + } + } + } + } + } + } + }, + "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": {} - } + }, + "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": {} + } + } + } + } + } + } } - } } - } } - } - } - }, - "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" - }, - "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" - } + "/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 } - } } - } - } - } - } - }, - "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" + ], + "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" + } + } + } + } + } + } } - } } - } - } - } - } - } - } - }, - "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": {} + } + } + } + } } - } } - } } - } } - } - } - }, - "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": "cat_header-update", + "summary": "Update a category header", + "tags": [ + "cat_header" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] } - } - } - } - } - } - } - }, - "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" + ], + "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": {} + } + } + } + } + } } - } } - } } - } } - } }, - "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" + "/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" + } + } + } + } + } } - } } - } } - } - } - } - } - }, - "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": {} - } + }, + "parameters": [ + { + "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/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" + ], + "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/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" + }, + "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": {} - } - } - } - } - } - } - } - } - }, - "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" - } + "/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 } - } } - } - } - } - } - }, - "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" + ], + "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" + } + } + } + } + } + } + } } - } } - } - } - } - } - } - } - }, - "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/{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" + }, + "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": {} - } + }, + "post": { + "operationId": "category-create", + "summary": "Create a new category", + "tags": [ + "category" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] } - } - } - } - } - } - } - } - }, - "/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" - } + ], + "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" + } + } + } } - } } - } - } - } - } - }, - "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": {} - } + }, + "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": {} + } + } + } + } + } + } } - } } - } } - } - } - }, - "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" - } + "/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 } - } } - } - } - } - } - }, - "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" + ], + "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" + } + } + } + } + } + } + } } - } } - } - } - } - } - } - } - }, - "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" - } + }, + "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": {} - } - } - } - } - } - } - } - } - } - }, - "/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" - } + "/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 } - } } - } - } - } - } - }, - "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": "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" + } + } + } + } + } + } + } + } + }, + "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" - } + }, + "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": { + "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": {} + } + } + } + } + } + } + } } - } } - } }, - "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" - } + "/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" } - } - } - } - } - } - } - }, - "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" - } + }, + { + "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": {} - } - } - } - } - } - } - } - } - }, - "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" + ], + "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" + } + } + } + } + } + } } - } } - } - } - } - } - } - } - }, - "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}/roles": { - "get": { - "operationId": "user_role-by-user", - "summary": "Get roles for a user", - "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 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": {} + } + } + } + } } - } } - } } - } } - } } - }, - "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" - } + "/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 } - } } - } - } - } - } - }, - "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" + ], + "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" + } + } + } + } + } + } + } + } + } + }, + "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": {} - } + }, + "/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" + } + } + } + } + } + } + } + } + } + }, + "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/{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/users": { + "get": { + "operationId": "forum_user-index", + "summary": "Get all user statistics", + "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": "User statistics 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": "forum_user-create", + "summary": "Create user stats Note: This is typically not needed as stats 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": "User stats 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/{userId}": { + "get": { + "operationId": "forum_user-show", + "summary": "Get user statistics by Nextcloud user ID Special case: use \"me\" to get current user stats", + "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": "User 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" + } + } + } + } + } + } + } + } + }, + "404": { + "description": "User has no stats (hasn't posted yet)", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "401": { + "description": "User not authenticated (when using \"me\")", + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "string" + } + } + } + } + } + } + }, + { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": {} + } + } + } + } + ] + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/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" + } + } + } + } + } + } + } + } + } + }, + "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/{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/slug/{slug}": { + "get": { + "operationId": "post-by-slug", + "summary": "Get a post by slug", + "tags": [ + "post" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "slug", + "in": "path", + "description": "Post 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": "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": {} + } + } + } + } + } + } + } + } + } + }, + "/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" + }, + "slug": { + "type": "string", + "nullable": true, + "default": null, + "description": "Post slug (auto-generated if not provided)" + } + } + } + } + } + }, + "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}/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" + }, + "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" + }, + "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" + } + } + } + } + } + } + } + } + } + }, + "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" + } + } + } + } + } + } + } + } + } + }, + "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": { + "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" + } + } + } + } + } + } + } + } + } + }, + "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": "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" + } + } + } + } + } + } + } + } + } + }, + "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/{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" + } + } + } + } + } + } + } + } + } + }, + "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}": { + "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" + } + } + } + } + } + } + } + } + }, + "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": "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" + } + } + } + } + } + } + } + } + }, + "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/users/{userId}/roles": { + "get": { + "operationId": "user_role-by-user", + "summary": "Get roles for a user", + "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 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/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" + } + } + } + } + } + } + } + } + }, + "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" + } + } + } + } + } + } + } + } + } + }, + "401": { + "description": "Current user is not logged in", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": {} + } + } + } + } + } + } } - } } - } } - } } - } - } - }, - "tags": [ - { - "name": "forum_user", - "description": "Controller for user statistics Note: User stats are automatically created on first post/thread" - } - ] + }, + "tags": [ + { + "name": "forum_user", + "description": "Controller for user statistics Note: User stats are automatically created on first post/thread" + } + ] }