{"record":{"id":"15ce9317d063b03a","repo":"louislam/uptime-kuma","slug":"no-valid-openwa-chat-id-found","errorCode":null,"errorMessage":"No valid OpenWA chat ID found.","messagePattern":"No valid OpenWA chat ID found\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"server/notification-providers/openwa.js","lineNumber":35,"sourceCode":"                text = await this.renderTemplate(customMessage, msg, monitorJSON, heartbeatJSON);\n            }\n\n            let config = {\n                headers: {\n                    Accept: \"application/json\",\n                    \"Content-Type\": \"application/json\",\n                    \"X-Api-Key\": notification.openwaApiKey,\n                },\n            };\n            config = this.getAxiosConfigWithProxy(config);\n\n            const chatIds = (notification.openwaChatId || \"\")\n                .split(\",\")\n                .map((id) => id.trim())\n                .filter((id) => id.length > 0);\n\n            if (chatIds.length === 0) {\n                throw new Error(\"No valid OpenWA chat ID found.\");\n            }\n\n            const baseUrl = notification.openwaApiUrl.replace(/([^/])\\/+$/, \"$1\");\n            const sessionId = encodeURIComponent(notification.openwaSession);\n            const url = `${baseUrl}/api/sessions/${sessionId}/messages/send-text`;\n\n            for (const chatId of chatIds) {\n                await axios.post(\n                    url,\n                    {\n                        chatId,\n                        text,\n                    },\n                    config\n                );\n            }\n\n            return okMsg;","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/louislam/uptime-kuma/blob/6b5ea0155793e666666745fb8d6fef1e829543a2/server/notification-providers/openwa.js#L17-L53","documentation":"OpenWA splits notification.openwaChatId on commas, trims, and filters empty; if nothing remains it throws 'No valid OpenWA chat ID found.' before constructing the per-session send-text URL ({openwaApiUrl}/api/sessions/{session}/messages/send-text). Pure validation guard — no HTTP call occurs when this fires.","triggerScenarios":"openwaChatId is empty, whitespace, or contains only commas; the field was cleared or never set.","commonSituations":"User configured the OpenWA server/session/api key but forgot to enter a chat id; chat id stored under a different field name; config migration left the field empty.","solutions":["Enter at least one valid WhatsApp chat id (e.g. 1234567890@c.us for individuals or a group id) in openwaChatId.","For multiple recipients, separate with commas; remove trailing commas that leave empty entries.","Confirm the OpenWA session is authenticated/running so that, once a chat id is provided, the send-text call can succeed."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const chatIds = String(notification.openwaChatId || \"\")\n    .split(\",\")\n    .map((id) => id.trim())\n    .filter((id) => id.length > 0);\nif (chatIds.length === 0) {\n    throw new Error(\"No valid OpenWA chat ID found.\");\n}","typeGuard":"/** @param {string} id */\nfunction looksLikeWaChatId(id) {\n    return typeof id === \"string\" && /\\d+@(c\\.us|g\\.us)$/.test(id);\n}","tryCatchPattern":null,"preventionTips":["Require at least one chat id at save time.","Validate the @c.us / @g.us suffix format before sending.","Confirm the OpenWA session is authenticated before relying on it."],"tags":["config","validation","openwa","whatsapp","chat-id"],"backgroundTag":null,"analyzedSha":"6b5ea0155793e666666745fb8d6fef1e829543a2","analyzedAt":"2026-08-12T23:42:12.959Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}