knownprintDocs

API reference

Events API

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 pathScopeIdempotency-Key
GET /v1/eventsevents:readNo
GET /v1/events/{request_id}events:readNo
PATCH /v1/events/{request_id}events:writeYes
POST /v1/events/{request_id}/feedbackevents:writeYes

Every route takes a secret key in Authorization: Bearer and works inside that key's environment; see Authentication. The event object itself, field by field, is described on The event object. 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 for each field and 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.

Shell
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

ParameterTypeMatches
visitor_idv_ and 26 charactersEvents 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_id1 to 128 charactersEvents carrying exactly that linked id.
cluster_idc_ and 26 charactersEvents whose device cluster is that cluster. Device clusters are coming: no event carries one today, so this filter matches nothing yet (Device clusters).
ipAn address or a CIDR rangeEvents 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).
startRFC 3339 timeEvents created at or after this time.
endRFC 3339 timeEvents created before this time.
botgood, bad or not_detectedEvents whose signals.bot.value is that value. The current bot signal answers only bad or not_detected, so good matches no new event.
vpntrue or falseEvents whose signals.vpn.value is that value.
min_suspect_scoreNumber from 0 to 100Events whose signals.suspect_score.value is at least this. Up to six decimal places. Events without a suspect score never match.
limitInteger from 1 to 500Page size. Default 50.
cursorStringThe 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.
  • 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:

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

Pagination has a loop in Node that reads every page.

Common searches

You wantQuery
Every visit of one accountlinked_id=account-1842
Every visit of one browser, across mergesvisitor_id=v_f6i63ol6cpthl5uajnmobnbm5k
Bad bots in the last daybot=bad&start=2026-11-02T14:00:00Z
Risky visits to reviewmin_suspect_score=50&limit=200
Visits from one networkip=198.51.100.0/24

Errors

StatusTypeWhen
401unauthorizedNo valid secret key
403forbidden_scopeThe key lacks events:read
422validation_failedinvalid_filter or invalid_cursor
429rate_limitedThe 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.

Shell
curl "$KNOWNPRINT_API/v1/events/evt_udrovzh6kvpxnvjfj62hp3nape" \
  -H "Authorization: Bearer $KNOWNPRINT_SECRET_KEY"
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

ParameterTypeMeaning
request_idevt_ and 26 charactersThe request id the agent returned

Response

200 with 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 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

StatusTypeWhen
401unauthorizedNo valid secret key
403forbidden_scopeThe key lacks events:read
404not_foundThe id is malformed, belongs to another environment, never existed or has passed retention
409deletion_pendingThe event's visitor is being deleted
429rate_limitedThe 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.

Shell
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.

MemberTypeEffect
linked_idString of 1 to 128 characters, or nullA string sets the linked id; null clears it; leaving the member out keeps it.
tagsObject, or nullAn 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.

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. 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.
  • 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.

Errors

StatusTypeWhen
400schema_mismatchThe body is not JSON, or the content type is not application/json
401unauthorizedNo valid secret key
403forbidden_scopeThe key lacks events:write
404not_foundNo such event in this environment
409deletion_pendingThe event's visitor is being deleted
409idempotency_conflictThe Idempotency-Key was used for another request, or is still in flight
422validation_failedinvalid_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
429rate_limitedThe 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 explains when to send each label.

Shell
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"}'
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

MemberTypeRequiredMeaning
labelfraud or legitYesYour verdict
noteString, at most 1,000 charactersNoFree 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"
}
MemberTypeMeaning
idIntegerThe feedback's id
event_idevt_ idThe event it labels
labelfraud or legitYour verdict
noteString or nullYour note
created_atRFC 3339 timeWhen it was recorded

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

Errors

StatusTypeWhen
400schema_mismatchThe body is not JSON, or the content type is not application/json
401unauthorizedNo valid secret key
403forbidden_scopeThe key lacks events:write
404not_foundNo such event in this environment
409deletion_pendingThe event's visitor is being deleted
409idempotency_conflictThe Idempotency-Key was used for another request, or is still in flight
422validation_failedinvalid_body (a label other than fraud or legit, a note over 1,000 characters, an unknown member) or idempotency_key
429rate_limitedThe key's bucket is empty