{ "openapi": "3.0.3", "info": { "title": "Notifications", "version": "2.12.1", "description": "This app provides a backend and frontend for the notification API available in Nextcloud.", "license": { "name": "agpl" } }, "servers": [ { "url": "https://{hostname}:{port}/ocs/v1.php/apps/notifications", "variables": { "hostname": { "default": "localhost" }, "port": { "default": "8080" } } } ], "security": [ { "basic_auth": [] } ], "components": { "securitySchemes": { "basic_auth": { "type": "http", "scheme": "basic" } }, "schemas": { "OCSMeta": { "deprecated": true, "description": "Stub" }, "NotificationsEmpty": { "type": "object", "properties": { "ocs": { "type": "object", "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "array", "items": { "type": "string" } } } } } }, "NotificationsNotification": { "type": "object", "properties": { "notification_id": { "type": "integer" }, "app": { "type": "string" }, "user": { "type": "string" }, "datetime": { "type": "string" }, "object_type": { "type": "string" }, "object_id": { "type": "string" }, "subject": { "type": "string" }, "message": { "type": "string" }, "link": { "type": "string" }, "subjectRich": { "type": "string" }, "subjectRichParameters": { "type": "array", "items": { "description": "TODO", "type": "string" } }, "messageRich": { "type": "string" }, "messageRichParameters": { "type": "array", "items": { "description": "TODO", "type": "string" } }, "icon": { "type": "string" }, "actions": { "type": "array", "items": { "$ref": "#/components/schemas/NotificationsNotificationAction" } } } }, "NotificationsNotificationAction": { "type": "object", "properties": { "label": { "type": "string" }, "link": { "type": "string" }, "type": { "type": "string" }, "primary": { "type": "boolean" } } }, "NotificationsListNotifications": { "type": "object", "properties": { "ocs": { "type": "object", "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/NotificationsNotification" } } } } } }, "NotificationsGetNotification": { "type": "object", "properties": { "ocs": { "type": "object", "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "$ref": "#/components/schemas/NotificationsNotification" } } } } }, "NotificationsPushServerSubscription": { "type": "object", "properties": { "publicKey": { "type": "string" }, "deviceIdentifier": { "type": "string" }, "signature": { "type": "string" } } }, "NotificationsPushServerRegistration": { "type": "object", "properties": { "ocs": { "type": "object", "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "$ref": "#/components/schemas/NotificationsPushServerSubscription" } } } } }, "NotificationsPushNotificationDecryptedSubject": { "type": "object", "properties": { "nid": { "type": "integer" }, "app": { "type": "string" }, "subject": { "type": "string" }, "type": { "type": "string" }, "id": { "type": "string" }, "delete": { "type": "boolean" }, "delete-all": { "type": "boolean" } } } } }, "paths": { "/api/v2/notifications": { "get": { "operationId": "list-notifications", "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotificationsListNotifications" } } } } } }, "delete": { "operationId": "delete-all-notifications", "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "type": "string" } } } } } } }, "/api/v2/notifications/{id}": { "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } } ], "get": { "operationId": "get-notification", "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotificationsGetNotification" } } } } } }, "delete": { "operationId": "delete-notification", "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotificationsEmpty" } } } } } } }, "/api/v2/push": { "post": { "operationId": "register-device", "parameters": [ { "name": "pushTokenHash", "in": "query", "required": true, "schema": { "type": "string" } }, { "name": "devicePublicKey", "in": "query", "required": true, "schema": { "type": "string" } }, { "name": "proxyServer", "in": "query", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotificationsPushServerRegistration" } } } } } }, "delete": { "operationId": "remove-device", "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "type": "string" } } } } } } }, "/api/v2/admin_notifications/{userId}": { "parameters": [ { "name": "userId", "in": "path", "required": true, "schema": { "type": "string" } } ], "post": { "operationId": "send-admin-notification", "parameters": [ { "name": "shortMessage", "in": "query", "required": true, "schema": { "type": "string" } }, { "name": "longMessage", "in": "query", "required": false, "schema": { "type": "string", "default": "" } } ], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotificationsEmpty" } } } } } } } } }