louislam/uptime-kuma · error · Error

VKTeams API returned error: ${response.data.description}

Error message

VKTeams API returned error: ${response.data.description}

What it means

Thrown by the VKTeams (MyTeam) provider when response.data.ok === false. The VKTeams Bot API wraps outcomes in {ok:boolean, description:string}; ok:false with a description indicates the request was processed but rejected (auth, chat, content).

Source

Thrown at server/notification-providers/vkteams.js:38

            if (notification.vkteamsUseTemplate && notification.vkteamsTemplate) {
                rawParams.text = await this.renderTemplate(
                    notification.vkteamsTemplate,
                    msg,
                    monitorJSON,
                    heartbeatJSON
                );

                if (notification.vkteamsTemplateFormat && notification.vkteamsTemplateFormat !== "plain") {
                    rawParams.parseMode = notification.vkteamsTemplateFormat;
                }
            }

            const params = new URLSearchParams(rawParams).toString();
            const config = this.getAxiosConfigWithProxy({});
            const response = await axios.get(`${baseUrl}/bot/v1/messages/sendText?${params}`, config);
            if (response.data?.ok === false) {
                throw new Error(`VKTeams API returned error: ${response.data.description}`);
            }

            return okMsg;
        } catch (error) {
            this.throwGeneralAxiosError(error);
        }
    }
}

module.exports = VKTeams;

View on GitHub (pinned to 6b5ea01557)

Solutions

  1. Re-create the bot token in VKTeams Bot platform and update notification.vkteamsBotToken.
  2. Confirm vkteamsChatId is correct and the bot is a member of that chat (send any message from the bot manually to verify).
  3. If using vkteamsTemplateFormat, ensure the value ('HTML' or 'Markdown') matches the body content; set to 'plain' to disable parsing.
  4. Reset vkteamsBaseUrl to the default (https://myteam.mail.ru) if it was customized.
Defensive patterns

Strategy: validation

Validate before calling

// Pre-flight required VKTeams fields
if (!notification.vkteamsBotToken) throw new Error("VKTeams bot token is required");
if (!notification.vkteamsChatId) throw new Error("VKTeams chatId is required");
if (notification.vkteamsBaseUrl) {
    try { new URL(notification.vkteamsBaseUrl); } catch { throw new Error("vkteamsBaseUrl is not a valid URL"); }
}

Type guard

/** True when the VKTeams body signals failure with a description. */
function isVkTeamsFailure(data) {
    return data && typeof data === "object" && data.ok === false && typeof data.description === "string";
}

Try / catch

try {
    const response = await axios.get(url, config);
    if (response.data?.ok === false) {
        throw new Error(`VKTeams API returned error: ${response.data.description ?? "no description"}`);
    }
} catch (err) {
    this.throwGeneralAxiosError(err);
}

Prevention

When it happens

Trigger: Invalid/expired bot token, chatId that does not exist or the bot was not added to, text exceeds the length limit, parseMode set to an unsupported value, or vkteamsBaseUrl pointing at the wrong host.

Common situations: Bot removed from the chat, token regenerated in MyTeam admin but not updated, vkteamsBaseUrl overridden to a deprecated domain, or HTML parseMode used on plain text with unescaped markup.

Related errors


AI-assisted analysis of louislam/uptime-kuma@6b5ea01557 (2026-08-12). Data as JSON: /api/errors/81bf1c536365944b. Report an issue: GitHub.