Website Change Alerts to WhatsApp: Cloud API Template Relay
Send AyeWatch website change alerts to WhatsApp with Meta's Cloud API: an approved utility template, a signed relay, the 24-hour window rule, and when app push is the better choice.
By AyeWatch Team6 min read
Short answer: To get website change alerts on WhatsApp, run a relay that checks AyeWatch's signed webhook and sends an approved message template through Meta's WhatsApp Cloud API. AyeWatch has no WhatsApp integration, and a business number can send only templates outside the 24-hour customer service window. For alerts to your own phone, AyeWatch's app push is simpler.
Try app push first
If the alerts are for you, install AyeWatch on iOS or Android and turn on push. That takes a few taps. WhatsApp needs a Meta business setup, a phone number for the business, an approved template and a relay, and Meta charges for template messages. The push notification guide covers the app route.
WhatsApp is worth the setup when the person who needs the alert lives in WhatsApp and will not install another app: a shop owner who wants restock news, or a client's staff who coordinate there. AyeWatch cannot use WhatsApp as a source, so it cannot monitor WhatsApp groups or chats; this guide only sends alerts out to WhatsApp.
Why the alert must be a template
Meta's docs describe a 24-hour customer service window that opens when the user messages or calls your business number, and each new message from them resets it. Outside that window, the business can send only approved templates. Page changes arrive whenever the page changes, so plan on a template for every alert.
Every template has a category: authentication, marketing or utility. A page change the recipient asked to hear about fits utility, which Meta reserves for transactional updates tied to something the user did or requested. Meta can move a template with promotional wording to marketing. Template bodies can be up to 1,024 characters, review can take up to 24 hours, and you can send only once the status is approved. A body for this relay, named page_change_alert in English (US):
New update from your page monitor: {{1}}
Source: {{2}}
Meta charges per template message, at rates that vary by category and by the recipient's country, and it has changed those rules more than once since mid-2025. Check its current pricing page before you send at volume.
The relay
A made-up restock alert:
{
"topic_id": 8840,
"topic_name": "https://alderkitchen.example/products/cast-iron-skillet-12",
"update_id": 144512,
"headline": "Alder Kitchen's 12-inch cast iron skillet is back in stock",
"content": "The product page shows the 12-inch skillet as In stock at $54, after showing Sold out since 28 November.",
"created_at": "2026-12-07T15:02:00Z",
"evidence": [
{ "quote": "In stock", "source_url": "https://alderkitchen.example/products/cast-iron-skillet-12" }
]
}
Sample rule: Alert me when the 12-inch cast iron skillet on Alder Kitchen changes from sold out to in stock, or its price drops below $50.
Store AYEWATCH_SECRET, WA_TOKEN, WA_PHONE_NUMBER_ID (the business number's ID from the WhatsApp setup in Meta's developer dashboard), WA_API_VERSION (the Graph API version in Meta's current examples, such as v27.0) and WA_TO, the recipient's number in international format.
export default {
async fetch(request, env) {
// 1. Check X-AyeWatch-Signature against the raw request bytes.
const raw = await request.arrayBuffer();
const header = request.headers.get("x-ayewatch-signature") || "";
const hex = header.startsWith("sha256=") ? header.slice(7) : "";
if (!/^[0-9a-f]{64}$/i.test(hex)) return new Response("Bad signature", { status: 401 });
const sig = new Uint8Array(hex.match(/../g).map((h) => parseInt(h, 16)));
const key = await crypto.subtle.importKey(
"raw",
new TextEncoder().encode(env.AYEWATCH_SECRET),
{ name: "HMAC", hash: "SHA-256" },
false,
["verify"]
);
if (!(await crypto.subtle.verify("HMAC", key, sig, raw))) {
return new Response("Bad signature", { status: 401 });
}
// 2. Skip an update that was already delivered (SEEN is an optional KV namespace).
const e = JSON.parse(new TextDecoder().decode(raw));
const id = String(e.update_id);
if (env.SEEN && (await env.SEEN.get(id))) return new Response("Already sent");
const title = e.headline || e.topic_name;
const link = e.evidence && e.evidence[0] ? e.evidence[0].source_url : "";
// 3. Send the approved template. Each parameter must be one line of text.
const flat = (s) => (s || "").replace(/\s+/g, " ").trim();
const res = await fetch(
"https://graph.facebook.com/" + env.WA_API_VERSION + "/" + env.WA_PHONE_NUMBER_ID + "/messages",
{
method: "POST",
headers: { Authorization: "Bearer " + env.WA_TOKEN, "Content-Type": "application/json" },
body: JSON.stringify({
messaging_product: "whatsapp",
to: env.WA_TO,
type: "template",
template: {
name: "page_change_alert",
language: { code: "en_US" },
components: [
{
type: "body",
parameters: [
{ type: "text", text: flat(title).slice(0, 200) },
{ type: "text", text: flat(link || e.topic_name) },
],
},
],
},
}),
}
);
const ok = res.ok;
if (!ok) return new Response("Destination refused", { status: 502 });
if (env.SEEN) await env.SEEN.put(id, "1", { expirationTtl: 1209600 });
return new Response("OK");
},
};
Developers report that the API refuses a template parameter that contains a newline, a tab or a long run of spaces, so the relay flattens each one to a single line. The temporary access token in Meta's dashboard expires quickly; for a relay that runs for months, create a long-lived token for a system user in your Meta business settings. When Meta refuses a message, the Worker answers 502 and AyeWatch retries with exponential backoff, up to 10 attempts.
No-code routes
Zapier lists a WhatsApp Notifications app whose send step also works from an approved template. n8n and Make have WhatsApp Business steps built on the same Cloud API. The template rules above apply to all of them, so get the template approved before you build the flow. The n8n guide shows the webhook and signature steps to put in front.
What this setup won't do
- Send free text. Outside the 24-hour window, every alert has to fit the approved template. The summary goes in as a single short line.
- Monitor WhatsApp. WhatsApp groups, channels and chats are not AyeWatch sources.
- Message many people for free. The relay sends to one number per request, and each message is billed by Meta. Loop over a short list if a few people need it.
- Beat the schedule. A restock reaches WhatsApp after the next check: hourly on Pro, ASAP mode on Pro+.
Cost and a credit budget
Webhooks need a paid plan, trial included. AyeWatch Pro is $9/mo with 50 topics and hourly checks; Pro+ is $19/mo with 200 topics and ASAP mode. Every plan starts with a 7-day free trial.
A restock monitor with three product pages costs 1 credit a check. Checked every 3 hours, that is 1 × 240 = 240 credits a month, inside Pro's 500. Checked hourly, it is 1 × 720 = 720, which needs Pro+. For the fastest checks on a drop that sells out, Pro+ adds ASAP mode. Meta bills its template messages separately.
WhatsApp alerts in six steps
- Set up the WhatsApp Cloud API in Meta's developer dashboard and note the business phone number ID.
- Submit the page_change_alert template in the utility category and wait for it to be approved.
- Create a long-lived system user token and store it as WA_TOKEN with the other Worker secrets.
- Deploy the relay and set WA_TO to the recipient's number in international format.
- Open Notification settings, Webhook in AyeWatch, paste the relay URL and select Save Webhook. Reveal the signing secret and store it as
AYEWATCH_SECRET. - Create the restock or price monitor in AyeWatch and wait for the first real alert.
| AyeWatch field | Template message part | Note |
|---|---|---|
| headline (or topic_name) | Body parameter {{1}} | Flattened to one line, cut at 200 characters |
| evidence[0].source_url (or topic_name) | Body parameter {{2}} | Flattened to one line |
| Your setting | to | International format |
| Fixed value | template.name | page_change_alert, once approved |
| Fixed value | template.language.code | en_US, matching the approved language |
| update_id | Not sent | KV key that stops a retry from sending twice |
Start a monitor in under a minute
Describe a topic or paste a URL. Cancel before the trial ends and you pay nothing.
Try it free for 7 daysThe bottom line
Submit the template first, because approval is the slow part. While it is in review, deploy the relay and let the monitor run with push on, so you know the rule works before the first WhatsApp message goes out.
FAQ
Can AyeWatch send alerts to WhatsApp directly?
No. AyeWatch has no WhatsApp integration. A relay or an automation tool turns its signed webhook into a WhatsApp Cloud API template message.
Why do WhatsApp alerts need a message template?
Outside the 24-hour customer service window, a WhatsApp business number can send only approved templates. Alerts arrive at any time, so each one uses a template.
Which WhatsApp template category fits a page change alert?
Utility fits a transactional update the recipient asked for. Meta can move a template with promotional wording to the marketing category.
Can AyeWatch monitor WhatsApp groups?
No. WhatsApp groups, channels and chats are not supported as sources. AyeWatch monitors public web pages, the internet and supported social media platforms.
Does WhatsApp charge for alert messages?
Meta charges per template message, at rates that vary by category and country. Check Meta's current WhatsApp pricing before you send at volume.
Is app push easier than WhatsApp for my own alerts?
Yes. AyeWatch's iOS and Android apps send push alerts with no template, relay or per-message charge. WhatsApp makes sense when the recipient will not install the app.