knownprintDocs

Guides

Account sharing and multi-accounting

Count the browsers behind each account and the accounts behind each browser with linked ids, the related reads and the account webhooks, and set limits that honest customers never hit.

The threat

Two problems, mirror images of each other:

  • Account sharing. One paid login is passed round friends, posted in a forum or resold. Every extra person on it is a subscription you do not sell. The tell is one account on more browsers, in more places, than one person or one household uses.
  • Multi-accounting. One person runs many accounts: to vote ten times, claim ten bonuses, trade with themselves, dodge per-account limits or come back after a ban. The tell is one browser carrying many accounts.

Both come down to the same two counts: browsers per account and accounts per browser. knownprint gives you both once you send your account id with each visit. The account id is a linked id: a string of your own (up to 128 characters) that you attach to events. knownprint then keeps which browsers (visitor ids) carried which accounts, answers both questions through the related reads, and tells you by webhook when a browser carries an account for the first time.

Where to identify

MomentWhy
Sign-inThe moment an account arrives on a browser. The main check for sharing
Session refresh or app start on an already signed-in browserCatches long sessions handed over without a new sign-in
SignupThe main check for multi-accounting: how many accounts this browser already has
The action your rules limit per account (a vote, a bonus, a trade, a review, a stream start)Where multi-accounting pays off for the abuser

In the page, call identify() before the request and send the request id with it (Add the browser agent, protect a form). In your backend, once you know which account is signed in, attach it to the event:

Shell
curl -X PATCH "$KNOWNPRINT_API/v1/events/$REQUEST_ID" \
  -H "Authorization: Bearer $KNOWNPRINT_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{"linked_id": "acct_8841"}'

The answer is the updated event. Set the linked id from your backend, not with the linkedId option of identify(): the page is under the user's control, your session is not. linked_id is 1 to 128 characters; null clears it. Accounts and linked ids covers the rules, and Events API the route.

Which fields and routes to use

Browsers per account

Route or fieldAnswers
GET /v1/linked/{linked_id}/relatedvisitors: the browsers that carried this account id. linked_ids: your other accounts seen on those browsers
GET /v1/events?linked_id={linked_id}&start={time}Every event of the account since start, newest first, with each event's visitor_id, network.country and signals. Use it to count browsers over a window
account.linked webhookA browser carried this account for the first time: data.visitor_id and data.linked_id
account.related_found webhookSent beside account.linked when the account now has more than one browser, or the browser more than one account: data.visitors and data.linked_ids are those two counts

Accounts per browser

Route or fieldAnswers
GET /v1/visitors/{visitor_id}/relatedlinked_ids: the account ids this browser carried. visitors: other visitors related to this browser, each with its evidence
linked_ids on GET /v1/visitors/{visitor_id}The distinct linked ids on the visitor's events, up to 100. It shrinks as old events are deleted

Each related list is ordered strongest first and holds at most 50 entries. For an account past 50 browsers the list is not the most recent 50: count with GET /v1/events instead. Each entry's evidence is a list of { kind, detail, weight }; evidence of kind linked_id means a shared account id. The Linked ids API and the visitor related read document both reads and every evidence kind.

Context on each visit

FieldUse it for
confidenceHow sure knownprint is about visitor_id, from 0 to 1. When it is low, the id may not be the browser's lasting id: do not count it against a limit on its own
network.countryThe country of the visit's address, or null. Several countries at once on one account points at sharing
signals.vpn, signals.proxyA VPN or a proxy explains a country that jumps; do not count it as a second place
signals.suspect_score0 to 100. Raises the priority of a review (Suspect score)

Decision tables

Account sharing, at sign-in. "Browsers" means distinct visitor ids, each resolved to its surviving id, seen on the account within a window you choose (30 days is a common start). These are starting points, not knownprint defaults.

What you seeSuggested action
The browser (or an alias of it) already used this accountAllow
A new browser, browsers in the window within the plan's limitAllow, and tell the owner a new browser signed in
A new browser, browsers over the plan's limitAsk the owner to confirm, or to sign out another browser
A new browser, browsers well over the limit (for example twice it)Refuse the sign-in and require a password reset
The account active from two or more countries within the last hour, VPN and proxy visits left outFlag for review; a candidate for a forced sign-out
A new browser with confidence below 0.5Allow and tell the owner rather than ask for confirmation or refuse: the id is uncertain

Multi-accounting, at signup or at a limited action:

