RocketChat/Rocket.Chat · error · Error
invalid-chart-name
Error message
invalid-chart-name
What it means
Thrown by GET /api/v1/livechat/analytics/agent-overview when the `name` query parameter is missing or empty. The route's param schema treats name as optional, so validation passes, but the handler then requires it to select which agent-overview chart to compute. Valid names are the agent overview chart actions: Total_conversations, Avg_chat_duration, Total_messages, Avg_first_response_time, Best_first_response_time, Avg_response_time, Avg_reaction_time (apps/meteor/server/services/omnichannel-analytics/AgentData.ts:44). A present-but-unknown name does NOT throw — it returns 200 with an empty body.
Solutions
- Include a valid chart name: GET /api/v1/livechat/analytics/agent-overview?from=2024-01-01&to=2024-01-31&name=Total_conversations
- Use one of the exact snake_case names: Total_conversations, Avg_chat_duration, Total_messages, Avg_first_response_time, Best_first_response_time, Avg_response_time, Avg_reaction_time
- Remember the caller needs the view-livechat-manager permission or you get 403 before this check
Example fix
// before
request.get(api('livechat/analytics/agent-overview')).query({ from, to });
// after
request.get(api('livechat/analytics/agent-overview')).query({ from, to, name: 'Total_conversations' }); Defensive patterns
Strategy: validation
Validate before calling
const AGENT_CHARTS = ['Total_conversations','Avg_chat_duration','Total_messages','Avg_first_response_time','Best_first_response_time','Avg_response_time','Avg_reaction_time'] as const;
const name = AGENT_CHARTS.includes(selected) ? selected : AGENT_CHARTS[0];
await fetch(`${server}/api/v1/livechat/analytics/agent-overview?from=${from}&to=${to}&name=${name}`, { headers }); Type guard
const AGENT_CHART_NAMES = new Set(['Total_conversations','Avg_chat_duration','Total_messages','Avg_first_response_time','Best_first_response_time','Avg_response_time','Avg_reaction_time']); const isAgentChartName = (n: string | undefined): n is string => !!n && AGENT_CHART_NAMES.has(n);
Try / catch
if (!name) throw new TypeError('chart name required'); // fail fast client-side
const body = await (await fetch(url, { headers })).json();
if (!body.success && body.error === 'invalid-chart-name') { /* re-ask user to pick a chart */ } Prevention
- Model chart names as a const tuple in your client, not free strings
- Never issue the request until a chart is selected in the UI
When it happens
Trigger: GET /api/v1/livechat/analytics/agent-overview?from=2024-01-01&to=2024-01-31 with no name, or name= (empty string). Happens when a dashboard client builds the chart list dynamically and requests metadata without a selected chart.
Common situations: Custom dashboard integrations that iterate charts and accidentally issue one request with an unset name; scripts copied from docs where name was on a wrapped line and got dropped.
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
- The "customFields" query parameter must be a valid JSON.
- error-invalid-param
- error-invalid-room
- error-param-not-provided
- error-roomId-param-invalid
AI-assisted analysis of RocketChat/Rocket.Chat@2a7de45707 (2026-08-18).
Data as JSON: /api/errors/65d88119a3bdcb8f.
Report an issue: GitHub.
Appendix: source
Thrown at apps/meteor/server/api/v1/omnichannel/statistics.ts:20
import { isLivechatAnalyticsAgentOverviewProps, isLivechatAnalyticsOverviewProps } from '@rocket.chat/rest-typings';
import { API } from '../..';
import { getAgentOverviewDataCached, getAnalyticsOverviewDataCached } from '../../../lib/omnichannel/AnalyticsTyped';
import { settings } from '../../../settings';
API.v1.addRoute(
'livechat/analytics/agent-overview',
{
authRequired: true,
permissionsRequired: ['view-livechat-manager'],
validateParams: isLivechatAnalyticsAgentOverviewProps,
},
{
async get() {
const { name, departmentId, from, to } = this.queryParams;
if (!name) {
throw new Error('invalid-chart-name');
}
const user = await Users.findOneById(this.userId, { projection: { _id: 1, utcOffset: 1 } });
return API.v1.success(
await getAgentOverviewDataCached({
departmentId,
utcOffset: user?.utcOffset || 0,
daterange: { from, to },
chartOptions: { name },
executedBy: this.userId,
}),
);
},
},
);
API.v1.addRoute(
'livechat/analytics/overview',View on GitHub (pinned to 2a7de45707)