> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pacifica.fi/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Web Push Subscription Status

> This endpoint allows users to check if a browser installation gets Web Push notifications.

```http theme={null}
POST /api/v1/account/notifications/web_push/subscription/status
```

This endpoint returns the state of one browser's push subscription on your account. Call it when the page loads to find out if you must subscribe again.

#### Operation Type (for Signing)

| Header Field | Type | Content |
| - | - | - |
| `"type"` | string | `"get_web_push_subscription"` |

#### Request Body

<table><thead><tr><th width="176">Field</th><th width="98">Type</th><th width="95">Need</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td>`"account"`</td><td>string</td><td>required</td><td>User's wallet address</td><td>`42trU9A5...`</td></tr><tr><td>`"signature"`</td><td>string</td><td>required</td><td>Cryptographic signature</td><td>`5j1Vy9Uq...`</td></tr><tr><td>`"timestamp"`</td><td>integer</td><td>required</td><td>Current timestamp in milliseconds</td><td>`1716200000000`</td></tr><tr><td>`"installation_id"`</td><td>string</td><td>required</td><td>The browser's installation ID from [Register Web Push subscription](https://docs.pacifica.fi/api-documentation/api/rest-api/notifications/register-web-push-subscription.md)</td><td>`k3Jx9_Qm...`</td></tr><tr><td>`"expiry_window"`</td><td>integer</td><td>optional</td><td>Signature expiry in milliseconds</td><td>`30000`</td></tr><tr><td>`"agent_wallet"`</td><td>string</td><td>optional</td><td>Agent wallet address</td><td>`69trU9A5...`</td></tr></tbody></table>

```json theme={null}
{
  "account": "42trU9A5...",
  "signature": "5j1Vy9Uq...",
  "timestamp": 1716200000000,
  "installation_id": "k3Jx9_Qm2LpV7nRt4WcY8bZa1HdF6sGe",
  "expiry_window": 30000
}
```

You can sign this request with the account key or with an [agent wallet](https://docs.pacifica.fi/api-documentation/api/signing/api-agent-keys.md).

#### Response

* Status 200: Successfully retrieved the subscription state

```json theme={null}
{
  "success": true,
  "data": {
    "subscription_id": "3f1c2a7e-9b4d-4e8a-8c2f-6d5b1a0e9f47",
    "state": "active",
    "vapid_public_key": "BF6x0Kq2..."
  },
  "error": null,
  "code": null
}
```

<table><thead><tr><th width="208">Field</th><th width="186">Type</th><th>Description</th></tr></thead><tbody><tr><td>`"subscription_id"`</td><td>UUID or null</td><td>Subscription ID. `null` when `"state"` is `"not_registered"`</td></tr><tr><td>`"state"`</td><td>string</td><td>Subscription state (see below)</td></tr><tr><td>`"vapid_public_key"`</td><td>string or null</td><td>VAPID public key that the subscription was registered with. `null` when `"state"` is `"not_registered"`</td></tr></tbody></table>

**Subscription States**

| `state` | Meaning | What to do |
| - | - | - |
| `active` | Pacifica sends Web Push to this browser | Nothing |
| `not_registered` | This installation has no subscription on this account | Register if the user wants Web Push |
| `disabled` | The subscription was unregistered, replaced by a newer one over the limit, or reported gone by the push service | Subscribe again only if the user asks |
| `expired` | The subscription's expiration time has passed | Subscribe again and register |
| `key_rotated` | The subscription uses an older VAPID key | Subscribe again with the current key and register |

* Status 400: Invalid request parameters or signature. A bad `installation_id` returns `error_id` `invalid_notification_device_id`
* Status 403: The account doesn't exist. An account exists after its first deposit
* Status 409: Web Push isn't available (`web_push_disabled`)
* Status 429: Rate limit exceeded
* Status 500: Internal server error

#### Code Example (Python)

```python theme={null}
import requests

payload = {
    "account": "42trU9A5...",
    "signature": "5j1Vy9Uq...",
    "timestamp": 1716200000000,
    "installation_id": "k3Jx9_Qm2LpV7nRt4WcY8bZa1HdF6sGe"
}

response = requests.post(
    "/api/v1/account/notifications/web_push/subscription/status",
    json=payload,
    headers={"Content-Type": "application/json"}
)

data = response.json()
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.