What you seeSuggested action
The browser carries one accountAllow
Two or three accountsAllow. Households and shared computers do this honestly
More accounts than your rules allow per person, created recentlyReview, or refuse the limited action (the vote, the bonus) for the extra accounts
One of the browser's accounts is bannedFollow Keep banned users out
visitors in the related read lists other browsers with linked_id evidence, and those carry more accountsA ring of accounts shared over several browsers: review the whole group

Backend example

A sign-in check in Node 22 that enforces a per-plan browser limit. It reads the account's events over the window, resolves merged ids, counts the browsers, and decides. The plan limits leave room for one person's phone, laptop and work computer. It assumes you already verified the event (Verify a request in your backend).

sharing.js
const API = process.env.KNOWNPRINT_API; // the API address that comes with your account
const SECRET = process.env.KNOWNPRINT_SECRET_KEY; // sk_live_..., scopes events:read and events:write
const DAY_MS = 86_400_000;
const HOUR_MS = 3_600_000;
const PLAN_BROWSERS = { basic: 2, standard: 4, premium: 8 };

async function kp(path, init = {}) {
  const res = await fetch(`${API}${path}`, {
    ...init,
    headers: {
      Authorization: `Bearer ${SECRET}`,
      Accept: 'application/json',
      ...(init.body ? { 'Content-Type': 'application/json' } : {}),
    },
  });
  // 404: no such visitor or linked id; 409: the visitor is being deleted.
  if (res.status === 404 || res.status === 409) return null;
  if (!res.ok) throw new Error(`knownprint ${res.status}`);
  return res.json();
}

/** Resolves visitor ids to their surviving id (merges make older ids aliases), cached per check. */
function resolver() {
  const cache = new Map();
  return async (visitorId) => {
    if (!cache.has(visitorId)) {
      const v = await kp(`/v1/visitors/${visitorId}`);
      cache.set(visitorId, v === null ? visitorId : v.visitor_id);
    }
    return cache.get(visitorId);
  };
}

/** The account's browsers over the window: surviving visitor id to the countries seen on it. */
async function browsersOf(accountId, days, canonicalOf) {
  const start = new Date(Date.now() - days * DAY_MS).toISOString();
  const browsers = new Map();
  let cursor = null;
  do {
    const q = new URLSearchParams({ linked_id: accountId, start, limit: '500' });
    if (cursor !== null) q.set('cursor', cursor);
    const page = await kp(`/v1/events?${q}`);
    for (const e of page?.data ?? []) {
      const id = await canonicalOf(e.visitor_id);
      const countries = browsers.get(id) ?? new Map(); // country to its latest time, in ms
      const hidden = e.signals.vpn?.value === true || e.signals.proxy?.value === true;
      if (e.network.country !== null && !hidden) {
        const at = Date.parse(e.created_at);
        countries.set(e.network.country, Math.max(countries.get(e.network.country) ?? 0, at));
      }
      browsers.set(id, countries);
    }
    cursor = page?.next_cursor ?? null;
  } while (cursor !== null);
  return browsers;
}

/** Countries seen on the account within the last hour, VPN and proxy visits left out. */
function countriesInLastHour(browsers) {
  const since = Date.now() - HOUR_MS;
  const seen = new Set();
  for (const countries of browsers.values()) {
    for (const [country, at] of countries) if (at >= since) seen.add(country);
  }
  return seen;
}

/**
 * Decide a sign-in. `event` is the verified event of the sign-in request, `account` your own
 * record with `id` and `plan`. Returns 'allow', 'allow_notify', 'confirm', 'refuse' or 'review'.
 */
export async function checkSignIn(event, account) {
  const canonicalOf = resolver();
  const here = await canonicalOf(event.visitor_id);

  // The browsers that carried the account before this sign-in.
  const related = await kp(`/v1/linked/${encodeURIComponent(account.id)}/related`);
  const before = await Promise.all((related?.visitors ?? []).map((v) => canonicalOf(v.visitor_id)));

  // Attach the account, so this sign-in is part of the counts below.
  await kp(`/v1/events/${event.request_id}`, {
    method: 'PATCH',
    body: JSON.stringify({ linked_id: String(account.id) }), // 1 to 128 characters
  });

  const browsers = await browsersOf(account.id, 30, canonicalOf);
  if (countriesInLastHour(browsers).size > 1) return 'review';
  if (before.length === 0 || before.includes(here)) return 'allow'; // first or known browser
  if (event.confidence < 0.5) return 'allow_notify'; // an uncertain id: never refuse on it

  const limit = PLAN_BROWSERS[account.plan] ?? 2;
  const count = browsers.size; // this browser included
  if (count <= limit) return 'allow_notify';
  if (count > 2 * limit) return 'refuse';
  return 'confirm';
}

