> ## Documentation Index > Fetch the complete documentation index at: https://developer.rocket.chat/llms.txt > Use this file to discover all available pages before exploring further. # Get Multiple Messages From Different Rooms > Fetches up to 100 messages by ID in a single request. The messages can belong to different rooms. IDs that do not match a visible message are skipped. You must have access to every room containing the requested messages. This endpoint replaces the deprecated `getMessages` Realtime API method, which will be removed in 9.0.0. ### Changelog | Version | Description | | ------- | ----------- | | 8.9.0 | Added | ## OpenAPI ````json POST /api/v1/chat.getMessages { "openapi": "3.0.0", "info": { "version": "1.0.0", "title": "Messaging" }, "servers": [ { "url": "https://apiexplorer.support.rocket.chat" } ], "tags": [ { "name": "Chat" }, { "name": "Direct Messages" }, { "name": "Auto-Translate" } ], "paths": { "/api/v1/chat.getMessages": { "post": { "tags": [ "Chat" ], "summary": "Get Multiple Messages From Different Rooms", "description": "Fetches up to 100 messages by ID in a single request. The messages can belong to different rooms. IDs that do not match a visible message are skipped. You must have access to every room containing the requested messages.\n\nThis endpoint replaces the deprecated `getMessages` Realtime API method, which will be removed in 9.0.0.\n\n\n### Changelog\n| Version | Description |\n| ------- | ----------- |\n| 8.9.0 | Added |", "operationId": "post-api-v1-chat.getMessages", "parameters": [ { "$ref": "#/components/parameters/Auth-Token" }, { "$ref": "#/components/parameters/UserId" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "messageIds" ], "additionalProperties": false, "properties": { "messageIds": { "type": "array", "description": "The IDs of the messages to fetch.", "example": [ "Xq8sLpW3nZr2TmKeA", "Bv5nTq7RkWz3YpLcD" ], "minItems": 1, "maxItems": 100, "items": { "type": "string", "minLength": 1 } } } }, "examples": { "Example": { "value": { "messageIds": [ "Xq8sLpW3nZr2TmKeA", "Bv5nTq7RkWz3YpLcD" ] } } } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "messages": { "type": "array", "items": { "type": "object", "properties": { "_id": { "type": "string" }, "rid": { "type": "string" }, "msg": { "type": "string" }, "ts": { "type": "string" }, "u": { "type": "object", "properties": { "_id": { "type": "string" }, "username": { "type": "string" }, "name": { "type": "string" } } }, "_updatedAt": { "type": "string" }, "mentions": { "type": "array", "items": { "type": "object" } }, "channels": { "type": "array", "items": { "type": "object" } } } } }, "success": { "type": "boolean" } } }, "examples": { "Success Example": { "value": { "messages": [ { "_id": "Xq8sLpW3nZr2TmKeA", "rid": "6GFJ3tbmHiyHbahmC", "msg": "The release checklist is ready for review.", "ts": "2026-09-23T10:05:00Z", "u": { "_id": "rbAXPnMktTFbNpwtJ", "username": "dana.reyes", "name": "Dana Reyes" }, "_updatedAt": "2026-09-23T10:05:00Z", "mentions": [], "channels": [] }, { "_id": "Bv5nTq7RkWz3YpLcD", "rid": "GENERAL", "msg": "Standup moved to 10:30 today.", "ts": "2026-09-22T08:15:00Z", "u": { "_id": "kP3wQz8LmNvT5rXyB", "username": "sam.okafor", "name": "Sam Okafor" }, "_updatedAt": "2026-09-22T08:15:00Z", "mentions": [], "channels": [] } ], "success": true } } } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "error": { "type": "string" }, "errorType": { "type": "string" } } }, "examples": { "Missing Parameter": { "value": { "success": false, "error": "must have required property 'messageIds' [invalid-params]", "errorType": "invalid-params" } } } } } }, "401": { "$ref": "#/components/responses/authorizationError" }, "403": { "description": "Forbidden. At least one of the messages belongs to a room you cannot access.", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "error": { "type": "string" } } }, "examples": { "Permission Error": { "value": { "success": false, "error": "unauthorized" } } } } } }, "404": { "description": "Not Found. None of the IDs match a visible message.", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "error": { "type": "string" } } }, "examples": { "Not Found": { "value": { "success": false, "error": "Resource not found" } } } } } } } } } }, "components": { "parameters": { "Auth-Token": { "name": "X-Auth-Token", "in": "header", "description": "The `authToken` of the authenticated user.", "required": true, "schema": { "type": "string" }, "example": "RScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f" }, "UserId": { "name": "X-User-Id", "in": "header", "description": "The `userId` of the authenticated user.", "required": true, "schema": { "type": "string" }, "example": "rbAXPnMktTFbNpwtJ" } }, "responses": { "authorizationError": { "description": "Unauthorized", "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "string" }, "message": { "type": "string" } } }, "examples": { "Authorization Error": { "value": { "status": "error", "message": "You must be logged in to do this." } } } } } } } } } ````