> ## 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 Notification History

> This endpoint allows users to get an account's recent in-app notifications and unread count.

```http theme={null}
POST /api/v1/account/notifications/history
```

This endpoint returns your 100 newest in-app notifications, newest first, and the number of notifications that you haven't seen. Use it to build a notification list or a badge.

* The history has only notifications that Pacifica created with the `in_app` channel on. Push-only notifications aren't in it.
* The endpoint has no pagination. It always returns up to the 100 newest notifications.
* `unread_count` counts every in-app notification that isn't seen, so it can be more than 100.

To mark notifications as seen, call [Mark notifications seen](https://docs.pacifica.fi/api-documentation/api/rest-api/notifications/mark-notifications-seen.md).

#### Operation Type (for Signing)

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

#### 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>`"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,
  "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).

#### Signing

This request has no fields of its own. Sign an empty `data` object:

```json theme={null}
{"data":{},"expiry_window":30000,"timestamp":1716200000000,"type":"get_notification_history"}
```

#### Response

* Status 200: Successfully retrieved notification history

```json theme={null}
{
  "success": true,
  "data": {
    "notifications": [
      {
        "id": 81234,
        "notification_type": "order_filled",
        "title": "Order filled",
        "body": "Your buy BTC order filled at 97000.",
        "data": {
          "notification_type": "order_filled",
          "kind": "order_filled",
          "order_id": "315992721",
          "symbol": "BTC",
          "base_symbol": "BTC",
          "side": "buy",
          "order_type": "limit",
          "price": "97000",
          "filled_amount": "0.01",
          "last_filled_price": "97000"
        },
        "created_at_ms": 1716200000000,
        "read": false
      },
      {
        "id": 81102,
        "notification_type": "deposit_success",
        "title": "Deposit confirmed",
        "body": "Your deposit of 500 USDC is complete.",
        "data": {
          "notification_type": "deposit_success",
          "kind": "deposit_success",
          "history_id": "1840022",
          "asset": "USDC",
          "amount": "500",
          "signature": "5VERv8NM..."
        },
        "created_at_ms": 1716190000000,
        "read": true
      },
      ...
    ],
    "unread_count": 1
  },
  "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>`"notifications"`</td><td>array</td><td>Up to 100 notifications, newest first</td></tr><tr><td>`"unread_count"`</td><td>integer</td><td>Number of in-app notifications that aren't seen</td></tr></tbody></table>

**Notification Fields**

<table><thead><tr><th width="208">Field</th><th width="186">Type</th><th>Description</th></tr></thead><tbody><tr><td>`"id"`</td><td>integer</td><td>Notification ID. Send it to [Mark notifications seen](https://docs.pacifica.fi/api-documentation/api/rest-api/notifications/mark-notifications-seen.md)</td></tr><tr><td>`"notification_type"`</td><td>string</td><td>[Notification type](https://docs.pacifica.fi/api-documentation/api/rest-api/notifications#notification-types), or `"test"`</td></tr><tr><td>`"title"`</td><td>string or null</td><td>Title for display</td></tr><tr><td>`"body"`</td><td>string or null</td><td>Body text for display</td></tr><tr><td>`"data"`</td><td>object</td><td>Details of the event. See [Notification data](https://docs.pacifica.fi/api-documentation/api/rest-api/notifications#notification-data)</td></tr><tr><td>`"created_at_ms"`</td><td>integer</td><td>Timestamp in milliseconds when Pacifica created the notification</td></tr><tr><td>`"read"`</td><td>boolean</td><td>`true` if the notification is marked seen</td></tr></tbody></table>

* Status 400: Invalid request parameters or signature
* Status 403: The account doesn't exist. An account exists after its first deposit
* 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
}

response = requests.post(
    "/api/v1/account/notifications/history",
    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.