Back to blog
8 min read

Champion Tracking With Job Change Webhooks

By Kooperativa Engineering

Champion Tracking With Job Change Webhooks

In B2B sales, champion tracking means watching the people who bought, used or argued for your product, and acting when one of them changes employer. A champion who lands at a new company arrives with trust in your product and often with a budget to spend, which is why a job change is a useful sales signal.

Dedicated champion tracking tools bundle the signal with CRM sync and contact details for the new job. This article builds the signal from two parts of the Kooperativa API instead. What you get is a person and a new employer. What you do not get is an email address or a phone number, because the API holds neither, so a rep still needs a route to the person. If you want the whole play in one product, a dedicated tool fits better.

Decide who counts as a champion

Keep the list short and written down: closed-won contacts with a clear role, users who asked for the product, and anyone who signed or argued for it. For each, store the profile username and your CRM id. A workspace can hold 500 monitors, which is the ceiling for route one and a good reason to be strict about who makes the list.

Route one: a monitor per champion

A monitor watches one profile and sends a webhook when a tracked field changes. For champion tracking, subscribe to person.job_changed only. An events list left empty defaults to every event for the type, so every headline and skills edit would reach your handler.

Create one monitor per championjs
const BASE = 'https://kooperativa.io/api/v1';
const headers = {
  Authorization: 'Bearer ' + process.env.KOOPERATIVA_API_KEY,
  'Content-Type': 'application/json',
};

// champions: [{ crm_id, username }]
export async function watch(champions) {
  for (const c of champions) {
    const res = await fetch(BASE + '/monitors', {
      method: 'POST',
      headers,
      body: JSON.stringify({
        type: 'person',
        subject_url: 'https://www.linkedin.com/in/' + c.username,
        webhook_url: 'https://your-app.com/hooks/champions/' + process.env.HOOK_TOKEN,
        label: 'crm:' + c.crm_id,
        events: ['person.job_changed'],
      }),
    });
    if (!res.ok) {
      const { code } = await res.json().catch(() => ({}));
      if (code === 'MONITOR_LIMIT_REACHED') break;
      console.error(c.crm_id, res.status, code);
      continue;
    }
    const { monitor } = await res.json();
    // save monitor.id next to the CRM record: deliveries carry monitor_id, not the label
  }
}

Creation returns 201. The call upserts on the profile URL, so running the loop twice does not create duplicates. The limit shows up as a 429 with the code MONITOR_LIMIT_REACHED, which clears only when you delete a monitor, so a client that retries on every 429 would loop forever. Switch on the code and not on the status.

The handler

A delivery is a POST with four headers: a delivery id, the event name, a Unix timestamp, and a signature, which is an HMAC-SHA256 of v0, the timestamp and the raw body, as set out in the API reference. Check the signature before you trust the body, reject old timestamps, and keep an unguessable token in the webhook path as a second guard.

Verify, deduplicate, reactjs
import crypto from 'node:crypto';
import http from 'node:http';

const BASE = 'https://kooperativa.io/api/v1';
const headers = { Authorization: 'Bearer ' + process.env.KOOPERATIVA_API_KEY };
const SECRET = process.env.KOOPERATIVA_WEBHOOK_SECRET;
const seen = new Set(); // use a database in production

http
  .createServer((req, res) => {
    if (req.method !== 'POST' || req.url !== '/hooks/champions/' + process.env.HOOK_TOKEN) {
      res.writeHead(404).end();
      return;
    }
    const chunks = [];
    req.on('data', (c) => chunks.push(c));
    req.on('end', () => {
      const raw = Buffer.concat(chunks).toString('utf8');
      const ts = req.headers['x-kooperativa-timestamp'];
      const expected = crypto
        .createHmac('sha256', SECRET)
        .update('v0:' + ts + ':' + raw)
        .digest('hex');
      const got = String(req.headers['x-kooperativa-signature'] || '');
      const ok =
        got.length === expected.length &&
        crypto.timingSafeEqual(Buffer.from(got), Buffer.from(expected));
      const fresh = Math.abs(Date.now() / 1000 - Number(ts)) < 300;
      if (!ok || !fresh) {
        res.writeHead(401).end();
        return;
      }

      res.writeHead(200).end(); // answer first, work after
      const evt = JSON.parse(raw);
      if (seen.has(evt.id)) return;
      seen.add(evt.id);
      handleMove(evt).catch(console.error);
    });
  })
  .listen(8080);

