{"record":{"id":"11a63d0d82971f11","repo":"RocketChat/Rocket.Chat","slug":"error-room-id-param-not-provided","errorCode":"error-room-id-param-not-provided","errorMessage":"The required \"rid\" param is missing.","messagePattern":"The required \"rid\" param is missing\\.","errorType":"exception","errorClass":"Meteor.Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/server/api/v1/chat.ts","lineNumber":958,"sourceCode":"\t\t\t\t\ttype: 'object',\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tsuccess: { type: 'boolean', enum: [true] },\n\t\t\t\t\t},\n\t\t\t\t\trequired: ['success'],\n\t\t\t\t\tadditionalProperties: false,\n\t\t\t\t}),\n\t\t\t\t400: validateBadRequestErrorResponse,\n\t\t\t\t401: validateUnauthorizedErrorResponse,\n\t\t\t},\n\t\t},\n\t\tasync function action() {\n\t\t\tconst { rid, userId } = this.queryParams;\n\t\t\tlet { ignore = true } = this.queryParams;\n\n\t\t\tignore = typeof ignore === 'string' ? /true|1/.test(ignore) : ignore;\n\n\t\t\tif (!rid?.trim()) {\n\t\t\t\tthrow new Meteor.Error('error-room-id-param-not-provided', 'The required \"rid\" param is missing.');\n\t\t\t}\n\n\t\t\tif (!userId?.trim()) {\n\t\t\t\tthrow new Meteor.Error('error-user-id-param-not-provided', 'The required \"userId\" param is missing.');\n\t\t\t}\n\n\t\t\tawait ignoreUser(this.userId, { rid, userId, ignore });\n\n\t\t\treturn API.v1.success();\n\t\t},\n\t)\n\t.get(\n\t\t'chat.getDeletedMessages',\n\t\t{\n\t\t\tauthRequired: true,\n\t\t\tquery: isChatGetDeletedMessagesProps,\n\t\t\tresponse: {\n\t\t\t\t200: ajv.compile<{ messages: Pick<IMessage, '_id'>[]; count: number; offset: number; total: number }>({","sourceCodeStart":940,"sourceCodeEnd":976,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/e4b8178b205510181a96ceefee043d0abcd13e5a/apps/meteor/server/api/v1/chat.ts#L940-L976","documentation":"Thrown by GET chat.ignoreUser (apps/meteor/server/api/v1/chat.ts:953) when rid is missing or trims to empty (!rid?.trim()), with error-room-id-param-not-provided. Note the stricter check than schema: the query schema (isChatIgnoreUserProps) requires rid with minLength 1, so a whitespace-only rid (' ') passes schema but fails this trim check. rid here is the room id, passed as a query param on this GET endpoint.","triggerScenarios":"GET /api/v1/chat.ignoreUser?rid=%20&userId=...&ignore=true (whitespace rid), or missing rid on servers without query validation. Also passing the room name instead of the id does not fail here but fails later - here it is strictly absence/blankness of rid.","commonSituations":"URL templates where the room id variable is blank for DMs or unset rooms; whitespace introduced by copy-paste into configuration; integrations that store rid with surrounding whitespace after import.","solutions":["Send a real room id: GET /api/v1/chat.ignoreUser?rid=GENERAL&userId=<target>&ignore=true.","Trim room ids when you capture/store them so the check never fires.","For DMs, resolve the rid from the subscriptions/rooms endpoints first.","Validate rid?.trim() client-side before issuing the call."],"exampleFix":"// before\nrc.get('/api/v1/chat.ignoreUser', { params: { rid: ` ${rid} `, userId, ignore: 'true' } }); // spaces -> error\n\n// after\nrc.get('/api/v1/chat.ignoreUser', { params: { rid: rid.trim(), userId: userId.trim(), ignore: 'true' } });","handlingStrategy":"validation","validationCode":"const rid = rawRid?.trim();\nif (!rid) throw new Error('rid query param is required');\nawait rc.get('/api/v1/chat.ignoreUser', { params: { rid, userId, ignore: 'true' } });","typeGuard":"const isIgnoreUserQuery = (p: { rid?: unknown; userId?: unknown }): p is { rid: string; userId: string } =>\n  typeof p.rid === 'string' && p.rid.trim().length > 0 &&\n  typeof p.userId === 'string' && p.userId.trim().length > 0;","tryCatchPattern":"try {\n  await rc.get('/api/v1/chat.ignoreUser', { params: { rid, userId, ignore } });\n} catch (e) {\n  if (e?.errorType === 'error-room-id-param-not-provided') disableIgnoreAction();\n  else throw e;\n}","preventionTips":["The handler rejects whitespace-only values even though schema accepts them - always trim.","Pass the room id (rid), not the room name, and send ignore as the string 'true'/'false' (GET endpoint)."],"tags":["rocket-chat","rest-api","ignore-user","missing-parameter","chat-ignoreuser"],"backgroundTag":"missing-required-argument","analyzedSha":"e4b8178b205510181a96ceefee043d0abcd13e5a","analyzedAt":"2026-08-18T15:26:39.429Z","contentChangedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}