Skip to content

Website Change Alerts to Salesforce: Tasks on the Right Account

Log AyeWatch alerts, such as a target account's new hire or new site, as Salesforce Tasks on that Account. A signed relay uses the client credentials flow and the REST API.

By AyeWatch Team6 min read

Short answer: To send website change alerts to Salesforce, point AyeWatch's signed webhook at a relay that gets a token with the OAuth client credentials flow and creates a Task on the matching Account through the REST API. AyeWatch has no Salesforce app. The relay maps each monitor to an Account, so reps see the signal where they already work.

Signals worth logging

Account-based sales teams want to know when a target account changes: a new executive, a new site, a funding round, a burst of hiring. AyeWatch can monitor the account's newsroom and other public pages, its LinkedIn company posts and LinkedIn job posts. Logged as a Task on the Account, each signal sits next to the owner's other activity instead of in a separate inbox.

A made-up alert from a newsroom monitor:

{
  "topic_id": 9172,
  "topic_name": "https://ostranderlogistics.example/newsroom",
  "update_id": 146120,
  "headline": "Ostrander Logistics names a new VP of Operations and opens a Dallas hub",
  "content": "A newsroom post announces Dana Whitfield as VP of Operations, joining from a regional carrier. The same post says a Dallas distribution hub opens in March.",
  "created_at": "2026-12-07T18:03:00Z",
  "evidence": [
    { "quote": "Ostrander opens Dallas hub", "source_url": "https://ostranderlogistics.example/newsroom" }
  ]
}

Sample rule: Alert me when Ostrander Logistics announces a new executive, a new site, a funding round or an acquisition on its newsroom page. Ignore award and event posts.

Check API access and set up the app

Salesforce turns API access on by default in the Enterprise, Performance, Unlimited and Developer editions. Professional Edition needs the paid Web Services API add-on, and the user who runs the calls needs the API Enabled permission. Without access, calls fail with API_DISABLED_FOR_ORG.

A relay has no person to sign in, so use the OAuth 2.0 client credentials flow. Create an External Client App, enable the client credentials flow in its settings and its policies, and pick a Run As user whose permissions the relay will use. Salesforce recommends an API Only user for this. The flow needs My Domain, and the relay requests its token from your My Domain host.

The relay

Store AYEWATCH_SECRET, SF_DOMAIN (your My Domain host, such as yourcompany.my.salesforce.com), SF_CLIENT_ID, SF_CLIENT_SECRET and SF_API_VERSION (an API version your org supports, such as v60.0) as Worker secrets. SF_ROUTES maps each AyeWatch topic to an Account ID and an owner:

{
  "9172": { "account": "001XXXXXXXXXXXXXXX", "owner": "005XXXXXXXXXXXXXXX" },
  "9173": { "account": "001YYYYYYYYYYYYYYY", "owner": "005XXXXXXXXXXXXXXX" }
}
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. Get a token with the client credentials flow, then create the Task.
    const base = "https://" + env.SF_DOMAIN;
    const auth = await fetch(base + "/services/oauth2/token", {
      method: "POST",
      body: new URLSearchParams({
        grant_type: "client_credentials",
        client_id: env.SF_CLIENT_ID,
        client_secret: env.SF_CLIENT_SECRET,
      }),
    });
    if (!auth.ok) return new Response("Salesforce sign-in failed", { status: 502 });
    const token = (await auth.json()).access_token;
    const route = JSON.parse(env.SF_ROUTES || "{}")[e.topic_id] || {};
    const res = await fetch(base + "/services/data/" + env.SF_API_VERSION + "/sobjects/Task/", {
      method: "POST",
      headers: { Authorization: "Bearer " + token, "Content-Type": "application/json" },
      body: JSON.stringify({
        Subject: title.slice(0, 255),
        Description: [e.content, link, "AyeWatch update " + id].filter(Boolean).join("\n\n"),
        WhatId: route.account,
        OwnerId: route.owner,
        ActivityDate: e.created_at.slice(0, 10),
      }),
    });
    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");
  },
};

