{ "openapi": "3.0.3", "info": { "title": "twofactor_gateway", "version": "0.0.1", "description": "Two-factor gateway providers (Signal, SMS, Telegram, WhatsApp, XMPP)", "license": { "name": "agpl" } }, "components": { "securitySchemes": { "basic_auth": { "type": "http", "scheme": "basic" }, "bearer_auth": { "type": "http", "scheme": "bearer" } }, "schemas": { "State": { "type": "object", "required": [ "gatewayName", "state", "phoneNumber" ], "properties": { "gatewayName": { "type": "string" }, "state": { "type": "integer", "format": "int64" }, "phoneNumber": { "type": "string", "nullable": true } } } } }, "paths": { "/ocs/v2.php/apps/twofactor_gateway/settings/{gateway}/verification": { "get": { "operationId": "settings-get-verification-state", "summary": "Check if the gateway was configured", "tags": [ "settings" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "gateway", "in": "path", "description": "The gateway name", "required": true, "schema": { "type": "string" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/State" } } } }, "400": { "description": "User not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } }, "503": { "description": "Gateway wasn't configured yed", "content": { "application/json": { "schema": { "type": "object" } } } } } }, "delete": { "operationId": "settings-revoke-verification", "summary": "Disable a gateway", "tags": [ "settings" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "gateway", "in": "path", "description": "The gateway name", "required": true, "schema": { "type": "string" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object" } } } }, "400": { "description": "User not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } } } } }, "/ocs/v2.php/apps/twofactor_gateway/settings/{gateway}/verification/start": { "post": { "operationId": "settings-start-verification", "summary": "Send out confirmation message and save current identifier in user settings", "tags": [ "settings" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "identifier" ], "properties": { "identifier": { "type": "string", "description": "The identifier to use this gateway" } } } } } }, "parameters": [ { "name": "gateway", "in": "path", "description": "The gateway type", "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": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "phoneNumber" ], "properties": { "phoneNumber": { "type": "string", "nullable": true } } } } } }, "400": { "description": "User not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } } } } }, "/ocs/v2.php/apps/twofactor_gateway/settings/{gateway}/verification/finish": { "post": { "operationId": "settings-finish-verification", "summary": "Send out confirmation message and save current identifier in user settings", "tags": [ "settings" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "verificationCode" ], "properties": { "verificationCode": { "type": "string", "description": "Verification code" } } } } } }, "parameters": [ { "name": "gateway", "in": "path", "description": "The gateway type", "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": "OK", "content": { "application/json": { "schema": { "type": "object" } } } }, "400": { "description": "User not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } } } } }, "/index.php/apps/twofactor_gateway/gowhatsapp/webhook": { "post": { "operationId": "go_whats_app_webhook-ingest", "summary": "Ingest a signed GoWhatsApp webhook event for hybrid monitoring", "tags": [ "go_whats_app_webhook" ], "security": [ {}, { "bearer_auth": [] }, { "basic_auth": [] } ], "responses": { "202": { "description": "Event accepted (processed or intentionally skipped)", "content": { "application/json": { "schema": { "type": "object", "required": [ "processed", "message" ], "properties": { "processed": { "type": "boolean" }, "message": { "type": "string" } } } } } }, "400": { "description": "Malformed request body", "content": { "application/json": { "schema": { "type": "object", "required": [ "processed", "message" ], "properties": { "processed": { "type": "boolean" }, "message": { "type": "string" } } } } } }, "401": { "description": "Invalid or missing HMAC signature", "content": { "application/json": { "schema": { "type": "object", "required": [ "processed", "message" ], "properties": { "processed": { "type": "boolean" }, "message": { "type": "string" } } } } } }, "503": { "description": "Webhook ingestion is disabled", "content": { "application/json": { "schema": { "type": "object", "required": [ "processed", "message" ], "properties": { "processed": { "type": "boolean" }, "message": { "type": "string" } } } } } } } } } }, "tags": [] }