Sending registration events for risk scoring
How to instrument the sign-up flow so that BotBye risk scoring can detect multi-accounting and registration farms.
Send two events per registration
Registration detections count accounts that were actually created, not form submissions:
- a second account registered on the same mailbox within 24 hours, including its aliases (john+1@, j.o.h.n@gmail.com)
- many accounts registered from one IP within a day (registration farms)
- etc.
At the same time, the only moment a decision can still stop an abusive sign-up is before the account is created. So each registration needs two calls:
1. Before creating the account — status: ATTEMPTED. This is the decision you act on: a BLOCK here means the account is never created.
2. After the outcome is known — status: SUCCESSFUL with the new account id, or status: FAILED if the registration was rejected. This is the event the counters are built from.
If only the first call is sent, the counters above stay at zero: the engine sees attempts but never learns which mailbox or IP ended up owning an account. If only the second call is sent, the counters work, but the decision arrives after the account already exists.
Name the event registration
Set event.type to "registration" on every call (letter case doesn't matter).
Set the status to the real outcome
- "ATTEMPTED" — the form was submitted and the account doesn't exist yet. Send it before you write anything
- "SUCCESSFUL" — the account was created
- "FAILED" — the registration was rejected (address already taken, validation error, blocked by you). Optional for scoring, but it keeps the attempt's outcome visible in the dashboard
Map the user fields
Set status, accountId, email and username per step:
| Step | status | accountId | email / phone / username |
|---|---|---|---|
| Before creating the account | ATTEMPTED | empty string "" | as submitted |
| Account created | SUCCESSFUL | the new account id | as submitted |
| Registration rejected | FAILED | empty string "" | as submitted |
On the SUCCESSFUL event, send the same id you will later send as accountId on that user's logins.
Send the address the user submitted, not one read back from your profile: if your system masks or rewrites stored contacts, the masked value won't match the next sign-up on the same mailbox.
Sign-ups by phone only: send phone and leave email empty. The mailbox detection doesn't apply to them; the IP detection still does.
Example (Node SDK)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
async function handleRegistration({
ip, headers, method, url, token, login, email, phone, password,
}) {
const submitted = { username: login, email, phone };
// 1. before anything is written: this is the decision that can stop the sign-up
const precheck = await evaluate({
type: "full",
request: { ip, headers, requestMethod: method, requestUri: url, token },
event: { type: "registration", status: "ATTEMPTED" },
// the account doesn't exist yet: empty accountId, never a placeholder
user: { accountId: "", ...submitted },
});
if (precheck.decision === "BLOCK") return { status: 403 };
// CHALLENGE -> step up (CAPTCHA); ALLOW -> proceed
let account;
try {
account = await createAccount({ login, email, phone, password });
} catch (e) {
// 2a. rejected: report the outcome, still without an accountId
await evaluate({
type: "risk",
request: { ip },
event: { type: "registration", status: "FAILED" },
user: { accountId: "", ...submitted },
botbyeResult: precheck.botbye_result, // links both calls into one event
});
throw e;
}
// 2b. created: this event is what the per-mailbox / per-IP counters count
await evaluate({
type: "risk",
request: { ip },
event: { type: "registration", status: "SUCCESSFUL" },
// the new account id; contacts as SUBMITTED, not read back from the profile
user: { accountId: account.id, ...submitted },
botbyeResult: precheck.botbye_result,
});
return { status: 201 };
}
The token is validated once, in the first call. The second call uses type: "risk" and passes botbye_result from the first response, so both are shown as one event; if the response has no botbye_result, omit it.
What you'll see
Once SUCCESSFUL registrations start flowing in, the ATTEMPTED call begins returning CHALLENGE / BLOCK on the patterns above, with email_multi_accounting or ip_registration_burst in signals. The first registration on a mailbox or IP never triggers them.