> ## 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. # Search Message > Search for messages by room ID and text message. ### Changelog | Version | Description | | -------------| ------------| | 0.67.0 | Changed limit query parameter to count| | 0.60.0 | Added | ## OpenAPI ````json GET /api/v1/chat.search { "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.search": { "get": { "tags": [ "Chat" ], "summary": "Search Message", "description": "Search for messages by room ID and text message. \n\n### Changelog\n| Version | Description | \n| -------------| ------------|\n| 0.67.0 | Changed limit query parameter to count|\n| 0.60.0 | Added |\n", "operationId": "get-api-v1-chat.search", "parameters": [ { "$ref": "#/components/parameters/Auth-Token" }, { "$ref": "#/components/parameters/UserId" }, { "$ref": "#/components/parameters/count" }, { "$ref": "#/components/parameters/offset" }, { "name": "roomId", "in": "query", "description": "The room ID.", "required": true, "schema": { "type": "string" } }, { "name": "searchText", "in": "query", "description": "The text to search for in messages.", "required": true, "schema": { "type": "string" } } ], "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" } } }, "mentions": { "type": "array", "items": { "type": "object" } }, "channels": { "type": "array", "items": { "type": "object" } }, "_updatedAt": { "type": "string" }, "score": { "type": "number" } } } }, "success": { "type": "boolean" } } }, "examples": { "Example 1": { "value": { "messages": [ { "_id": "px9KLW9G2SfD5DKFt", "rid": "GENERAL", "msg": "this is a test", "ts": "2018-03-27T14:44:00.549Z", "u": { "_id": "RtMDEYc28fQ5aHpf4", "username": "marc.dev", "name": "Marc Dev" }, "mentions": [], "channels": [], "_updatedAt": "2018-03-27T14:44:00.55Z", "score": 0.5833333333333334 } ], "success": true } } } } } }, "401": { "$ref": "#/components/responses/authorizationError" }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "error": { "type": "string" }, "errorType": { "type": "string" } } }, "examples": { "Missing roomId": { "value": { "success": false, "error": "The required \"roomId\" query param is missing. [error-roomId-param-not-provided]", "errorType": "error-roomId-param-not-provided" } }, "Missing searchText": { "value": { "success": false, "error": "The required \"searchText\" query param is missing. [error-searchText-param-not-provided]", "errorType": "error-searchText-param-not-provided" } } } } } } } } } }, "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" }, "count": { "name": "count", "in": "query", "description": "The number of items to return. Refer to the [official documentation](https://developer.rocket.chat/apidocs/query-parameters#pagination) to learn more.", "required": false, "schema": { "type": "integer" }, "example": 50 }, "offset": { "name": "offset", "in": "query", "description": "Number of items to \"skip\" in the query, i.e. requests return count items, skipping the first offset items. Refer to the [official documentation](https://developer.rocket.chat/apidocs/query-parameters#pagination) to learn more.", "required": false, "schema": { "type": "integer" }, "example": 50 } }, "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." } } } } } } } } } ````