> ## 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. # Autocomplete Room Name for Private and Public Rooms > List the public and private rooms whose names match a given string, excluding discussions, DMs, and omnichannel rooms. The endpoint is valuable when performing search operations. It returns only rooms that the user belongs to. ## OpenAPI ````json GET /api/v1/rooms.autocomplete.channelAndPrivate { "openapi": "3.0.0", "info": { "version": "1.0.0", "title": "Rooms" }, "servers": [ { "url": "https://apiexplorer.support.rocket.chat" } ], "tags": [ { "name": "Channels" }, { "name": "Directory" }, { "name": "Groups" }, { "name": "Rooms" }, { "name": "Teams" }, { "name": "Room Invites" }, { "name": "Subscriptions" }, { "name": "ABAC" } ], "paths": { "/api/v1/rooms.autocomplete.channelAndPrivate": { "get": { "tags": [ "Rooms" ], "summary": "Autocomplete Room Name for Private and Public Rooms", "operationId": "get-api-v1-rooms.autocomplete.channelAndPrivate", "parameters": [ { "$ref": "#/components/parameters/Auth-Token" }, { "$ref": "#/components/parameters/UserId" }, { "schema": { "type": "string", "example": "{\"name\":\"ran\"}" }, "in": "query", "name": "selector", "required": true, "description": "The term to be completed. It only applies to room name." } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "items": { "type": "array", "items": { "type": "object", "properties": { "_id": { "type": "string" }, "fname": { "type": "string" }, "name": { "type": "string" }, "t": { "type": "string" } } } }, "success": { "type": "boolean" } } }, "examples": { "Success": { "value": { "items": [ { "_id": "664f0d525df46832f75b1860", "fname": "rancher", "name": "rancher", "t": "p" }, { "_id": "6630e94ad2226209149c67e2", "fname": "random", "name": "random", "t": "c" }, { "_id": "664f148f5df46832f75b18b2", "fname": "ranmowe", "name": "ranmowe", "t": "p" } ], "success": true } } } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "error": { "type": "string" } } }, "examples": { "Selector Param Required": { "value": { "success": false, "error": "The 'selector' param is required" } } } } } }, "401": { "$ref": "#/components/responses/authorizationError" } }, "description": "List the public and private rooms whose names match a given string, excluding discussions, DMs, and omnichannel rooms. The endpoint is valuable when performing search operations. It returns only rooms that the user belongs to." } } }, "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." } } } } } } } } } ````