# Unregister Device Token

Remove a device's FCM token so it stops receiving push notifications.

## Overview

Call this when the user signs out, before discarding the access token, so notifications don't keep arriving on a device that is no longer signed in — especially on shared devices.

## Endpoint

### `DELETE /v1/notifications/device-token`

Authentication: bearer token required.

Removes the given FCM device token.

**Request body**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `fcmToken` | string | yes | The FCM token that was registered for this device |

**Responses**

`200` OK

```json
{ "success": true, "message": "Device token unregistered successfully" }
```

## Implementation

```javascript
async function signOut(accessToken, fcmToken) {
  if (fcmToken) {
    try {
      await fetch('https://api.aureahub.com/v1/notifications/device-token', {
        method: 'DELETE',
        headers: { Authorization: `Bearer ${accessToken}`, 'Content-Type': 'application/json' },
        body: JSON.stringify({ fcmToken })
      });
    } catch (err) {
      console.warn('Could not unregister the push token', err); // don't block sign-out
    }
  }
  clearLocalSession();
}
```

---

Web version: https://docs.aureahub.com/#notif-unregister
