RocketChat/Rocket.Chat · warning · Meteor.Error

error-endpoint-disabled

error-endpoint-disabled

Error message

This endpoint is disabled

What it means

dmMessagesOthersAction (GET im.messages.others) is gated by the server setting 'API_Enable_Direct_Message_History_EndPoint'. When its value is not strictly true, the endpoint throws error-endpoint-disabled with route '/api/v1/im.messages.others'. This is a deliberate feature flag, not a runtime fault.

Source

Thrown at apps/meteor/server/api/v1/im.ts:792

	required: ['ims', 'offset', 'count', 'total', 'success'],
	additionalProperties: false,
});

const dmMessagesOthersEndpointsProps = {
	authRequired: true as const,
	permissionsRequired: ['view-room-administration'],
	response: {
		200: paginatedMessagesResponseSchema,
		400: validateBadRequestErrorResponse,
		401: validateUnauthorizedErrorResponse,
		403: validateForbiddenErrorResponse,
	},
};

const dmMessagesOthersAction = <Path extends string>(_name: Path): TypedAction<typeof dmMessagesOthersEndpointsProps, Path> =>
	async function action() {
		if (settings.get('API_Enable_Direct_Message_History_EndPoint') !== true) {
			throw new Meteor.Error('error-endpoint-disabled', 'This endpoint is disabled', {
				route: '/api/v1/im.messages.others',
			});
		}

		const { roomId } = this.queryParams;
		if (!roomId) {
			throw new Meteor.Error('error-roomid-param-not-provided', 'The parameter "roomId" is required');
		}

		const room = await Rooms.findOneById<Pick<IRoom, '_id' | 't'>>(roomId, { projection: { _id: 1, t: 1 } });
		if (!room || room?.t !== 'd') {
			throw new Meteor.Error('error-room-not-found', `No direct message room found by the id of: ${roomId}`);
		}

		const { offset, count } = await getPaginationItems(this.queryParams);
		const { sort, fields, query } = await this.parseJsonQuery();
		const ourQuery = Object.assign({}, query, { rid: room._id });

View on GitHub (pinned to f9d3ec372b)

Solutions

  1. Ask a workspace admin to enable Settings > General > API_Enable_Direct_Message_History_EndPoint.
  2. If you cannot enable it, use im.history for the calling user's own messages instead.
  3. Check the setting via settings.get or the API before calling the endpoint.

Example fix

// before
GET /api/v1/im.messages.others?roomId=abc // disabled by default

// after (admin enables the setting)
GET /api/v1/im.messages.others?roomId=abc
Defensive patterns

Strategy: try-catch

Validate before calling

// Check the feature flag first (requires admin read on settings)
const enabled = (await api.get('/api/v1/settings/API_Enable_Direct_Message_History_EndPoint')).data.value;
if (enabled !== true) {
  throw new Error('im.messages.others is disabled on this workspace');
}

Try / catch

try {
  await api.get('/api/v1/im.messages.others', { params: { roomId } });
} catch (e) {
  if (e.response?.data?.error === 'error-endpoint-disabled') {
    // fall back to im.history for the caller's own messages
  } else throw e;
}

Prevention

When it happens

Trigger: Calling GET /api/v1/im.messages.others on a workspace where the admin setting API_Enable_Direct_Message_History_EndPoint is false or unset (the default).

Common situations: Privacy-sensitive deployments disable this endpoint by default; the calling integration assumed the feature was on; workspace was hardened by an admin.

Related errors


AI-assisted analysis of RocketChat/Rocket.Chat@f9d3ec372b (2026-08-12). Data as JSON: /api/errors/3df1cf14e5cd509f. Report an issue: GitHub.