---

title: Linked ids and labelled pairs API
description: See which visitors and accounts relate to one of your account ids, remove an account id from knownprint, and record moderator-confirmed pairs of events.
---

A linked id is your own identifier for an account: a user id, a customer number, an account handle. You attach it to events (from the page, or later with [`PATCH /v1/events/{request_id}`](/api/events#patch-v1-events-request-id)), and knownprint ties it to the visitor of each event. These routes work from the linked id side.

| Method and path                                                          | Scope             | Idempotency-Key |
| ------------------------------------------------------------------------ | ----------------- | --------------- |
| [`GET /v1/linked/{linked_id}/related`](#get-v1-linked-linked-id-related) | `events:read`     | No              |
| [`DELETE /v1/linked/{linked_id}`](#delete-v1-linked-linked-id)           | `visitors:delete` | Yes             |
| [`POST /v1/labelled-pairs`](#post-v1-labelled-pairs)                     | `events:write`    | Yes             |

Every route takes a secret key in `Authorization: Bearer` and works inside that key's environment; see [Authentication](/api#authentication). How to choose and attach linked ids is on [Accounts and linked ids](/accounts).

## Linked ids in a path

A linked id is 1 to 128 characters of valid Unicode without U+0000. In a path it must be percent-encoded, since it can hold characters such as `/`, `@`, `?` or spaces:

```js title="node"
const path = `/v1/linked/${encodeURIComponent(linkedId)}/related`;
```

```bash
# curl does not encode paths: encode the id first.
LINKED_ID=$(node -p 'encodeURIComponent(process.argv[1])' "account-1842")
curl "$KNOWNPRINT_API/v1/linked/$LINKED_ID/related" \
  -H "Authorization: Bearer $KNOWNPRINT_SECRET_KEY"
```

Use an opaque account id rather than an email address or a phone number. A linked id is stored as you send it, and it appears in API answers and webhooks.

There is no read of a linked id on its own. To list the events of an account, search them: [`GET /v1/events?linked_id=...`](/api/events#get-v1-events).

## GET /v1/linked/{linked_id}/related

Lists the visitors that carry a linked id, and the other linked ids those visitors carry. Use it in a review: "which browsers has this account used, and which other accounts used the same browsers?" It never changes an id or an event, and a relation is not an identification.

```bash
curl "$KNOWNPRINT_API/v1/linked/account-2077/related" \
  -H "Authorization: Bearer $KNOWNPRINT_SECRET_KEY"
```

### Response

`200` with two lists:

```json
{
  "visitors": [
    {
      "visitor_id": "v_frg25tolohaauude7tlfu6pgfr",
      "evidence": [{ "kind": "linked_id", "detail": "account-2077", "weight": 1 }]
    }
  ],
  "linked_ids": [
    {
      "linked_id": "account-1842",
      "evidence": [{ "kind": "linked_id", "detail": "v_frg25tolohaauude7tlfu6pgfr", "weight": 1 }]
    }
  ]
}
```

| Field                    | Type              | Meaning                                                                              |
| ------------------------ | ----------------- | ------------------------------------------------------------------------------------ |
| `visitors`               | Array, at most 50 | Every visitor that carries this linked id. Each item's evidence names the linked id. |
| `visitors[].visitor_id`  | `v_` id           | A visitor that carries the linked id                                                 |
| `linked_ids`             | Array, at most 50 | Other linked ids carried by those visitors, most shared first                        |
| `linked_ids[].linked_id` | String            | Another account seen on the same browsers                                            |
| `linked_ids[].evidence`  | Array, at most 50 | One item per visitor that carries both: `detail` is that visitor's id                |

Each evidence item is `{ kind, detail, weight }`, as on [visitor related](/api/visitors#get-v1-visitors-visitor-id-related). Lists are ordered strongest first. `weight` is for knownprint's own use; do not build rules on it.

An account that shares browsers with many other accounts is worth a look: it can be a shared family computer, an internet cafe, or one person running several accounts. Read the events before you act. The [ban evasion](/guides/ban-evasion) and [account sharing](/guides/account-sharing) guides show how to decide.

### Errors

| Status | Type                                                 | When                                                                    |
| ------ | ---------------------------------------------------- | ----------------------------------------------------------------------- |
| `401`  | [`unauthorized`](/api/errors#unauthorized)           | No valid secret key                                                     |
| `403`  | [`forbidden_scope`](/api/errors#forbidden-scope)     | The key lacks `events:read`                                             |
| `404`  | [`not_found`](/api/errors#not-found)                 | No visitor of this environment carries the linked id                    |
| `422`  | [`validation_failed`](/api/errors#validation-failed) | `invalid_subject`: empty, longer than 128 characters, or holding U+0000 |
| `429`  | [`rate_limited`](/api/errors#rate-limited)           | The key's bucket is empty                                               |

## DELETE /v1/linked/{linked_id}

Removes one of your account ids from knownprint. Use it when an account is closed or a person asks to be erased and you know their account id but not their visitor ids.

```bash
curl -X DELETE "$KNOWNPRINT_API/v1/linked/account-1842" \
  -H "Authorization: Bearer $KNOWNPRINT_SECRET_KEY" \
  -H "Idempotency-Key: close-account-1842"
```

### Response

`202` with the deletion job:

```json
{
  "job_id": "del_m3q7z2k6w4a5xr2d7h6t3n4pbv",
  "status": "queued"
}
```

| Field    | Type                  | Meaning                        |
| -------- | --------------------- | ------------------------------ |
| `job_id` | `del_` id             | The deletion job               |
| `status` | `queued` or `running` | The job's state when you asked |

The answer is the same whether or not the linked id was ever seen, and asking again while the job is open returns the same job.

### What happens

A background worker:

1. removes the linked id from every event that carries it (their `linked_id` becomes `null`);
2. unties it from every visitor;
3. deletes the webhook deliveries that name it;
4. queues a full [visitor deletion](/api/visitors#delete-v1-visitors-visitor-id) for each visitor that is left with no linked id at all, which deletes that visitor and its events.

A visitor that still carries another linked id keeps its events; only this linked id is removed from them.

### Rate limit

Deletions are limited to 2 a second per key, burst 2, on top of the key's general bucket. A `429` carries `Retry-After`.

### Errors

| Status | Type                                                       | When                                                                                          |
| ------ | ---------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| `401`  | [`unauthorized`](/api/errors#unauthorized)                 | No valid secret key                                                                           |
| `403`  | [`forbidden_scope`](/api/errors#forbidden-scope)           | The key lacks `visitors:delete`                                                               |
| `409`  | [`idempotency_conflict`](/api/errors#idempotency-conflict) | The `Idempotency-Key` was used for another request, or is still in flight                     |
| `422`  | [`validation_failed`](/api/errors#validation-failed)       | `invalid_subject` (empty, longer than 128 characters, or holding U+0000) or `idempotency_key` |
| `429`  | [`rate_limited`](/api/errors#rate-limited)                 | The key's bucket or the deletion bucket is empty                                              |

## POST /v1/labelled-pairs

Tells knownprint that two events belong to the same person, as your moderators established it. The typical case is ban evasion: a moderator finds that a new account is a banned user back again, and your ban form sends the request ids of an event from each account.

Labelled pairs help knownprint recognise returning people better. A pair changes no visitor id, merges nothing and changes no event; to act on the person, use your own ban or review tools.

```bash
curl -X POST "$KNOWNPRINT_API/v1/labelled-pairs" \
  -H "Authorization: Bearer $KNOWNPRINT_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: ban-case-7731" \
  -d '{
    "request_id_a": "evt_udrovzh6kvpxnvjfj62hp3nape",
    "request_id_b": "evt_k4m2q7z3w6a5x2rd7h4t6n3pbv",
    "label": "same",
    "evidence": "moderator_confirmed"
  }'
```

### Body

| Member         | Type                                           | Required | Meaning                                                                                                                               |
| -------------- | ---------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `request_id_a` | `evt_` id                                      | Yes      | An event of the first account                                                                                                         |
| `request_id_b` | `evt_` id                                      | Yes      | An event of the second account; must differ from `request_id_a`                                                                       |
| `label`        | `same`                                         | Yes      | The only label accepted: the two events are the same person                                                                           |
| `evidence`     | `moderator_confirmed` or `moderator_suspected` | Yes      | `moderator_confirmed` when the person admitted it or the proof is conclusive; `moderator_suspected` when a moderator judged it likely |

Pick events close to the moment of the ban decision, such as the latest login of each account. Both events must still be within your event retention.

### Response

`201` when the pair is new, `200` when the same two events were already paired (in either order). On `200` the stored pair's `label` and `evidence` take the new values.

```json
{
  "id": "lp_q6t3m7z2k4w5a2xr7d6h3n4pbv",
  "observation_a": "obs_r4n7t2k6m3w5z2qa7d4h6x3pbv",
  "observation_b": "obs_w7k3m2q6z4t5a2xr7d3h6n4pbv",
  "label": "same",
  "evidence": "moderator_confirmed",
  "gap_days": 12.417,
  "features": null,
  "created_by": "key_3m5hq7z2xk4ajc6d2tq7rfwz5e",
  "created_at": "2026-11-04T09:12:44.120Z"
}
```

| Field           | Type                | Meaning                                                                                                                                                                             |
| --------------- | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`            | `lp_` id            | The labelled pair                                                                                                                                                                   |
| `observation_a` | `obs_` id           | The stored observation behind `request_id_a`                                                                                                                                        |
| `observation_b` | `obs_` id           | The stored observation behind `request_id_b`                                                                                                                                        |
| `label`         | String              | `same`                                                                                                                                                                              |
| `evidence`      | String              | The evidence you sent                                                                                                                                                               |
| `gap_days`      | Number or `null`    | Days between the two events, to three decimal places                                                                                                                                |
| `features`      | Object or `null`    | knownprint's internal comparison of the two visits. Its shape is not part of the contract and may change; do not read it. `null` once either visit's raw data has passed retention. |
| `created_by`    | `key_` id or `null` | The secret key that recorded the pair. No moderator name is stored.                                                                                                                 |
| `created_at`    | RFC 3339 time       | When the pair was first recorded                                                                                                                                                    |

The pair keeps no visitor id, linked id, address or raw browser value. Pairs are kept for 400 days.

### Errors

| Status | Type                                                       | When                                                                                                                                                                                                                                 |
| ------ | ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `400`  | [`schema_mismatch`](/api/errors#schema-mismatch)           | The body is not JSON, or the content type is not `application/json`                                                                                                                                                                  |
| `401`  | [`unauthorized`](/api/errors#unauthorized)                 | No valid secret key                                                                                                                                                                                                                  |
| `403`  | [`forbidden_scope`](/api/errors#forbidden-scope)           | The key lacks `events:write`                                                                                                                                                                                                         |
| `404`  | [`not_found`](/api/errors#not-found)                       | Either request id names no event of this environment, or the event has passed retention                                                                                                                                              |
| `409`  | [`deletion_pending`](/api/errors#deletion-pending)         | Either event's visitor is being deleted                                                                                                                                                                                              |
| `409`  | [`idempotency_conflict`](/api/errors#idempotency-conflict) | The `Idempotency-Key` was used for another request, or is still in flight                                                                                                                                                            |
| `422`  | [`validation_failed`](/api/errors#validation-failed)       | `invalid_body` (a missing member, a label other than `same`, the same request id twice, or two events of one visit), `purpose_not_security` (reserved: every event is collected for the security purpose today) or `idempotency_key` |
| `429`  | [`rate_limited`](/api/errors#rate-limited)                 | The key's bucket is empty                                                                                                                                                                                                            |
