Siftil Documentation PT Sign in Create free account

API reference

Base: https://siftil.com. Everything is JSON and UTF-8. Error responses have { "error": "message" } and, when it helps you handle it, code. Error messages are in Portuguese; branch on the status and code.

Authentication

CallerHowRoutes
Browser?k=pk_… in the URL/v1/agent.js, /v1/challenge, /v1/ping, /v1/identify
Your serverAuthorization: Bearer sk_…every other /v1/ route
First-party proxy?k=pk_… + signed x-siftil-* headers/v1/challenge, /v1/identify (details)

The secret key never goes to the browser. If it leaks, rotate it with POST /v1/account/rotate.

Browser

The agent calls these routes on its own. You only need them if you write another client.

GET /v1/agent.js

The agent (JavaScript, cached for 1 hour).

GET /v1/challenge?k=pk_…

Anti-replay challenge: signed nonce, time and proof-of-work difficulty. The proof is computed over the browser's signature, so a solved challenge is useless for another device; valid for 2 minutes and single use. Does not count against the quota.

StatusWhen
200{ n, t, d, s }
401invalid public key
403origin not in the authorized origins

GET /v1/ping?k=pk_…

Answers 1, uncached, with Timing-Allow-Origin. The agent measures latency here.

POST /v1/identify?k=pk_…

Body: the agent package (Content-Type: text/plain or application/json, up to 96 KB). Counts one identification against the quota.

json
{
  "requestId": "fd15e76e8581d83a012b14fa",
  "visitorId": "rv_2fa950ff96f748c8b9fd038988705c6c",
  "isNew": true,
  "confidence": 0,
  "token": "rst1.…",
  "sealed": "rss1.…",
  "suspect": { "score": 15, "risk": "high" }
}
StatusWhen
200identified
400invalid JSON or malformed package
401invalid public key, or invalid proxy signature (code: "proxy")
403unauthorized origin
413package larger than 96 KB
429monthly quota used up ({ plan, quota })

Events

GET /v1/events/:requestId

The full event of one identification. Format in Event.

bash
curl https://siftil.com/v1/events/fd15e76e8581d83a012b14fa -H 'authorization: Bearer sk_…'

404 if the event does not exist in this account or is older than 90 days.

GET /v1/events

Recent events, newest first.

ParameterDefaultDescription
sincenow − 24 hMilliseconds since 1970. Only events after this.
limit100Up to 500.
risk—low, medium or high.
json
{ "events": [ { "requestId": "…", "visitorId": "…", "t": 1795314726000, "suspect": { … }, … } ] }

POST /v1/events/:requestId/label

Marks the event as fraud or legitimate. Labels train your account's model; every 10 labels, from 20 on, it retrains on its own.

bash
curl -X POST https://siftil.com/v1/events/REQUEST_ID/label \
  -H 'authorization: Bearer sk_…' -H 'content-type: application/json' \
  -d '{"fraud": true}'
json
{ "ok": true, "labels": 40, "model": { "n": 40, "auc": 0.94 } }

Sending again for the same event replaces the label.

Visitors

GET /v1/visitors/:visitorId

Visitor history: { visitorId, events: [...] }, newest first. limit up to 500 (default 100).

The same device in other browsers (Chrome and Firefox on the same machine, for example). See Related visitors.

json
{
  "visitorId": "rv_4915…",
  "related": [
    { "visitorId": "rv_8a02…", "browser": "firefox", "score": 0.89, "matched": ["os", "timezone", "screen", "cores", "dpr", "fonts"], "sharedIps": 1, "lastSeen": 1795314726000 }
  ]
}

DELETE /v1/visitors/:visitorId

Deletes everything about the visitor in this account: events, history, search indexes and the labels of those events. Use it for erasure requests (LGPD art. 18, GDPR art. 17). Cannot be undone.

json
{ "ok": true, "visitorId": "rv_4915…", "events": 12 }

Model

GET /v1/model

{ labels, fraud, model }: how many labels you have, how many are fraud, and the current model (weights, AUC, date).

POST /v1/model

Retrains now. 400 with fewer than 20 labels or fewer than 3 on each side.

Account

GET /v1/account

json
{
  "id": "t_61e1bb0ea3f0",
  "email": "dev@yourcompany.com",
  "plan": "free",
  "quota": 10000,
  "usage": { "month": "2026-11", "identifications": 1520 },
  "publicKey": "pk_…",
  "tokenSecret": "…",
  "sealKey": "…",
  "proxySecret": "…",
  "origins": ["https://www.yourcompany.com"],
  "webhook": "https://api.yourcompany.com/siftil",
  "model": { "n": 40, "auc": 0.94, "trained": 1795314726000 }
}

PATCH /v1/account

Changes authorized origins and webhook. Missing fields stay as they are.

json
{ "origins": ["https://www.yourcompany.com", "*.yourcompany.com"], "webhook": "https://api.yourcompany.com/siftil" }

POST /v1/account/rotate

Rotates a key.

json
{ "key": "secret" }   →   { "ok": true, "secretKey": "sk_…" }
{ "key": "public" }   →   { "ok": true, "publicKey": "pk_…" }

The old secret key stops working immediately and the new one is shown only in this response. The old public key stops working within 30 seconds; update your site's tag first, or visitors go unidentified until you deploy.

POST /v1/verify

Checks a browser token. See Server-side verification.

Signup

POST /v1/signup

json
{ "email": "dev@yourcompany.com", "name": "Your Company", "site": "https://www.yourcompany.com" }

201 with { id, publicKey, secretKey, tokenSecret, sealKey, proxySecret, plan, quota }. site becomes the first authorized origin. 400 code: "email" for an invalid e-mail; 429 code: "rate" after 3 accounts from the same network in a day.

Limits

WhatLimit
identify package96 KB
linkedId128 characters
GET /v1/events, /v1/visitors/:id500 per call
Event retention90 days
Token validity10 minutes
Challenge validity2 minutes; single use
Proxy signature5 minutes of clock tolerance

Siftil · API v1 documentation