---

title: Events API
description: Search events, read one event, set its linked id and tags, and record fraud or legit feedback, with every parameter, body, response and error.
---

An event is one identification: one visit of the agent on one of your pages. Its id is the request id (`evt_...`) the agent hands your page, which your backend then uses to read the result. These four routes read and annotate events.

| Method and path                                                                | Scope          | Idempotency-Key |
| ------------------------------------------------------------------------------ | -------------- | --------------- |
| [`GET /v1/events`](#get-v1-events)                                             | `events:read`  | No              |
| [`GET /v1/events/{request_id}`](#get-v1-events-request-id)                     | `events:read`  | No              |
| [`PATCH /v1/events/{request_id}`](#patch-v1-events-request-id)                 | `events:write` | Yes             |
| [`POST /v1/events/{request_id}/feedback`](#post-v1-events-request-id-feedback) | `events:write` | Yes             |

Every route takes a secret key in `Authorization: Bearer` and works inside that key's environment; see [Authentication](/api#authentication). The event object itself, field by field, is described on [The event object](/events). This page covers the routes.

## The event object

The search, the read and the `PATCH` answer events in the same shape, the event object (the feedback route answers the stored feedback instead). A trimmed example, with the members most backends read first:

```json
{
  "request_id": "evt_udrovzh6kvpxnvjfj62hp3nape",
  "environment_id": "env_b5l7rluhuy37x7qxlnu5qtjlsl",
  "created_at": "2026-11-03T14:00:00.412Z",
  "visitor_id": "v_f6i63ol6cpthl5uajnmobnbm5k",
  "confidence": 0.97,
  "signals": {
    "bot": { "value": "not_detected", "confidence": 0.7, "reasons": [] },
    "vpn": { "value": false, "confidence": 0.95, "reasons": [] },
    "suspect_score": {
      "value": 0,
      "confidence": 1,
      "reasons": [],
      "detail": { "version": "v3", "parts": {}, "max": 100 }
    }
  },
  "linked_id": "account-1842",
  "tags": { "flow": "login" },
  "url_path": "/login"
}
```

The full object has more members (the browser, the network, integrity and consent blocks, and more). Read [The event object](/events) for each field and [Signals](/signals) for each signal. Your code should ignore members it does not know: new ones are added within v1.

## GET /v1/events

Searches the events of your environment, newest first. Every filter is optional, and filters combine with AND.

```bash
curl -G "$KNOWNPRINT_API/v1/events" \
  -H "Authorization: Bearer $KNOWNPRINT_SECRET_KEY" \
  --data-urlencode "linked_id=account-1842" \
  --data-urlencode "start=2026-11-01T00:00:00Z" \
  --data-urlencode "min_suspect_score=50" \
  --data-urlencode "limit=100"
```

### Query parameters

| Parameter           | Type                            | Matches                                                                                                                                                                                                    |
| ------------------- | ------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `visitor_id`        | `v_` and 26 characters          | Events of that visitor. If the visitor has merged with others, the search covers the surviving visitor and every id merged into it, so any id the visitor ever had finds all of its events.                |
| `linked_id`         | 1 to 128 characters             | Events carrying exactly that linked id.                                                                                                                                                                    |
| `cluster_id`        | `c_` and 26 characters          | Events whose device cluster is that cluster. Device clusters are coming: no event carries one today, so this filter matches nothing yet ([Device clusters](/visitors#device-clusters)).                    |
| `ip`                | An address or a CIDR range      | Events whose client address is that address or falls in that range, such as `203.0.113.7`, `203.0.113.0/24` or `2001:db8::/32`. A range's host bits must be zero (`203.0.113.0/24`, not `203.0.113.7/24`). |
| `start`             | RFC 3339 time                   | Events created at or after this time.                                                                                                                                                                      |
| `end`               | RFC 3339 time                   | Events created before this time.                                                                                                                                                                           |
| `bot`               | `good`, `bad` or `not_detected` | Events whose `signals.bot.value` is that value. The current bot signal answers only `bad` or `not_detected`, so `good` matches no new event.                                                               |
| `vpn`               | `true` or `false`               | Events whose `signals.vpn.value` is that value.                                                                                                                                                            |
| `min_suspect_score` | Number from 0 to 100            | Events whose `signals.suspect_score.value` is at least this. Up to six decimal places. Events without a suspect score never match.                                                                         |
| `limit`             | Integer from 1 to 500           | Page size. Default 50.                                                                                                                                                                                     |
| `cursor`            | String                          | The `next_cursor` of the previous page.                                                                                                                                                                    |

Rules worth knowing:

- Each parameter may appear once. A parameter the route does not take, a repeated parameter or a malformed value answers `422` `validation_failed` with the detail `invalid_filter`. A malformed or repeated `cursor` answers the detail `invalid_cursor`.
- `start` and `end` take a `Z` or a numeric offset, with an optional fraction: `2026-11-03T14:00:00Z`, `2026-11-03T15:00:00.250+01:00`. Percent-encode a `+` offset as `%2B` (or use `--data-urlencode` as above); an unencoded `+` reads as a space and is refused.
- Client addresses are shortened after 30 days to their `/24` (IPv4) or `/48` (IPv6) network. An exact address no longer finds those events: search by the range (`203.0.113.0/24`) instead.
- Events older than your environment's event retention (90 days unless your account says otherwise) are gone and never match; see [Privacy for integrators](/privacy).
- Events of a visitor whose deletion is in progress are left out.
- There is no total count. Page until `next_cursor` is `null`.

### Response

`200` with a page of event objects, newest first (by `created_at`, then by request id):

```json
{
  "data": [
    {
      "request_id": "evt_udrovzh6kvpxnvjfj62hp3nape",
      "visitor_id": "v_f6i63ol6cpthl5uajnmobnbm5k",
      "created_at": "2026-11-03T14:00:00.412Z",
      "linked_id": "account-1842"
    }
  ],
  "next_cursor": "eyJjIjoiMjAyNi0xMS0wM1QxNDowMDowMC40MTIwMDBaIiwiciI6ImV2dF91ZHJvdnpoNmt2cHhudmpmajYyaHAzbmFwZSJ9"
}
```

Each item in `data` is a full event object (trimmed here). `next_cursor` is `null` on the last page. Pass it back unchanged with the same filters to get the next page:

```bash
curl -G "$KNOWNPRINT_API/v1/events" \
  -H "Authorization: Bearer $KNOWNPRINT_SECRET_KEY" \
  --data-urlencode "linked_id=account-1842" \
  --data-urlencode "cursor=$NEXT_CURSOR"
```

[Pagination](/api#pagination) has a loop in Node that reads every page.

### Common searches

| You want                                  | Query                                     |
| ----------------------------------------- | ----------------------------------------- |
| Every visit of one account                | `linked_id=account-1842`                  |
| Every visit of one browser, across merges | `visitor_id=v_f6i63ol6cpthl5uajnmobnbm5k` |
| Bad bots in the last day                  | `bot=bad&start=2026-11-02T14:00:00Z`      |
| Risky visits to review                    | `min_suspect_score=50&limit=200`          |
| Visits from one network                   | `ip=198.51.100.0/24`                      |

### 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`          |
| `422`  | [`validation_failed`](/api/errors#validation-failed) | `invalid_filter` or `invalid_cursor` |
| `429`  | [`rate_limited`](/api/errors#rate-limited)           | The key's bucket is empty            |

## GET /v1/events/{request_id}

Reads one event. This is the call your backend makes after the agent identifies a visitor: the page sends you the request id, and you read the result here before you decide.

```bash
curl "$KNOWNPRINT_API/v1/events/evt_udrovzh6kvpxnvjfj62hp3nape" \
  -H "Authorization: Bearer $KNOWNPRINT_SECRET_KEY"
```

```js title="node"
async function getEvent(requestId) {
  const res = await fetch(
    `${process.env.KNOWNPRINT_API}/v1/events/${encodeURIComponent(requestId)}`,
    { headers: { Authorization: `Bearer ${process.env.KNOWNPRINT_SECRET_KEY}` } },
  );
  if (res.status === 404) return null;
  if (!res.ok) throw new Error(`knownprint answered ${res.status}`); // 409 included
  return res.json();
}
```

### Path parameters

| Parameter    | Type                     | Meaning                           |
| ------------ | ------------------------ | --------------------------------- |
| `request_id` | `evt_` and 26 characters | The request id the agent returned |

### Response

`200` with the [event object](#the-event-object).

Never trust a request id your page sends without reading it here: the page is in the visitor's hands. Accept each request id once, and only when `received_at` is within 10 seconds of now, `integrity.replayed` is `false`, `integrity.origin` is your page's origin and `network.ip` is the address your own proxy saw. [Verify a request in your backend](/install/server) walks through the checks.

Read the event when the visitor acts. Incognito and the suspect score can be refined within about ten seconds of the identification, and the bot verdict can turn `bad` for up to 30 minutes after it, so a read at the moment of the action shows the current values.

### 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)               | The id is malformed, belongs to another environment, never existed or has passed retention |
| `409`  | [`deletion_pending`](/api/errors#deletion-pending) | The event's visitor is being deleted                                                       |
| `429`  | [`rate_limited`](/api/errors#rate-limited)         | The key's bucket is empty                                                                  |

## PATCH /v1/events/{request_id}

Sets or clears the event's `linked_id` and `tags`. Use it when you learn who the visitor was only after the identification (the visitor logged in a step later), or to correct a linked id that was wrong.

```bash
curl -X PATCH "$KNOWNPRINT_API/v1/events/evt_udrovzh6kvpxnvjfj62hp3nape" \
  -H "Authorization: Bearer $KNOWNPRINT_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: link-evt_udrovzh6kvpxnvjfj62hp3nape" \
  -d '{"linked_id":"account-1842","tags":{"flow":"login","plan":"pro"}}'
```

### Body

At least one member is required.

| Member      | Type                                     | Effect                                                                                             |
| ----------- | ---------------------------------------- | -------------------------------------------------------------------------------------------------- |
| `linked_id` | String of 1 to 128 characters, or `null` | A string sets the linked id; `null` clears it; leaving the member out keeps it.                    |
| `tags`      | Object, or `null`                        | An object replaces all of the event's tags; `null` clears them; leaving the member out keeps them. |

`tags` rules: at most 64 keys, each key 1 to 64 characters, each value a string (at most 256 characters), a number or a boolean, and the whole object under 4 KB as compact JSON. Tags are replaced as a whole, never merged: to add one tag, send all of them.

A linked id must be valid Unicode without U+0000. Do not put personal data such as an email address in it; use your own account id. See [Accounts and linked ids](/accounts).

### What changes

- The event's `linked_id` and `tags` take the new values.
- Setting a linked id ties the event's visitor to that linked id, so it appears in [related accounts](/api/visitors#get-v1-visitors-visitor-id-related). The first time a visitor and a linked id are tied together, the `account.linked` webhook fires, and `account.related_found` too when the linked id now has more than one visitor or the visitor more than one linked id. See [Webhooks](/webhooks).
- Replacing or clearing a linked id unties the visitor from the old one, so a corrected mistake stops relating accounts.
- Nothing else about the event changes: not its visitor, its confidence or its signals.

### Response

`200` with the updated [event object](#the-event-object).

### 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)                       | No such event in this environment                                                                                                                                      |
| `409`  | [`deletion_pending`](/api/errors#deletion-pending)         | The 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` (empty object, unknown member, tags too large), `invalid_subject` (a linked id that is empty, over 128 characters or holds U+0000) or `idempotency_key` |
| `429`  | [`rate_limited`](/api/errors#rate-limited)                 | The key's bucket is empty                                                                                                                                              |

## POST /v1/events/{request_id}/feedback

Records your verdict on an event: `fraud` when the visit turned out to be fraud (a chargeback, a confirmed takeover, a banned account returning), `legit` when an event you flagged turned out fine. Feedback is how you tell knownprint what happened after the fact. [Feedback and labelled pairs](/feedback) explains when to send each label.

```bash
curl -X POST "$KNOWNPRINT_API/v1/events/evt_udrovzh6kvpxnvjfj62hp3nape/feedback" \
  -H "Authorization: Bearer $KNOWNPRINT_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: fb-evt_udrovzh6kvpxnvjfj62hp3nape-fraud" \
  -d '{"label":"fraud","note":"chargeback on order 5521"}'
```

```js title="node"
await fetch(`${process.env.KNOWNPRINT_API}/v1/events/${requestId}/feedback`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.KNOWNPRINT_SECRET_KEY}`,
    'Content-Type': 'application/json',
    'Idempotency-Key': `fb-${requestId}-fraud`,
  },
  body: JSON.stringify({ label: 'fraud', note: 'chargeback on order 5521' }),
});
```

### Body

| Member  | Type                             | Required | Meaning                                                    |
| ------- | -------------------------------- | -------- | ---------------------------------------------------------- |
| `label` | `fraud` or `legit`               | Yes      | Your verdict                                               |
| `note`  | String, at most 1,000 characters | No       | Free text for your own team. Keep personal data out of it. |

Each call records a new feedback row; it does not replace an earlier one. Use an `Idempotency-Key` so that a retried call is recorded once.

### Response

`201` with the stored feedback:

```json
{
  "id": 4127,
  "event_id": "evt_udrovzh6kvpxnvjfj62hp3nape",
  "label": "fraud",
  "note": "chargeback on order 5521",
  "created_at": "2026-11-04T09:12:44.120Z"
}
```

| Member       | Type               | Meaning              |
| ------------ | ------------------ | -------------------- |
| `id`         | Integer            | The feedback's id    |
| `event_id`   | `evt_` id          | The event it labels  |
| `label`      | `fraud` or `legit` | Your verdict         |
| `note`       | String or `null`   | Your note            |
| `created_at` | RFC 3339 time      | When it was recorded |

Feedback is deleted with its visitor and follows your event retention.

### 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)                       | No such event in this environment                                                                                            |
| `409`  | [`deletion_pending`](/api/errors#deletion-pending)         | The 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 label other than `fraud` or `legit`, a note over 1,000 characters, an unknown member) or `idempotency_key` |
| `429`  | [`rate_limited`](/api/errors#rate-limited)                 | The key's bucket is empty                                                                                                    |
