List messages in a room
Access: Bearer token required.
Messages from one room with soft-deleted messages removed and senderId populated (firstName, lastName, avatar, email). Messages are returned in stored order, oldest first, and the window is taken from the start of the conversation: offset=0&limit=50 is the first (oldest) 50 messages, not the latest 50. To page towards newer messages increase offset. Only participants of the room can read it; anyone else, and any unknown or deleted room id, gets a 403. Fetching does not mark messages as read.
Envelope: chat endpoints do not use the standard {status, success, message, data} wrapper. Success bodies are {success, data} and the handler's own 400s are {success: false, message}; only errors that fall through to the global error middleware get the standard error envelope.
bearerAuthAuthorizationBearer <JWT>Access token returned by sign-in. Send it as Authorization: Bearer <token>.
roomId*stringObjectId of the chat room.
limit?integerMaximum number of messages to return. Not capped.
50offset?integerNumber of non-deleted messages to skip, counted from the oldest message.
0Messages, oldest first
application/json- response
success*booleandata*array<>curl -X GET 'http://localhost:4000/api/v1/chat/rooms/string/messages'{ "success": true, "data": [ { "senderId": { "_id": "665f1c2e9b1d4a0012ab34c4", "firstName": "Amaka", "lastName": "Eze", "avatar": "https://res.cloudinary.com/example/image/upload/v1717500000/homelinkhub/media/amaka.jpg", "email": "amaka.eze@example.com" }, "content": "Good afternoon, is the flat still available for inspection this Saturday?", "messageType": "TEXT", "readBy": [], "deletedAt": null, "editedAt": null, "replyToId": null, "_id": "6660a7d49b1d4a0012ab3551", "createdAt": "2026-06-05T14:02:10.107Z", "updatedAt": "2026-06-05T14:02:10.107Z" } ]}
HomeLink Hub