Skip to content

Website Change Alerts by SMS: Text Alerts Through Twilio

Get AyeWatch website change alerts as text messages. A signed relay sends each alert through Twilio's Messages API, with segment math, US 10DLC registration and the limits.

By AyeWatch Team6 min read

Short answer: To get website change alerts by SMS, point AyeWatch's signed webhook at a small relay that sends each alert as a text through an SMS provider's API, such as Twilio's Messages API. AyeWatch has no SMS delivery of its own. For alerts on your own smartphone, the AyeWatch app's push notifications need no relay at all.

When SMS beats push

AyeWatch delivers alerts by email, push in its iOS and Android app, Slack, the signed webhook and an optional Daily Digest email. If the alert is for you and you carry a smartphone, push is the shorter route; the push guide covers it. SMS earns its setup cost when the recipient will not install an app: a site foreman, a parent, a shared phone on a crew, or someone who reads texts and ignores everything else.

Older guides suggest an email-to-SMS gateway, where you email the carrier's address for a number. Some carriers have shut theirs down, and none report delivery, so test yours before you rely on it. An SMS API tells you whether the provider accepted each message.

A made-up alert from a public bids monitor:

{
  "topic_id": 8951,
  "topic_name": "https://granbycounty.example/bids",
  "update_id": 145067,
  "headline": "Granby County opens bids for the Mill Road bridge repair, due 9 January",
  "content": "The bids page lists a new invitation to bid for the Mill Road bridge deck repair. A site visit is set for 17 December and bids are due on 9 January.",
  "created_at": "2026-12-07T16:05:00Z",
  "evidence": [
    { "quote": "Mill Road Bridge Deck Repair: bids due January 9", "source_url": "https://granbycounty.example/bids" }
  ]
}

Sample rule: Alert me when the Granby County bids page posts a new bid for bridge, road or paving work. Ignore award notices.

The relay

Twilio's Messages API creates a message with a form-encoded POST to https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Messages.json. To is required, the sender is either From or a MessagingServiceSid, and Body can be up to 1,600 characters. Twilio recommends an API key and secret for basic auth in production; the Account SID and Auth Token work for a local test.

Store AYEWATCH_SECRET, TWILIO_ACCOUNT_SID, TWILIO_API_KEY, TWILIO_API_SECRET, TWILIO_FROM and SMS_TO as Worker secrets, with both phone numbers in international format starting with +. SEEN is an optional KV namespace.

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. Text the headline and the link. Short bodies stay in one or two segments.
    const text = title.slice(0, 140) + (link ? " " + link : "");
    const res = await fetch(
      "https://api.twilio.com/2010-04-01/Accounts/" + env.TWILIO_ACCOUNT_SID + "/Messages.json",
      {
        method: "POST",
        headers: {
          Authorization: "Basic " + btoa(env.TWILIO_API_KEY + ":" + env.TWILIO_API_SECRET),
          "Content-Type": "application/x-www-form-urlencoded",
        },
        body: new URLSearchParams({ To: env.SMS_TO, From: env.TWILIO_FROM, Body: text }),
      }
    );
    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");
  },
};

Twilio accepts the message and queues it for the carrier, so a 2xx from the relay means Twilio took it, not that the phone received it. Twilio's console shows delivery status per message. When Twilio refuses, the Worker answers 502 and AyeWatch retries with exponential backoff, up to 10 attempts, with the same update_id.

Keep each alert to one or two segments

Twilio splits text into segments of 160 characters when it fits the GSM-7 character set, or 70 characters when it does not, and charges each segment as a message. One emoji or other character outside GSM-7 switches the whole message to the shorter segments.

That is why the relay sends only the headline, cut at 140 characters, and the source link. A plain headline plus a short link fits in two segments. The full summary stays in AyeWatch's email and app, where it costs nothing extra to read. If your headlines often include curly quotes, replace them with straight ones in the relay before you count.

US numbers and A2P 10DLC

Twilio's docs say anyone sending SMS or MMS over a 10DLC number (a standard 10-digit US number) from an application to the US must register for A2P 10DLC, and that this includes individuals and hobbyists. Twilio warns that unregistered traffic gets extra carrier fees. A relay that texts you about page changes is application traffic, so register before you send to a US number. Toll-free numbers and short codes sit outside 10DLC and have their own approval steps, and other countries have their own sender rules. Check Twilio's page for the country you send to.

What this setup won't do

  • Take replies. A reply to the text goes to Twilio, not to AyeWatch. Change the monitor in the app or on the web.
  • Carry the full summary. Long texts cost more segments. Read the details in email or the app.
  • Guarantee delivery. Carriers can delay or filter messages. For on-call alerts, use PagerDuty.
  • Read pages behind a login. AyeWatch reads public pages. Bid portals that require an account are out of reach; use the portal's own email alerts if it has them.
  • Beat the schedule. A new bid reaches the phone 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 web page monitor with three county bid pages, every 6 hours, is 1 × 120 = 120 credits a month. Add an internet topic monitor for bridge and road bids in the region, daily, at 1 × 30 = 30. The total, 150 credits, fits Pro's 500 with room for more counties. Checked hourly, the bids monitor alone is 720 credits and needs Pro+. Twilio bills each segment and charges for the phone number, so check its pricing for your country.

Text alerts in six steps

  1. Buy or choose a Twilio number and, for US recipients, complete A2P 10DLC registration.
  2. Create an API key and secret in the Twilio Console.
  3. Deploy the relay with the Twilio values, the sender and the recipient as Worker secrets.
  4. Open Notification settings, Webhook in AyeWatch, paste the relay URL and select Save Webhook. Reveal the signing secret and store it as AYEWATCH_SECRET.
  5. Create the monitor in AyeWatch with a narrow rule, because every alert becomes a text.
  6. After the first real alert, check the message's status in the Twilio Console.
AyeWatch fieldTwilio parameterNote
headline (or topic_name)Body, first partCut at 140 characters
evidence[0].source_urlBody, after a spaceLeft out when an update has no evidence
Your settingsTo and FromInternational format with +
contentNot sentRead it in email or the app
update_idNot sentKV key that stops a retry from texting 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 days

The bottom line

Register the number first if you text US recipients, because that is the slow step. Then run the relay against your own phone for a week before you add anyone else.

FAQ

Can AyeWatch send SMS alerts?

Not on its own. AyeWatch delivers by email, app push, Slack, a signed webhook and the Daily Digest email. A relay turns the webhook into a text through an SMS provider such as Twilio.

How long can an SMS alert be?

Twilio accepts a body up to 1,600 characters but splits it into segments of 160 GSM-7 or 70 UCS-2 characters, each billed as a message. Send a headline and a link.

Do I need A2P 10DLC registration to text myself alerts?

Twilio says anyone sending SMS from an application over a US 10DLC number must register for A2P 10DLC, including individuals and hobbyists.

Can I use an email-to-SMS gateway instead of an API?

Some carriers have shut down their email-to-SMS gateways, and the rest give no delivery report. Test yours, or use an SMS API.

Is push easier than SMS for my own phone?

Yes. The AyeWatch app for iOS and Android sends push alerts with no relay, registration or per-message cost.

website change alerts by smstext message when a website changestwilio sms from webhooksms alerts for page changesa2p 10dlc for alerts

Related articles