> ## 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.

# Unregister Expo Device

> This endpoint allows users to stop push notifications to an Expo push token or app installation.

```http theme={null}
POST /api/v1/account/notifications/expo/device/unregister
```

This endpoint turns off an Expo push token for your account. Pacifica stops sending `mobile_push` notifications to it. Call it when the user signs out of the app.

#### Operation Type (for Signing)

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

#### Request Body

<table><thead><tr><th width="200">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>`"expo_push_token"`</td><td>string</td><td>optional</td><td>Expo push token to turn off. Up to 512 characters</td><td>`ExponentPushToken[xxxx]`</td></tr><tr><td>`"device_id"`</td><td>string</td><td>optional</td><td>Installation key. Turns off the tokens of this installation. Up to 256 characters</td><td>`b7f3c1a9...`</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,
  "device_id": "b7f3c1a9e2d84f60b1c5a7e9f3d2c4b8",
  "expiry_window": 30000
}
```

Send `expo_push_token` or `device_id`. If you send both, Pacifica uses `expo_push_token` only. Leave out the field that you don't send, in the request and in the signed `data`.

Pacifica turns off only tokens of the signing account. An unknown token or `device_id` doesn't cause an error.

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).

To get notifications on the device again, call [Register Expo device](https://docs.pacifica.fi/api-documentation/api/rest-api/notifications/register-expo-device.md).

#### Response

* Status 200: Token turned off

```json theme={null}
{
  "success": true,
  "data": null,
  "error": null,
  "code": null
}
```

* Status 400: Invalid request parameters or signature. A token with a bad format returns `error_id` `invalid_expo_push_token`. A request without `expo_push_token` or `device_id` returns this error:

```json theme={null}
{
  "success": false,
  "data": null,
  "error": "Either expo_push_token or device_id is required",
  "code": 400,
  "error_id": "unspecified"
}
```

* 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,
    "device_id": "b7f3c1a9e2d84f60b1c5a7e9f3d2c4b8"
}

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