PushNotificationService
Chatto exposes this service below /api/connect.
Shared message and enum definitions are documented in Shared Types And Enums.
PushNotificationService
Section titled “PushNotificationService”Browser Web Push subscription commands for the authenticated user.
Subscribe
Section titled “Subscribe”Stores or updates the caller’s browser push subscription.
The server must have Web Push configured. Clients normally call this after the browser grants notification permission and returns a PushSubscription. A stored subscription expires 180 days after its most recent save. The client owns the refresh: call Subscribe again when the app starts and at least once a day while it runs, and when the browser replaces the PushSubscription. The server removes expired records itself. Call Unsubscribe to stop delivery before the subscription expires.
POST /api/connect/chatto.api.v1.PushNotificationService/SubscribeInput: SubscribeRequest
Section titled “Input: SubscribeRequest”Request to store a PushSubscription returned by the browser Push API.
| Field | Type | Description |
|---|---|---|
endpoint | string | Absolute HTTPS push service endpoint URL. The server rejects redirects and destinations that resolve to private or other special-use addresses. |
p256dh | string | Client P-256 ECDH public key from PushSubscription.keys.p256dh. |
auth | string | Authentication secret from PushSubscription.keys.auth. |
user_agent | optional string | Optional browser user-agent string for device identification. |
client_host | string | URL host of the Chatto server that supplied the installed web app. The sending server combines this with its own hostname to reconstruct the client route. A host can include a port but no scheme, path, or user info. |
cleanup_token | string | Random per-save capability generated by the client. A cancelled save can later remove only the record carrying this exact token, even when the same browser PushSubscription has since moved to another account. |
Result: SubscribeResponse
Section titled “Result: SubscribeResponse”Response from storing a browser push subscription.
Unsubscribe
Section titled “Unsubscribe”Removes the caller’s browser push subscription by endpoint.
The call is idempotent: removing an unknown endpoint still succeeds.
POST /api/connect/chatto.api.v1.PushNotificationService/UnsubscribeInput: UnsubscribeRequest
Section titled “Input: UnsubscribeRequest”Request to remove a browser push subscription.
| Field | Type | Description |
|---|---|---|
endpoint | string | Push service endpoint URL to remove. |
Result: UnsubscribeResponse
Section titled “Result: UnsubscribeResponse”Response from removing a browser push subscription.
SendTestNotification
Section titled “SendTestNotification”Sends a test notification to the caller’s registered browser subscriptions. Calls are rate-limited per account. Delivery failures return a generic unavailable error without exposing the push provider’s response body.
POST /api/connect/chatto.api.v1.PushNotificationService/SendTestNotificationInput: SendTestNotificationRequest
Section titled “Input: SendTestNotificationRequest”Request to test the current user’s registered browser push subscriptions.
Result: SendTestNotificationResponse
Section titled “Result: SendTestNotificationResponse”Result of sending a test Web Push notification.