knownprintDocs

Privacy and security

Limits

Every rate limit, size limit, lifetime, page size, retention period and webhook retry rule of knownprint in one place, with what your code should do when it meets one.

This page lists every number your integration can run into: how fast you may call, how large a request may be, how long ids and records live, and how webhooks retry. The same limits apply on every account today.

Rate limits

knownprint limits requests with token buckets. A bucket holds a burst of requests and refills at a steady rate; a request that finds it empty answers 429 with the problem type rate_limited and a Retry-After header.

Server API

These apply to every route your backend calls with a secret key (API reference).

BucketCounted perRateBurst
RequestsSecret key50 a second150
Deletions (DELETE /v1/visitors/{visitor_id}, DELETE /v1/linked/{linked_id})Secret key, on top of the request bucket2 a second2
Failed authenticationClient address30 a minute30

A failed authentication is a request with a missing, malformed, unknown or revoked key. Once a client address has used up its 30, further failures from it answer 429 instead of 401 until the bucket refills. A request with a valid key never touches this bucket.

Browser agent

These apply to the requests the script makes through your proxy (browser agent). A visitor's address is counted as the full IPv4 address, or the /64 network of an IPv6 address, and per account.

BucketCounted perRateBurst
Challenges (the request that starts an identification)Visitor address60 a minute60
IdentificationsVisitor address30 a minute30
IdentificationsRecognised visitor60 a minute60
Challenges and identificationsPublic key50 a second150
Identifications, when the key has a daily_capPublic key, per UTC dayYour cap

A visitor who goes past a limit gets no request id for that action; the page's identify() rejects (browser agent errors). Your backend then sees the action arrive without a request id: treat it as an unknown visit, not as a pass. A daily cap that is reached answers 429 with a Retry-After that runs to the next UTC midnight.

Thirty identifications a minute from one address is far above what one person causes. Offices, schools and mobile carriers put many people behind one address, so identify at the moments that matter (signup, login, checkout, a sensitive change) rather than on every page view.

Rate limit headers

Every answer of the server API reports the key's request bucket, once the key and its scope check out. The script's challenge and identification answers report the visitor address bucket instead, never your key's.

HTTP
RateLimit: limit=150, remaining=149, reset=1
RateLimit-Policy: 150;w=3
HeaderMeaning
RateLimitlimit is the burst, remaining the requests left now, reset the whole seconds until the bucket is full again.
RateLimit-PolicyThe burst, and w, the seconds over which the bucket refills from empty.
Retry-AfterOn a 429 only: the whole seconds to wait before retrying.

Retrying after a 429

Wait for Retry-After, then retry the same request. A write that carries an Idempotency-Key is safe to repeat: a 429 is never stored against the key, so the retry runs.

retry.js
async function callKnownprint(path, init = {}, attempts = 5) {
  for (let i = 0; ; i++) {
    const res = await fetch(`${process.env.KNOWNPRINT_API}${path}`, {
      ...init,
      headers: {
        ...init.headers,
        Authorization: `Bearer ${process.env.KNOWNPRINT_SECRET_KEY}`,
      },
    });
    if (res.status !== 429 || i + 1 >= attempts) return res;
    const wait = Number(res.headers.get('retry-after') ?? '1');
    await new Promise((resolve) => setTimeout(resolve, Math.max(1, wait) * 1000));
  }
}

For batch work, such as a backfill of feedback or a run of deletions, pace requests below the rate instead of relying on retries: under 50 a second per key, and under 2 a second for deletions.

Request size limits

A request whose body is larger than its route allows answers 413 payload_too_large. Bodies are JSON: send Content-Type: application/json. Any other media type, and a body that is not valid JSON, answers 400 schema_mismatch.

RequestLargest body
An identification from the script64 KB
A challenge from the script2 KB
A follow-up request from the script1 KB each
Any server API request64 KB

Other limits on every request:

LimitValue
JSON nesting64 levels; deeper answers 400 schema_mismatch
Time to send a request60 seconds from the start of the request to the end of its body

Field limits

FieldWhereLimit
linkedIdThe script's load() and identify()Up to 128 characters as JavaScript counts a string's length, well-formed Unicode
linked_idPATCH /v1/events/{request_id}, GET /v1/events, DELETE /v1/linked/{linked_id}1 to 128 characters (Unicode code points)
tagsThe script's load() and identify()A plain object with non-empty names and string, finite number or boolean values, under 4,096 bytes as canonical JSON
tagsPATCH /v1/events/{request_id}Up to 64 properties; names 1 to 64 characters; string values up to 256 characters; under 4,096 bytes as canonical JSON
notePOST /v1/events/{request_id}/feedbackUp to 1,000 characters
labelPOST /v1/events/{request_id}/feedbackfraud or legit
ipGET /v1/eventsAn address or CIDR range, up to 49 characters
min_suspect_scoreGET /v1/events0 to 100
urlPOST /v1/webhooks, PATCH /v1/webhooks/{id}Up to 2,048 characters, https, resolving to public addresses only
event_typesPOST /v1/webhooks, PATCH /v1/webhooks/{id}1 to 8 distinct types
allowed_originsPOST /v1/keys, public keyAt least one serialised origin
daily_capPOST /v1/keys, public key1 to 2,147,483,647, or null for none
allowed_ip_rangesPOST /v1/keys, public keyAddresses or CIDR ranges whose host bits are zero
scopesPOST /v1/keys, secret keyAt least one of the six scopes, each once
Idempotency-KeyEvery write route1 to 255 visible ASCII characters, no spaces

