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

# Notifications Overview

> Push notifications via Firebase Cloud Messaging (FCM), in-app inbox, and read receipts.

# Notifications Overview

The Notification service manages real-time in-app alerts, push notifications (FCM), and transaction receipts.

***

## Register Device Token (FCM)

Registers a mobile or web client push token for Firebase Cloud Messaging.

### Endpoint

```http theme={null}
POST /api/v2/notifications/device-token
```

### Headers

```http theme={null}
Authorization: Bearer <jwt_access_token>
```

### Request Body

| Field      | Type     | Required | Description                |
| :--------- | :------- | :------- | :------------------------- |
| `token`    | `string` | **Yes**  | FCM registration token     |
| `platform` | `string` | **Yes**  | `ios`, `android`, or `web` |

```json theme={null}
{
  "token": "fcm_token_string_here_981248...",
  "platform": "ios"
}
```

### Response (201 Created)

```json theme={null}
{
  "success": true,
  "message": "Device token registered successfully"
}
```

***

## Get In-App Notifications

### Endpoint

```http theme={null}
GET /api/v2/notifications
```

### Headers

```http theme={null}
Authorization: Bearer <jwt_access_token>
```

### Response (200 OK)

```json theme={null}
{
  "success": true,
  "data": [
    {
      "id": "notif-uuid-1",
      "title": "Streak Milestone Reached! 🔥",
      "body": "You maintained a 7-day streak and earned 50 Gems!",
      "type": "STREAK_MILESTONE",
      "isRead": false,
      "createdAt": "2026-08-21T18:30:00.000Z"
    }
  ]
}
```

***

## Mark Notification as Read

```http theme={null}
PATCH /api/v2/notifications/:id/read
```
