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

# 🔒 GET `/community-members`

## Description

- Returns community members that the authenticated user **has not followed yet** (excluding the current user, already-followed users, and terminated users).
- Users are returned with only `name`, `username`, and `photo` fields.
- **Ordering:** Users with a profile photo first, then the rest; within each group, ordered by join time (`at`) descending.
- Uses **cursor-based pagination** so results stay consistent as the user follows people (offset-based pages would shift).
- Terminated users are never included.

## Request Query

- **community** – required, MongoDB ObjectId of the community.
- **limit** – optional, default `"20"`, natural number; max items per page (capped at 100).
- **cursor** – optional; opaque cursor for the next page (returned as `nextCursor` in the previous response).

## Response Body

```json
{
  "users": [
    {
      "_id": "68906b08a3bf95fd187f7a22",
      "name": "QA User",
      "username": "qa_user",
      "photo": "https://pub-569168ecc9d940c3892a9d7197875513.r2.dev/users/68906b08a3bf95fd187f7a22/photo.jpg"
    }
  ],
  "nextCursor": "1_2025-03-05T12:00:00.000Z_68906b08a3bf95fd187f7a22"
}
```

- **users** – array of user objects (only `_id`, `name`, `username`, `photo`).
- **nextCursor** – present only when there are more results; send this as the `cursor` query parameter for the next page.

## Notes

- Results are ordered: (1) users with `photo` first, (2) then users without; within each group by join time (`at`) descending.
- Only users with **both** `name` and `username` set (non-empty) are included.
- Cursor format is opaque; do not construct or parse it on the client.
- If the provided `community` is invalid, the API returns `400 Bad Request`.

# Links

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