{"record":{"id":"2efd55ddd00a9fda","repo":"RocketChat/Rocket.Chat","slug":"error-room-not-found-2efd55","errorCode":"error-room-not-found","errorMessage":"The required \"roomId\" or \"roomName\" param provided does not match any channel","messagePattern":"The required \"roomId\" or \"roomName\" param provided does not match any channel","errorType":"exception","errorClass":"Meteor.Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/server/api/v1/rooms.ts","lineNumber":127,"sourceCode":"}): Promise<IRoom> {\n\tif (\n\t\t(!('roomId' in params) && !('roomName' in params)) ||\n\t\t('roomId' in params && !(params as { roomId?: string }).roomId && 'roomName' in params && !(params as { roomName?: string }).roomName)\n\t) {\n\t\tthrow new Meteor.Error('error-roomid-param-not-provided', 'The parameter \"roomId\" or \"roomName\" is required');\n\t}\n\n\tconst projection = { ...API.v1.defaultFieldsToExclude };\n\n\tlet room;\n\tif ('roomId' in params) {\n\t\troom = await Rooms.findOneById(params.roomId || '', { projection });\n\t} else if ('roomName' in params) {\n\t\troom = await Rooms.findOneByName(params.roomName || '', { projection });\n\t}\n\n\tif (!room) {\n\t\tthrow new Meteor.Error('error-room-not-found', 'The required \"roomId\" or \"roomName\" param provided does not match any channel');\n\t}\n\tif (checkedArchived && room.archived) {\n\t\tthrow new Meteor.Error('error-room-archived', `The channel, ${room.name}, is archived`);\n\t}\n\n\treturn room;\n}\n\nAPI.v1.get(\n\t'rooms.nameExists',\n\t{\n\t\tauthRequired: true,\n\t\tquery: isGETRoomsNameExists,\n\t\tresponse: {\n\t\t\t200: ajv.compile<{ exists: boolean }>({\n\t\t\t\ttype: 'object',\n\t\t\t\tproperties: {\n\t\t\t\t\texists: { type: 'boolean' },","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/f9d3ec372bb580fa8d036f94cf03925a478ef768/apps/meteor/server/api/v1/rooms.ts#L109-L145","documentation":"Thrown by findRoomByIdOrName when the lookup (Rooms.findOneById for roomId, or Rooms.findOneByName for roomName) returns null. The identifier was provided but matches no room. Returns a structured Meteor.Error('error-room-not-found', ...).","triggerScenarios":"Calling a findRoomByIdOrName-backed endpoint with a roomId/roomName that does not correspond to any channel/private group/dm (typo, deleted room, wrong workspace).","commonSituations":"Stale cached room id/name; room archived+deleted; caller confuses display name with the canonical room name; cross-workspace id.","solutions":["Verify the room via rooms.nameExists or rooms.info before the call.","Refresh the room list the client derived the id/name from.","Distinguish case-sensitive room names and leading/trailing whitespace."],"exampleFix":"// before\nfetch('/api/v1/<endpoint>', { method:'POST', body: JSON.stringify({ roomName }) });\n\n// after\nconst { exists } = await fetch(`/api/v1/rooms.nameExists?roomName=${encodeURIComponent(roomName)}`).then(r=>r.json());\nif (!exists) throw new Error(`room not found: ${roomName}`);\nfetch('/api/v1/<endpoint>', { method:'POST', body: JSON.stringify({ roomName }) });","handlingStrategy":"validation","validationCode":"// Verify the room exists before the operation\nconst { exists } = await fetch(`/api/v1/rooms.nameExists?roomName=${encodeURIComponent(roomName)}`).then(r => r.json());\nif (!exists) throw new Error(`room not found: ${roomName}`);\n// proceed with the findRoomByIdOrName-backed call","typeGuard":null,"tryCatchPattern":"try {\n  await fetch(endpoint).then(r => r.json());\n} catch (e) {\n  if (e.error === 'error-room-not-found') { /* refresh room list; do not retry same id */ }\n}","preventionTips":["Use rooms.nameExists or rooms.info to validate identifiers first.","Mind case sensitivity and whitespace in room names."],"tags":["rooms","rest-api","not-found","validation"],"backgroundTag":null,"analyzedSha":"f9d3ec372bb580fa8d036f94cf03925a478ef768","analyzedAt":"2026-08-12T19:07:17.372Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}