Skip to main content
GET
/
api
/
room_members
/
<room_id>
Get Room Members
curl --request GET \
  --url 'https://api.example.com/api/room_members/<room_id>' \
  --header 'Authorization: <authorization>'
{
  "members": [
    {}
  ]
}

Overview

Returns a list of all usernames that are members of the specified chat room. Any authenticated user can view the member list of any room.

Authentication

Requires a valid authentication token in the Authorization header.

Request

Headers

Authorization
string
required
User authentication token

Path Parameters

room_id
integer
required
The ID of the room to retrieve members from

Response

members
array
Array of usernames who are members of the room

Status Codes

  • 200: Successfully retrieved member list
  • 401: Unauthorized - invalid or missing token
  • 404: No members in this room (room may not exist)

Error Responses

Invalid Token

{
  "error": "invalid token, please re-login"
}

Unauthorized

{
  "error": "unauthorized"
}

No Members Found

{
  "error": "no members in this room"
}

Example

curl -X GET https://api.mirage.com/api/room_members/42 \
  -H "Authorization: your-auth-token"

Success Response

{
  "members": [
    "john_doe",
    "jane_smith",
    "alice_wonder",
    "bob_builder"
  ]
}

Notes

  • Any authenticated user can view the member list of any room.
  • The room creator is automatically included as a member.
  • If no members exist, a 404 error is returned (this typically means the room doesn’t exist).
  • Members are returned as a simple array of username strings.

Build docs developers (and LLMs) love