# Mark as Unread
> Source: /api-reference/members/notifications/mark-unread
> Mark a specific notification as unread
> Endpoint: PATCH /members/me/notifications/{id}/unread

## Overview [#overview]

Marks a specific notification as unread for the authenticated member. This reverts the notification's read status, removing the read timestamp and affecting the unread count and filtering.

## Authentication [#authentication]

Requires a valid Clerk JWT token in the Authorization header.

## Path Parameters [#path-parameters]

<ParamField path="id" type="number" required>
  Notification ID to mark as unread
</ParamField>

<RequestExample>

```bash cURL
curl -X PATCH "http://localhost:3000/v1/members/me/notifications/1234/unread" \
  -H "Authorization: Bearer YOUR_CLERK_JWT"
```

```typescript TypeScript
const notificationId = 1234;
const response = await fetch(`http://localhost:3000/v1/members/me/notifications/${notificationId}/unread`, {
  method: 'PATCH',
  headers: {
    'Authorization': 'Bearer YOUR_CLERK_JWT'
  }
});

const notification = await response.json();
```

</RequestExample>

## Response [#response]

Returns the updated notification object with the same structure as individual notification items from [Get Notifications](/api-reference/members/notifications/get-notifications).

<ResponseField name="id" type="number" required>
  Notification ID
</ResponseField>

<ResponseField name="type" type="string" required>
  Notification type
</ResponseField>

<ResponseField name="title" type="string">
  Notification title
</ResponseField>

<ResponseField name="message" type="string">
  Notification message
</ResponseField>

<ResponseField name="messageParts" type="object">
  Structured message parts
</ResponseField>

<ResponseField name="isRead" type="boolean" required>
  Read status (will be false after marking as unread)
</ResponseField>

<ResponseField name="isWallet" type="boolean" required>
  Whether this is a wallet-related notification
</ResponseField>

<ResponseField name="metadata" type="object">
  Additional notification metadata
</ResponseField>

<ResponseField name="createdAt" type="string" required>
  ISO 8601 timestamp when notification was created
</ResponseField>

<ResponseField name="updatedAt" type="string" required>
  ISO 8601 timestamp when notification was last updated (updated when marked as unread)
</ResponseField>

<ResponseField name="readAt" type="string">
  ISO 8601 timestamp when notification was marked as read (will be null after marking as unread)
</ResponseField>

<ResponseExample>

```json 200 Response - Successfully Marked as Unread
{
  "id": 1234,
  "type": "wallet",
  "title": "Points Earned",
  "message": "You earned 2,500 points from your recent stay at Luxury Resort Bali",
  "messageParts": {
    "action": "points_earned",
    "amount": 2500,
    "source": "reservation",
    "propertyName": "Luxury Resort Bali"
  },
  "isRead": false,
  "isWallet": true,
  "metadata": {
    "reservationId": "550e8400-e29b-41d4-a716-446655440000",
    "propertyId": "prop_luxury_resort_bali",
    "pointsType": "VALID"
  },
  "createdAt": "2024-04-20T10:30:00Z",
  "updatedAt": "2024-04-20T16:45:00Z",
  "readAt": null
}
```

```json 404 Response - Not Found
{
  "statusCode": 404,
  "message": "Notification not found"
}
```

</ResponseExample>

## Behavior [#behavior]

### Read Status Revert [#read-status-revert]
- **isRead**: Changes from true to false
- **readAt**: Set to null (removed)
- **updatedAt**: Updated to current timestamp

### Already Unread [#already-unread]
- **No Error**: Returns 200 even if notification was already unread
- **Idempotent**: Safe to call multiple times
- **Timestamp**: updatedAt timestamp is updated to the most recent call

### Ownership Validation [#ownership-validation]
- **Member Check**: Only the notification owner can mark it as unread
- **Security**: Returns 404 if notification doesn't belong to authenticated member

## Use Cases [#use-cases]

### Undo Read Action [#undo-read-action]
```typescript
// Mark notification as unread to bring it back to user's attention
const markNotificationUnread = async (notificationId: number) => {
  try {
    const response = await fetch(`/api/members/me/notifications/${notificationId}/unread`, {
      method: 'PATCH'
    });
    
    if (response.ok) {
      // Update local state
      updateNotificationInList(notificationId, { isRead: false, readAt: null });
      // Update unread count
      incrementUnreadCount();
    }
  } catch (error) {
    console.error('Failed to mark notification as unread:', error);
  }
};
```

### Bulk Unread Operations [#bulk-unread-operations]
```typescript
// Mark multiple notifications as unread
const markMultipleAsUnread = async (notificationIds: number[]) => {
  const promises = notificationIds.map(id => 
    fetch(`/api/members/me/notifications/${id}/unread`, { method: 'PATCH' })
  );
  
  await Promise.allSettled(promises);
  // Refresh notification list and unread count
  refreshNotifications();
};
```

### Admin/Support Actions [#adminsupport-actions]
```typescript
// Support workflow to mark important notifications as unread for user review
const flagForUserReview = async (notificationId: number) => {
  // Mark as unread to ensure user sees it again
  await markNotificationUnread(notificationId);
  
  // Optionally add metadata to track admin action
  await updateNotificationMetadata(notificationId, {
    flaggedForReview: true,
    flaggedBy: 'support',
    flaggedAt: new Date().toISOString()
  });
};
```

## Impact on Other Endpoints [#impact-on-other-endpoints]

### Unread Count [#unread-count]
- **Increased**: Marking as unread increases the unread count by 1
- **Immediate**: Count is updated immediately
- **Filtered**: Affects both general and filtered counts (wallet=true)

### Notification List [#notification-list]
- **Filtering**: Notification will appear in `read=false` filter
- **Will Not Appear**: Notification will no longer appear in `read=true` filter
- **Timestamps**: Updated updatedAt and removed readAt reflect the change

## Related Endpoints [#related-endpoints]

- [Mark as Read](/api-reference/members/notifications/mark-read) - Mark notification as read
- [Get Unread Count](/api-reference/members/notifications/get-unread-count) - Check updated count
- [Get Notifications](/api-reference/members/notifications/get-notifications) - View updated notification list