A field outside its limit answers 422 validation_failed on the server API. In the page, a linkedId or tags outside its limit makes load() or identify() reject with invalid_options before anything is sent (LoadOptions).

Ids and lifetimes

WhatLifetimeWhat it means for your code
Request id (evt_...), for your backend to act on10 seconds: expiresAt in the page, received_at plus 10 secondsSend it to your backend with the action and check it there at once. Accept each request id once (verify in your backend).
Request id, as the id of its eventThe event clock (below)GET /v1/events/{request_id} reads it for as long as the event is kept.
Signals refined after the identificationincognito and suspect_score within about ten seconds; bot up to 30 minutesRead the event when the visitor acts (when signals change).
Idempotency-Key24 hoursA repeat within 24 hours answers the stored result, with Idempotency-Replayed: true. A repeat while the first is still running waits up to 5 seconds, then answers 409 idempotency_conflict. The same key with another method, path or body answers 409 idempotency_conflict at once. A 429 or a 5xx is not stored, so a retry runs again.
A revoked key, a new or retired proxy secretTakes effect within a minuteWait a minute after creating a proxy secret before your proxy uses it (security).
Deletion job (del_...)Runs within minutesReads of the visitor answer 409 deletion_pending until it finishes.

Pagination

RoutePage sizeOrder
GET /v1/eventslimit 1 to 500, 50 by defaultNewest first
GET /v1/webhooks/{id}/deliverieslimit 1 to 500, 50 by defaultNewest first
GET /v1/visitors/{visitor_id}/related, GET /v1/linked/{linked_id}/relatedUp to 50 visitors and 50 linked ids, not paged
GET /v1/keys, GET /v1/webhooksEvery key or webhook of the environment, not pagedOldest first

A paged answer carries next_cursor, an opaque string of at most 512 characters, or null on the last page. Pass it back as cursor with the same filters to read the next page. A limit outside its range answers 422 validation_failed ("A query parameter is unknown, repeated or has an invalid value."), and a cursor that is not one knownprint gave answers 422 with "The cursor is malformed." (events API).

Shell
# Every event of one account, page by page (needs jq).
cursor=""
while :; do
  args=(--data-urlencode "linked_id=$ACCOUNT_ID" --data-urlencode "limit=500")
  [ -n "$cursor" ] && args+=(--data-urlencode "cursor=$cursor")
  page=$(curl -sS -G "$KNOWNPRINT_API/v1/events" "${args[@]}" \
    -H "Authorization: Bearer $KNOWNPRINT_SECRET_KEY")
  echo "$page" | jq -c '.data[]'
  cursor=$(echo "$page" | jq -r '.next_cursor // empty')
  [ -z "$cursor" ] && break
done

Retention

Two clocks are set for your account; everything else has a fixed period. The full table, and what each record holds, is on the privacy page.

WhatHow long
EventsThe event clock: 30 to 365 days, 90 by default
Raw values the browser sentThe raw clock: 7 to 90 days, 30 by default
Full IP address in an event30 days, then cut to its /24 or /48 network
Visitor recordUntil 400 days pass without a visit
Match records: how each identification was decidedThe event clock, except the newest record for each stored token, which is kept with the visitor record
Keyed one-way hashes of the visitor's address, its network and its operatorKept with the visitor record until 400 days pass without the browser being seen there; a full IPv6 address about a day
knownprint's cookie (kp_t, unless your account names another)Up to 400 days from the last answer that set it
The token in the browser's storageUntil the browser removes it, or your page calls forget()
Feedback you send on an eventThe event clock
One-way record of a deletion30 days
Webhook delivery records30 days after the last attempt
Idempotency records24 hours

Webhooks

RuleValue
Attempts per delivery8
When each attempt runs, counted from the firstAt once, then after 1 minute, 5 minutes, 30 minutes, 2 hours, 12 hours, 24 hours and 72 hours
Timeout of one attempt10 seconds
SuccessAny 2xx answer. Any other status, a 3xx included, is a failure; redirects are not followed.
After the eighth failureThe delivery is dead. Replay it with POST /v1/deliveries/{id}/replay once your receiver is fixed.
Signature timestamp tolerance5 minutes either way
Delivery recordsListed with GET /v1/webhooks/{id}/deliveries for 30 days after their last attempt

A delivery that times out or fails is attempted again even if your receiver did act on it, so make your handler safe to run twice: use the webhook-id header, which stays the same across the attempts of one delivery, to skip one you already handled. See webhooks and verify webhooks.