async function handleMove(evt) {
  const { old_company, new_company, old_company_id, new_company_id } = evt.diff;
  if (!new_company_id || new_company_id === old_company_id) return; // not a move

  const res = await fetch(BASE + '/company?company_id=' + new_company_id, { headers });
  if (!res.ok) return;
  const { data: company } = await res.json();

  await createTask({
    monitor_id: evt.monitor_id,
    text:
      'Champion moved from ' + old_company + ' to ' + new_company +
      ' (' + company.staff_count + ' people on the company record)',
  });
}

The diff carries both the old and the new company, with ids, and the old and the new title, so the handler can tell a move from a promotion without a second lookup. createTask is yours: it should write a task to the account owner in your CRM, using the monitor id you saved to find the contact.

Two habits help. Reply 200 before doing any work, and ignore a delivery id you have already handled, because a receiver should not assume each delivery arrives exactly once. And do not plan a test around a forced event: there is no way to trigger one, so the honest check is a monitor on a profile you expect to change.

Route two: leavers by customer account

A monitor per person stops at 500, and some champions are people you never listed. The job changes endpoint covers the other direction. Give it a customer's company id and it returns people who used to work there and now work somewhere else.

People who left one customer account in the last 30 daysbash
curl "https://kooperativa.io/api/v1/person/job-changes?company_id=CUSTOMER_COMPANY_ID&days=30" \
  -H "Authorization: Bearer ik_live_..."

Run it weekly for each customer account, compare the result with your contact list by profile id, and keep the ids you have already seen. Three limits come from the endpoint's own documentation. The match is on the company name as written on each profile, so a company whose profiles spell its name differently is matched imperfectly. Start dates are precise to the month, so a window of a few days can legitimately return nothing, which is why the example uses 30 days and relies on the seen list to remove the overlap. And people who are still at the company, for example after a promotion, are excluded.

What this does not do

Be honest with whoever will rely on the signal.

  • It gives no email address or phone number for the new job. A rep still has to find a way in.
  • It is not instant. A change reaches you after the profile is refreshed with the new role, so timing depends on that refresh and on the person updating their profile at all.
  • It sees only what a profile says. A move nobody wrote down does not exist for this data.
  • A title change at the same employer is a different event from a move, and the handler above ignores it on purpose.

What it costs

Monitors and the job changes query are part of the flat license, with no per-event fee. The only metered call is the realtime lookup at $0.001, which is worth one use for each champion who lands at a company you care about: confirm the current profile before a rep writes.

Frequently asked questions

What is champion tracking?

Watching the people who bought, used or advocated for your product and acting when one of them changes employer, so you can reach them at the new company with trust already in place.

How do I know when a customer contact changes jobs?

Put a monitor on their profile and subscribe to the job changed event, or query the job changes endpoint weekly with the customer company id and match the results against your contacts.

How many champions can I track with monitors?

A workspace can hold 500 monitors. Use them for the contacts who matter most and cover the rest with the weekly query by customer account.

Does this give me the champion's new email address?

No. Kooperativa returns the person and the new employer, not contact details. Find a route to the person through your usual channels.

Get started

Try Kooperativa

One API key. Person and company enrichment, structured search, and monitors under one flat license.

Keep reading

We use only cookies that are strictly necessary to run this site (staying signed in, and protecting forms from abuse). Our analytics tool doesn't use cookies or collect personal data. See our Privacy Policy for details.