{ "openapi": "3.0.3", "info": { "title": "Notifications", "version": "2.12.0", "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" }, "NotificationsAdminNotification": { "type": "object", "properties": { "shortMessage": { "type": "string" }, "longMessage": { "type": "string" } } }, "NotificationsEmptyResponse": { "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" } } }, "NotificationsListNotificationsResponse": { "type": "object", "properties": { "ocs": { "type": "object", "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/NotificationsNotification" } } } } } }, "NotificationsGetNotificationResponse": { "type": "object", "properties": { "ocs": { "type": "object", "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "$ref": "#/components/schemas/NotificationsNotification" } } } } }, "NotificationsPushServerDevice": { "type": "object", "properties": { "pushTokenHash": { "type": "string" }, "devicePublicKey": { "type": "string" }, "proxyServer": { "type": "string" } } }, "NotificationsPushServerSubscription": { "type": "object", "properties": { "publicKey": { "type": "string" }, "deviceIdentifier": { "type": "string" }, "signature": { "type": "string" } } }, "NotificationsPushServerRegistrationResponse": { "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/NotificationsListNotificationsResponse" } } } } } }, "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/NotificationsGetNotificationResponse" } } } } } }, "delete": { "operationId": "delete-notification", "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotificationsEmptyResponse" } } } } } } }, "/api/v2/push": { "post": { "operationId": "register-device", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotificationsPushServerDevice" } } } }, "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotificationsPushServerRegistrationResponse" } } } } } }, "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", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotificationsAdminNotification" } } } }, "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotificationsEmptyResponse" } } } } } } } } }