RocketChat/Rocket.Chat · error · Meteor.Error
error-room-id-param-not-provided
error-room-id-param-not-provided
Error message
The required "rid" param is missing.
What it means
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.
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.
Example fix
// before
rc.get('/api/v1/chat.ignoreUser', { params: { rid: ` ${rid} `, userId, ignore: 'true' } }); // spaces -> error
// after
rc.get('/api/v1/chat.ignoreUser', { params: { rid: rid.trim(), userId: userId.trim(), ignore: 'true' } }); Defensive patterns
Strategy: validation
Validate before calling
const rid = rawRid?.trim();
if (!rid) throw new Error('rid query param is required');
await rc.get('/api/v1/chat.ignoreUser', { params: { rid, userId, ignore: 'true' } }); Type guard
const isIgnoreUserQuery = (p: { rid?: unknown; userId?: unknown }): p is { rid: string; userId: string } =>
typeof p.rid === 'string' && p.rid.trim().length > 0 &&
typeof p.userId === 'string' && p.userId.trim().length > 0; Try / catch
try {
await rc.get('/api/v1/chat.ignoreUser', { params: { rid, userId, ignore } });
} catch (e) {
if (e?.errorType === 'error-room-id-param-not-provided') disableIgnoreAction();
else throw e;
} Prevention
- 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).
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- error-user-id-param-not-provided
- error-emoji-param-not-provided
- error-param-required
- error-roomId-param-not-provided
- error-searchText-param-not-provided
AI-assisted analysis of RocketChat/Rocket.Chat@e4b8178b20 (2026-08-18).
Data as JSON: /api/errors/11a63d0d82971f11.
Report an issue: GitHub.
Appendix: source
Thrown at apps/meteor/server/api/v1/chat.ts:958
type: 'object',
properties: {
success: { type: 'boolean', enum: [true] },
},
required: ['success'],
additionalProperties: false,
}),
400: validateBadRequestErrorResponse,
401: validateUnauthorizedErrorResponse,
},
},
async function action() {
const { rid, userId } = this.queryParams;
let { ignore = true } = this.queryParams;
ignore = typeof ignore === 'string' ? /true|1/.test(ignore) : ignore;
if (!rid?.trim()) {
throw new Meteor.Error('error-room-id-param-not-provided', 'The required "rid" param is missing.');
}
if (!userId?.trim()) {
throw new Meteor.Error('error-user-id-param-not-provided', 'The required "userId" param is missing.');
}
await ignoreUser(this.userId, { rid, userId, ignore });
return API.v1.success();
},
)
.get(
'chat.getDeletedMessages',
{
authRequired: true,
query: isChatGetDeletedMessagesProps,
response: {
200: ajv.compile<{ messages: Pick<IMessage, '_id'>[]; count: number; offset: number; total: number }>({View on GitHub (pinned to e4b8178b20)