[Goto Home](/docs/index.html)

# 🔐 GET `/admin/alert-views/:alertId`

## Description

- Returns a paginated list of users who have viewed a specific alert.
- Results are sorted by `at` descending (most recent first).
- Each view includes the populated `user` with `name`, `username`, and `photo`.

## Request Params

- `alertId` – required, MongoDB ObjectId of the alert.

## Request Query

- `limit` – optional, natural number, default `"20"`, number of items per page
- `page` – optional, natural number, default `"1"`, page number

## Response Body

```json
{
  "views": [
    {
      "_id": "68b3c1f9a74de1099381ef94",
      "user": {
        "_id": "68906b08a3bf95fd187f7a22",
        "name": "John Doe",
        "username": "john.doe",
        "photo": "https://..."
      },
      "alert": "68a2f0f8a64cd0088270de83",
      "at": "2025-10-10T08:22:11.000Z"
    }
  ],
  "count": 1
}
```

## Error Responses

- **400** – `alertId` is not a valid MongoDB ObjectId.
- **404** – Alert not found.

# Links

[Goto Home](/docs/index.html)
