# `Chatto.Api.V1.PushNotificationService`
[🔗](https://github.com/xtian/elixir-chatto/blob/v0.1.0/lib/chatto/generated/chatto_api_v1_push_notification_service.ex#L3)

Browser Web Push subscription commands for the authenticated user.

# `send_test_notification`

```elixir
@spec send_test_notification(
  Req.Request.t(),
  Chatto.Api.V1.SendTestNotificationRequest.t()
) ::
  {:ok, Chatto.Api.V1.SendTestNotificationResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

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.

# `subscribe`

```elixir
@spec subscribe(Req.Request.t(), Chatto.Api.V1.SubscribeRequest.t()) ::
  {:ok, Chatto.Api.V1.SubscribeResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

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.

# `unsubscribe`

```elixir
@spec unsubscribe(Req.Request.t(), Chatto.Api.V1.UnsubscribeRequest.t()) ::
  {:ok, Chatto.Api.V1.UnsubscribeResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Removes the caller's browser push subscription by endpoint.

The call is idempotent: removing an unknown endpoint still succeeds.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