Salesforce answers 201 Created with the new record's id and "success": true. WhatId ties the Task to the Account and OwnerId puts it on the rep's list. A topic missing from the map still creates a Task, owned by the Run As user and tied to no Account, so nothing is lost while you add it. Any refusal makes the Worker answer 502, and AyeWatch retries with exponential backoff, up to 10 attempts, with the same update_id.

Why a Task and not a Lead

These alerts are about accounts you already know, so the record that fits is an activity on the existing Account. A Lead is for a person or company that is not in Salesforce yet. If your monitors find new prospects, such as people asking for a recommendation on social media, read sales signals to a CRM with webhooks for that pattern.

Make, Zapier and n8n each have a Salesforce step that creates a record, if you would rather not run code. They sign in as a connected user, so the API access rules above still apply. Map headline to Subject, keep the topic-to-Account lookup in a table, and check the signature where the tool can.

What this setup won't do

  • Match accounts by itself. You keep the topic-to-Account map. When you add a monitor, add its line.
  • Find contacts. AyeWatch reads public pages and posts. It does not look up email addresses or enrich records.
  • Update opportunities. The relay logs a Task. Moving a deal is still the rep's call.
  • Beat the schedule. Checks run on a schedule: 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.

Ten target accounts, each with two monitors checked daily:

  • LinkedIn company posts: 10 × 2 credits × 30 = 600 credits
  • LinkedIn jobs: 10 × 1 × 30 = 300

Total: 900 credits a month, which needs Pro+ with its 1,500. Five accounts use 450, which fits Pro. A newsroom page monitor adds 30 credits per account at a daily pace.

Account signals in Salesforce

  1. Confirm your edition has API access and create an API Only user to run the relay.
  2. Create an External Client App, enable the client credentials flow and set that user as Run As.
  3. Create the monitors in AyeWatch, one set per target account.
  4. Build the SF_ROUTES map from each topic_id to its Account ID and owner ID.
  5. Deploy the relay with the My Domain host, client ID, client secret, API version and map.
  6. Open Notification settings, Webhook in AyeWatch, paste the relay URL and select Save Webhook. Reveal the signing secret and store it as AYEWATCH_SECRET.
AyeWatch fieldTask fieldNote
headline (or topic_name)SubjectCut at 255 characters
content, source link, update_idDescriptionPlain text, one block each
topic_id, through SF_ROUTESWhatIdThe Account ID, starting with 001
topic_id, through SF_ROUTESOwnerIdA user ID, starting with 005; left out, the Run As user owns it
created_atActivityDateYYYY-MM-DD
update_idNot storedKV key that stops a retry from logging 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

Map three accounts your best rep owns, run the relay for two weeks and ask that rep which Tasks were useful. Tighten the rules on the monitors that produced the rest before you add more accounts.

FAQ

Can AyeWatch create Salesforce records directly?

No. AyeWatch sends a signed webhook. A relay or an automation tool signs in to Salesforce and creates the record through the REST API.

Which Salesforce editions include API access?

Enterprise, Performance, Unlimited and Developer editions include it by default. Professional Edition needs the paid Web Services API add-on, and the user needs the API Enabled permission.

How does a relay sign in to Salesforce without a person?

Use the OAuth 2.0 client credentials flow: an External Client App with the flow enabled and a Run As user, with the token requested from your My Domain host.

Should a website change alert become a Salesforce Task or a Lead?

A Task on the existing Account fits a change at a company you already track. A Lead fits a new person or company that is not in Salesforce yet.

How many AyeWatch credits does monitoring ten target accounts use?

LinkedIn company posts and LinkedIn jobs monitors for ten accounts, checked daily, use 900 credits a month, which fits Pro+.

website change alerts to salesforcesalesforce create task from webhooksalesforce rest api create recordsalesforce client credentials flowaccount signals in salesforce

Related articles