{"openapi":"3.1.0","info":{"contact":{"email":"hi@hedia.com","name":"Hedia ApS","url":"https://hedia.com"},"termsOfService":"https://www.hedia.com/terms-and-conditions","title":"Notification Service API","version":"1.0.0"},"servers":[{"url":"https://notification.hedia.com/api/v1"}],"tags":[{"name":"Devices","description":"Manage devices","externalDocs":{"url":"https://developer.hedia.com/services/notification/api/v1/operations#devices","description":"Documentation"}},{"name":"Notifications","description":"Manage notifications","externalDocs":{"url":"https://developer.hedia.com/services/notification/api/v1/operations#notifications","description":"Documentation"}}],"paths":{"/devices/{deviceId}":{"delete":{"summary":"Delete Device","description":"Deletes a device for push notifications.","operationId":"deleteDevice","parameters":[{"$ref":"#/components/parameters/DeviceIdPathParameter"}],"responses":{"204":{"$ref":"#/components/responses/NoContent"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"default":{"$ref":"#/components/responses/InternalServerError"}},"security":[{"app":[]}],"tags":["Devices"],"externalDocs":{"url":"https://developer.hedia.com/services/notification/api/v1/operations/deleteDevice","description":"Documentation"}},"put":{"summary":"Set Device","description":"Sets a device for push notifications.","operationId":"setDevice","parameters":[{"$ref":"#/components/parameters/DeviceIdPathParameter"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetDeviceRequestBody"}}}},"responses":{"204":{"$ref":"#/components/responses/NoContent"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"default":{"$ref":"#/components/responses/InternalServerError"}},"security":[{"accessToken":[]}],"tags":["Devices"],"externalDocs":{"url":"https://developer.hedia.com/services/notification/api/v1/operations/setDevice","description":"Documentation"}}},"/users/{userId}/notifications":{"get":{"summary":"List user notifications","description":"List notifications created by the current application for a user.","operationId":"listUserNotifications","parameters":[{"$ref":"#/components/parameters/UserIdPathParameter"},{"$ref":"#/components/parameters/LimitQueryParameter"},{"$ref":"#/components/parameters/OrderQueryParameter"},{"$ref":"#/components/parameters/SkipQueryParameter"},{"$ref":"#/components/parameters/TypesQueryParameter"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationList"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"default":{"$ref":"#/components/responses/InternalServerError"}},"security":[{"app":[]}],"tags":["Notifications"],"externalDocs":{"url":"https://developer.hedia.com/services/notification/api/v1/operations/listUserNotifications","description":"Documentation"}},"post":{"summary":"Create user notification","description":"Creates a notification for a user.","operationId":"createUserNotification","parameters":[{"$ref":"#/components/parameters/UserIdPathParameter"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUserNotificationRequestBody"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Notification"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"default":{"$ref":"#/components/responses/InternalServerError"}},"security":[{"app":[]}],"tags":["Notifications"],"externalDocs":{"url":"https://developer.hedia.com/services/notification/api/v1/operations/createUserNotification","description":"Documentation"}}}},"components":{"securitySchemes":{"accessToken":{"description":"An OAuth2 Access Token.","type":"http","scheme":"bearer","bearerFormat":"JWT"},"app":{"description":"An App Token.","type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"DeviceId":{"title":"Device ID","type":"string","format":"uuid","examples":["3f483b7c-ae82-44ac-94f1-0820861fef29"],"$id":"./components/schemas/DeviceId","externalDocs":{"url":"https://developer.hedia.com/services/notification/api/v1/components/schemas/DeviceId","description":"Documentation"}},"DevicePlatform":{"title":"Device Platform","description":"The platform of the device.","type":"string","enum":["android","ios"],"$id":"./components/schemas/DevicePlatform","externalDocs":{"url":"https://developer.hedia.com/services/notification/api/v1/components/schemas/DevicePlatform","description":"Documentation"}},"DeviceToken":{"title":"Device Token","description":"The device token used for push notifications.","type":"string","minLength":1,"maxLength":512,"$id":"./components/schemas/DeviceToken","externalDocs":{"url":"https://developer.hedia.com/services/notification/api/v1/components/schemas/DeviceToken","description":"Documentation"}},"SetDeviceRequestBody":{"title":"Set Device Request Body","type":"object","properties":{"platform":{"$ref":"#/components/schemas/DevicePlatform"},"token":{"$ref":"#/components/schemas/DeviceToken"}},"required":["platform","token"],"additionalProperties":false,"$id":"./components/schemas/SetDeviceRequestBody","externalDocs":{"url":"https://developer.hedia.com/services/notification/api/v1/components/schemas/SetDeviceRequestBody","description":"Documentation"}},"ProblemDetails":{"title":"Problem Details","description":"A problem details object provides additional information about a problem that occurred during an API request.","type":"object","properties":{"type":{"type":"string","description":"A URI reference that identifies the problem type.","examples":["/problems/unauthorized","about:blank"]},"title":{"type":"string","description":"A short, human-readable summary of the problem type.","examples":["Unauthorized"]},"status":{"type":"number","description":"The HTTP status code generated by the origin server for this occurrence of the problem.","examples":[401]},"detail":{"type":"string","description":"A human-readable explanation specific to this occurrence of the problem.","examples":["You must authenticate and provide the necessary permissions to access this resource. Please check your credentials or token."]}},"required":["type"],"$id":"./components/schemas/ProblemDetails","externalDocs":{"url":"https://developer.hedia.com/services/notification/api/v1/components/schemas/ProblemDetails","description":"Documentation"}},"UserId":{"title":"User ID","type":"string","format":"uuid","examples":["3f483b7c-ae82-44ac-94f1-0820861fef29"],"$id":"./components/schemas/UserId","externalDocs":{"url":"https://developer.hedia.com/services/notification/api/v1/components/schemas/UserId","description":"Documentation"}},"Limit":{"title":"Limit","type":"number","maximum":100,"minimum":1,"default":10,"$id":"./components/schemas/Limit","externalDocs":{"url":"https://developer.hedia.com/services/notification/api/v1/components/schemas/Limit","description":"Documentation"}},"Order":{"title":"Order","type":"string","enum":["asc","desc"],"default":"asc","$id":"./components/schemas/Order","externalDocs":{"url":"https://developer.hedia.com/services/notification/api/v1/components/schemas/Order","description":"Documentation"}},"Skip":{"title":"Skip","type":"number","minimum":0,"default":0,"$id":"./components/schemas/Skip","externalDocs":{"url":"https://developer.hedia.com/services/notification/api/v1/components/schemas/Skip","description":"Documentation"}},"NotificationType":{"title":"Notification Type","description":"Type of the notification. Will be sent as a channel ID on Android devices.","type":"string","maxLength":256,"minLength":1,"examples":["cgm.high"],"$id":"./components/schemas/NotificationType","externalDocs":{"url":"https://developer.hedia.com/services/notification/api/v1/components/schemas/NotificationType","description":"Documentation"}},"NotificationTypes":{"title":"Notification Types","description":"List of notification types","type":"array","items":{"$ref":"#/components/schemas/NotificationType"},"uniqueItems":true,"$id":"./components/schemas/NotificationTypes","externalDocs":{"url":"https://developer.hedia.com/services/notification/api/v1/components/schemas/NotificationTypes","description":"Documentation"}},"NotificationId":{"title":"Notification ID","type":"string","format":"uuid","examples":["3f483b7c-ae82-44ac-94f1-0820861fef29"],"$id":"./components/schemas/NotificationId","externalDocs":{"url":"https://developer.hedia.com/services/notification/api/v1/components/schemas/NotificationId","description":"Documentation"}},"AppId":{"title":"App ID","type":"string","format":"uuid","examples":["3f483b7c-ae82-44ac-94f1-0820861fef29"],"$id":"./components/schemas/AppId","externalDocs":{"url":"https://developer.hedia.com/services/notification/api/v1/components/schemas/AppId","description":"Documentation"}},"PushNotificationTitle":{"title":"Push Notification Title","description":"The title of a push notification. This title is typically displayed in the notification center or on the lock screen.","type":"string","minLength":1,"maxLength":128,"examples":["New Message"],"$id":"./components/schemas/PushNotificationTitle","externalDocs":{"url":"https://developer.hedia.com/services/notification/api/v1/components/schemas/PushNotificationTitle","description":"Documentation"}},"PushNotificationBody":{"title":"Push Notification Body","description":"The body of a push notification. This text is typically displayed below the title in the notification center or on the lock screen.","type":"string","minLength":1,"maxLength":512,"examples":["You have a new message in your inbox."],"$id":"./components/schemas/PushNotificationBody","externalDocs":{"url":"https://developer.hedia.com/services/notification/api/v1/components/schemas/PushNotificationBody","description":"Documentation"}},"PushNotificationPriority":{"title":"Push Notification Priority","description":"The priority level of the push notification. Influences how fast the notification is delivered to the device.","type":"string","default":"normal","enum":["high","normal","low"],"$id":"./components/schemas/PushNotificationPriority","externalDocs":{"url":"https://developer.hedia.com/services/notification/api/v1/components/schemas/PushNotificationPriority","description":"Documentation"}},"PushNotificationSound":{"title":"Push Notification Sound","description":"The sound file name to be used for a push notification. The file must be included in the app bundle, please refer to the platform documentation for more details.","type":"string","minLength":1,"maxLength":128,"examples":["notification.mp3"],"$id":"./components/schemas/PushNotificationSound","externalDocs":{"url":"https://developer.hedia.com/services/notification/api/v1/components/schemas/PushNotificationSound","description":"Documentation"}},"PushNotificationData":{"title":"Push Notification Data","description":"Push notifications are sent to mobile devices.","type":"object","properties":{"title":{"$ref":"#/components/schemas/PushNotificationTitle"},"body":{"$ref":"#/components/schemas/PushNotificationBody"},"priority":{"$ref":"#/components/schemas/PushNotificationPriority"},"sound":{"$ref":"#/components/schemas/PushNotificationSound"}},"required":["title","body"],"additionalProperties":false,"$id":"./components/schemas/PushNotificationData","externalDocs":{"url":"https://developer.hedia.com/services/notification/api/v1/components/schemas/PushNotificationData","description":"Documentation"}},"WebNotificationMessage":{"title":"Message","description":"The notification message to be sent via web notification.","type":"string","maxLength":256,"$id":"./components/schemas/WebNotificationMessage","externalDocs":{"url":"https://developer.hedia.com/services/notification/api/v1/components/schemas/WebNotificationMessage","description":"Documentation"}},"WebNotificationData":{"title":"Web Notification Data","description":"Web notifications are displayed in the browser.","type":"object","properties":{"message":{"$ref":"#/components/schemas/WebNotificationMessage"}},"required":["message"],"additionalProperties":false,"$id":"./components/schemas/WebNotificationData","externalDocs":{"url":"https://developer.hedia.com/services/notification/api/v1/components/schemas/WebNotificationData","description":"Documentation"}},"NotificationData":{"title":"Notification Data","description":"Data for a notification per channel.","type":"object","properties":{"push":{"$ref":"#/components/schemas/PushNotificationData"},"web":{"$ref":"#/components/schemas/WebNotificationData"}},"required":["web"],"additionalProperties":false,"$id":"./components/schemas/NotificationData","externalDocs":{"url":"https://developer.hedia.com/services/notification/api/v1/components/schemas/NotificationData","description":"Documentation"}},"MetadataBoolean":{"title":"Metadata Boolean","type":"boolean","examples":[true],"$id":"./components/schemas/MetadataBoolean","externalDocs":{"url":"https://developer.hedia.com/services/notification/api/v1/components/schemas/MetadataBoolean","description":"Documentation"}},"MetadataNumber":{"title":"Metadata Number","type":"number","examples":[100],"$id":"./components/schemas/MetadataNumber","externalDocs":{"url":"https://developer.hedia.com/services/notification/api/v1/components/schemas/MetadataNumber","description":"Documentation"}},"MetadataString":{"title":"Metadata String","type":"string","maxLength":128,"examples":["abc"],"$id":"./components/schemas/MetadataString","externalDocs":{"url":"https://developer.hedia.com/services/notification/api/v1/components/schemas/MetadataString","description":"Documentation"}},"NotificationMetadata":{"title":"Notification Metadata","description":"The metadata for a notification.","type":"object","default":{},"additionalProperties":{"oneOf":[{"$ref":"#/components/schemas/MetadataBoolean"},{"$ref":"#/components/schemas/MetadataNumber"},{"$ref":"#/components/schemas/MetadataString"}]},"maxProperties":16,"$id":"./components/schemas/NotificationMetadata","externalDocs":{"url":"https://developer.hedia.com/services/notification/api/v1/components/schemas/NotificationMetadata","description":"Documentation"}},"Date":{"title":"Date","type":"string","format":"date-time","examples":["2023-10-05T14:48:00.000Z"],"$id":"./components/schemas/Date","externalDocs":{"url":"https://developer.hedia.com/services/notification/api/v1/components/schemas/Date","description":"Documentation"}},"SecurityPrincipalId":{"title":"Security Principal Id","anyOf":[{"$ref":"#/components/schemas/AppId"},{"$ref":"#/components/schemas/UserId"}],"$id":"./components/schemas/SecurityPrincipalId","externalDocs":{"url":"https://developer.hedia.com/services/notification/api/v1/components/schemas/SecurityPrincipalId","description":"Documentation"}},"SecurityPrincipalType":{"title":"Security Principal Type","type":"string","enum":["app","system","user"],"$id":"./components/schemas/SecurityPrincipalType","externalDocs":{"url":"https://developer.hedia.com/services/notification/api/v1/components/schemas/SecurityPrincipalType","description":"Documentation"}},"SecurityPrincipal":{"title":"Security Principal","type":"object","properties":{"id":{"$ref":"#/components/schemas/SecurityPrincipalId"},"type":{"$ref":"#/components/schemas/SecurityPrincipalType"}},"required":["id","type"],"additionalProperties":false,"$id":"./components/schemas/SecurityPrincipal","externalDocs":{"url":"https://developer.hedia.com/services/notification/api/v1/components/schemas/SecurityPrincipal","description":"Documentation"}},"Created":{"title":"Created","description":"Information about the creation of the notification.","type":"object","properties":{"at":{"$ref":"#/components/schemas/Date"},"by":{"$ref":"#/components/schemas/SecurityPrincipal"}},"required":["at","by"],"additionalProperties":false,"$id":"./components/schemas/Created","externalDocs":{"url":"https://developer.hedia.com/services/notification/api/v1/components/schemas/Created","description":"Documentation"}},"Notification":{"title":"Notification","type":"object","properties":{"id":{"$ref":"#/components/schemas/NotificationId"},"appId":{"$ref":"#/components/schemas/AppId"},"userId":{"$ref":"#/components/schemas/UserId"},"type":{"$ref":"#/components/schemas/NotificationType"},"data":{"$ref":"#/components/schemas/NotificationData"},"metadata":{"$ref":"#/components/schemas/NotificationMetadata"},"created":{"$ref":"#/components/schemas/Created"}},"required":["id","appId","userId","type","data","metadata","created"],"additionalProperties":false,"$id":"./components/schemas/Notification","externalDocs":{"url":"https://developer.hedia.com/services/notification/api/v1/components/schemas/Notification","description":"Documentation"}},"NotificationList":{"title":"Notification List","description":"List of notifications","type":"array","items":{"$ref":"#/components/schemas/Notification"},"$id":"./components/schemas/NotificationList","externalDocs":{"url":"https://developer.hedia.com/services/notification/api/v1/components/schemas/NotificationList","description":"Documentation"}},"CreateUserNotificationRequestBody":{"title":"Create User Notification Request Body","type":"object","properties":{"data":{"$ref":"#/components/schemas/NotificationData"},"metadata":{"$ref":"#/components/schemas/NotificationMetadata"},"type":{"$ref":"#/components/schemas/NotificationType"}},"required":["data","type"],"additionalProperties":false,"$id":"./components/schemas/CreateUserNotificationRequestBody","externalDocs":{"url":"https://developer.hedia.com/services/notification/api/v1/components/schemas/CreateUserNotificationRequestBody","description":"Documentation"}}},"parameters":{"DeviceIdPathParameter":{"name":"deviceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/DeviceId"}},"UserIdPathParameter":{"name":"userId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/UserId"}},"LimitQueryParameter":{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit"}},"OrderQueryParameter":{"name":"order","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Order"}},"SkipQueryParameter":{"name":"skip","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Skip"}},"TypesQueryParameter":{"name":"types","in":"query","required":false,"schema":{"$ref":"#/components/schemas/NotificationTypes"}}},"responses":{"InternalServerError":{"description":"Internal Server Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"NoContent":{"description":"No Content"},"BadRequest":{"description":"Bad Request","content":{"application/json":{},"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"Unauthorized":{"description":"Unauthorized","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"Forbidden":{"description":"Forbidden","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"externalDocs":{"url":"https://developer.hedia.com/","description":"Documentation"}}