Management API
Events
Fox Login records an event for every sign-up, sign-in, failed sign-in, password reset and two-factor change. The log lives in the application's region. Reading it needs events:read, which every secret key role has.
List events
curl "https://api.foxlogin.app/v1/applications/app_8f2c91a7/events?limit=50" \
-H "Authorization: Bearer $FOXLOGIN_SECRET_KEY"const res = await fetch(
"https://api.foxlogin.app/v1/applications/app_8f2c91a7/events?limit=50",
{ headers: { Authorization: `Bearer ${process.env.FOXLOGIN_SECRET_KEY}` } },
);
const page = await res.json();
for (const ev of page.data) console.log(ev.created_at, ev.type, ev.user_id);{
"data": [
{
"id": "evt_123",
"type": "sign_in.failed",
"user_id": "usr_tr_8f2c91a7",
"ip": "203.0.113.4",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 14_6) …",
"created_at": "2026-12-02T09:14:00Z",
"data": { "method": "password" }
}
],
"next_cursor": "eyJFVSI6ImV2dF85OCIsIlRSIjoiZXZ0XzEyMyJ9",
"regions_unavailable": [],
"partial": false
}| Query parameter | Meaning |
|---|---|
user_id |
Only this user's events. |
limit |
1 to 100, default 50. |
cursor |
The next_cursor of the previous page. |
There is no filter by event type or date yet. Events come newest first, so read pages until you pass the date you need and filter the types on your side.
Event types
| Type | Recorded when | data |
|---|---|---|
user.created |
A user finished sign-up, or you created one through the Management API. | { "method": "password" }, { "method": "google" } or { "method": "api" } |
user.signed_in |
A user signed in, including right after sign-up or a password reset. | method: password, email_code, google, sign_up, password_reset or mfa_totp |
sign_in.failed |
A password sign-in failed. | { "method": "password" } |
sign_in.mfa_required |
A sign-in step asked for the second factor. | method of the first step |
password.reset |
A user set a new password with a reset code. | {} |
mfa.enrolled |
A user turned on TOTP. | { "factor": "totp" } |
mfa.removed |
A user turned off TOTP. | { "factor": "totp" } |
sign_up.existing_email |
Someone tried to sign up with an email that already has an account. | {} |
identity.linked |
A Google account signed in for the first time and was linked to the existing user with the same email. | { "provider": "google" } |
ip and user_agent come from the request that caused the event and are null for events caused by the Management API.
Read the whole log for one user
const headers = { Authorization: `Bearer ${process.env.FOXLOGIN_SECRET_KEY}` };
let cursor: string | null = null;
do {
const url = new URL("https://api.foxlogin.app/v1/applications/app_8f2c91a7/events");
url.searchParams.set("user_id", "usr_tr_8f2c91a7");
url.searchParams.set("limit", "100");
if (cursor) url.searchParams.set("cursor", cursor);
const page = await (await fetch(url, { headers })).json();
if (page.partial) throw new Error(`Region did not answer: ${page.regions_unavailable}`);
for (const ev of page.data) console.log(ev.created_at, ev.type, ev.ip);
cursor = page.next_cursor;
} while (cursor);If the region does not answer, the response is 200 with empty data, partial: true and the region in regions_unavailable. Check partial before you treat an empty page as the end of the log.
To act on events as they happen instead of reading the log, subscribe a webhook endpoint.