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
| Caller | How | Routes |
|---|---|---|
| Browser | ?k=pk_… in the URL | /v1/agent.js, /v1/challenge, /v1/ping, /v1/identify |
| Your server | Authorization: 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.
| Status | When |
|---|---|
| 200 | { n, t, d, s } |
| 401 | invalid public key |
| 403 | origin 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.
{
"requestId": "fd15e76e8581d83a012b14fa",
"visitorId": "rv_2fa950ff96f748c8b9fd038988705c6c",
"isNew": true,
"confidence": 0,
"token": "rst1.…",
"sealed": "rss1.…",
"suspect": { "score": 15, "risk": "high" }
}| Status | When |
|---|---|
| 200 | identified |
| 400 | invalid JSON or malformed package |
| 401 | invalid public key, or invalid proxy signature (code: "proxy") |
| 403 | unauthorized origin |
| 413 | package larger than 96 KB |
| 429 | monthly quota used up ({ plan, quota }) |
Events
GET /v1/events/:requestId
The full event of one identification. Format in Event.
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.
| Parameter | Default | Description |
|---|---|---|
since | now − 24 h | Milliseconds since 1970. Only events after this. |
limit | 100 | Up to 500. |
risk | — | low, medium or high. |
{ "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.
curl -X POST https://siftil.com/v1/events/REQUEST_ID/label \
-H 'authorization: Bearer sk_…' -H 'content-type: application/json' \
-d '{"fraud": true}'{ "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).
GET /v1/visitors/:visitorId/related
The same device in other browsers (Chrome and Firefox on the same machine, for example). See Related visitors.
{
"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.
{ "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
{
"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.
{ "origins": ["https://www.yourcompany.com", "*.yourcompany.com"], "webhook": "https://api.yourcompany.com/siftil" }origins: up to 50, ashttps://domain[:port]or*.domain(wildcards only matchhttps). An empty list accepts any origin.webhook: anhttps://URL, ornullto turn it off.
POST /v1/account/rotate
Rotates a key.
{ "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
{ "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
| What | Limit |
|---|---|
identify package | 96 KB |
linkedId | 128 characters |
GET /v1/events, /v1/visitors/:id | 500 per call |
| Event retention | 90 days |
| Token validity | 10 minutes |
| Challenge validity | 2 minutes; single use |
| Proxy signature | 5 minutes of clock tolerance |
Siftil · API v1 documentation