Skip to content
Chatto v0.5.0

PushNotificationService

Chatto exposes this service below /api/connect.

Shared message and enum definitions are documented in Shared Types And Enums.

Browser Web Push subscription commands for the authenticated user.

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/Subscribe

Request to store a PushSubscription returned by the browser Push API.

FieldTypeDescription
endpointstringAbsolute HTTPS push service endpoint URL. The server rejects redirects and destinations that resolve to private or other special-use addresses.
p256dhstringClient P-256 ECDH public key from PushSubscription.keys.p256dh.
authstringAuthentication secret from PushSubscription.keys.auth.
user_agentoptional stringOptional browser user-agent string for device identification.
client_hoststringURL 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_tokenstringRandom 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.

Response from storing a browser push subscription.

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/Unsubscribe

Request to remove a browser push subscription.

FieldTypeDescription
endpointstringPush service endpoint URL to remove.

Response from removing a browser push subscription.

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/SendTestNotification

Request to test the current user’s registered browser push subscriptions.

Result of sending a test Web Push notification.