/** Accounts per browser, for sign-up or a limited action. */
export async function accountsOnBrowser(event) {
  const related = await kp(`/v1/visitors/${event.visitor_id}/related`);
  return related === null ? [] : related.linked_ids.map((l) => l.linked_id);
}

allow_notify is where you email the owner ("A new browser signed in to your account"), which also lets a real owner spot a stranger. confirm is where you ask the owner to approve the new browser or sign one out.

A browser is new to the account when the related read did not list it before this sign-in, which is why the read comes before the PATCH; the account's very first browser is simply allowed. If you would rather keep your own table of each account's browsers, the account.linked webhook tells you of every new pair, and visitor.merged tells you when two of the ids are one browser (Webhooks).

Paging and cost

GET /v1/events returns 50 events per page by default and up to 500 with limit; follow next_cursor until it is null. An account with heavy traffic has many events over 30 days, so cache the browser count per account for a few minutes, or keep your own table fed by account.linked, rather than paging on every sign-in. The rate limits for each route are in Rate limits.

Using the webhooks

Subscribe to account.linked and account.related_found (Webhooks API). account.linked is sent when a browser carries an account for the first time, whether the linked id came from identify() or from PATCH /v1/events/{request_id}; account.related_found is sent with it when that leaves the account with more than one browser or the browser with more than one account. A browser carrying an account it already carried sends neither.

JSON
{
  "v": 1,
  "id": "dl_m3k7tq2xa4pfz3bnw6tqyh5rd2",
  "type": "account.related_found",
  "created_at": "2026-06-01T09:14:07.512Z",
  "environment_id": "env_r4tzm2qa7xk3bnw6pfy5hd2gqe",
  "visitor_id": "v_k7q2mxa4pfz3bnw6tqyh5rd2xa",
  "data": {
    "visitor_id": "v_k7q2mxa4pfz3bnw6tqyh5rd2xa",
    "linked_id": "acct_8841",
    "visitors": 3,
    "linked_ids": 1
  }
}

Here account acct_8841 has just arrived on a browser and now has three browsers; the browser carries only this one account. A linked_ids count that keeps climbing on one browser is multi-accounting; a visitors count that keeps climbing on one account is sharing. Verify every delivery before you act on it (Verify webhook signatures).

Pitfalls

  • Counting browsers as people. One person has a phone, a laptop and a work computer, and two browsers on the laptop. Count over a window, and set plan limits with room for an honest household.
  • Counting merged ids twice. Browsers that lose their data may get a new visitor id that knownprint later merges into the old one. An event keeps the id it was answered with, so the same browser can appear under two ids in the search. Resolve each id with GET /v1/visitors/{visitor_id} and count canonical ids, as the example does.
  • Counting forever. A browser used once last year is not a sharer today. Count over a window with start on GET /v1/events, rather than every browser the related read ever saw.
  • Treating a VPN as travel. A VPN or a proxy moves the country of a visit without the person moving. Leave those visits out of the country check, as the example does.
  • Blocking a household. Several accounts on one family computer, or one account used by a couple, is common and often within your terms. Refuse only what your terms forbid, and prefer asking the owner to confirm over refusing.
  • Letting the page name the account. The linkedId option of identify() is set in the browser, where a user can change it. Attach the account from your backend once you know who signed in.
  • Putting personal data in the linked id. An email or a name as the linked id puts personal data in every event. Use an opaque account id.
  • Hitting the caps. The related lists hold at most 50 entries, and a visitor's linked_ids at most 100. An account or a browser at those caps is already far past any honest limit: treat reaching them as the answer.
  • Expecting the event history to last. Events are kept for your account's event retention period and then deleted (How long events are kept), and a visitor's linked_ids comes from its events. The pairs of browser and account behind the related reads stay after those events are deleted, until the visitor or the linked id is deleted or you replace or clear that linked id on its event, so the related reads reach further back; count over a recent window anyway.
  • Keeping it secret from your users. Tell users that you limit the browsers or devices on an account, and how they can sign others out. It turns a block into a prompt to upgrade, and it belongs in your privacy notice (Privacy).