/v1/apps/{app_id}/end-user-insightsAuthAuth health for this app over the last 30 days: verification completion, sign-in failure rate, MFA adoption, password-reset follow-through, and session counts. Rates are null when there is nothing to divide by.
Path parameters
app_id*string · uuidId of the app.
Response · 200 Aggregated auth health.
window_days*numberWindow, in days, every in-window figure covers.
Example: 30
users*objecttotal*numberEnd users in the app.
Example: 257
new_in_window*numberEnd users created in the window.
Example: 31
active_in_window*numberEnd users who were the actor of at least one audit event in the window.
Example: 88
verification*objectrequested*numberVerification requests in the window.
Example: 40
completed*numberVerifications completed in the window.
Example: 33
completion_rate*number`completed / requested`, 0–1. Null when nothing was requested.
Example: 0.825
signin*objectsuccess*numberSuccessful sign-ins in the window.
Example: 410
failed*numberFailed sign-ins in the window.
Example: 12
failure_rate*number`failed / (success + failed)`, 0–1. Null when there were no attempts.
Example: 0.028
mfa*objectusers_with_factor*numberEnd users with at least one enabled factor.
Example: 19
adoption_rate*number`users_with_factor / users.total`, 0–1. Null when the app has no users.
Example: 0.074
by_type*objectEnd users with an enabled factor, by factor type (a user with two types counts in both).
Example: {"totp":12,"webauthn":9}
password_reset*objectrequested*numberPassword resets requested in the window.
Example: 7
completed*numberPassword resets completed in the window.
Example: 5
sessions*objectactive*numberSessions that are neither revoked nor expired.
Example: 120
with_mfa*numberSessions with a completed MFA step (`mfa_at` set), whether or not still active.
Example: 14
Example
Request
GET https://api.auth.productcraft.co/v1/apps/{app_id}/end-user-insights
Authorization: Bearer YOUR_TOKENimport { Auth } from "@productcraft/auth";
// Admin routes read PRODUCTCRAFT_API_KEY; consumer routes need no key
const auth = new Auth();
const endUserInsights = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUserInsights.retrieve();auth.admin.app(…).endUserInsights.retrieve(options?): Auth.EndUserInsights
Response
{
"window_days": 30,
"users": {
"total": 257,
"new_in_window": 31,
"active_in_window": 88
},
"verification": {
"requested": 40,
"completed": 33,
"completion_rate": 0.825
},
"signin": {
"success": 410,
"failed": 12,
"failure_rate": 0.028
},
"mfa": {
"users_with_factor": 19,
"adoption_rate": 0.074,
"by_type": {
"totp": 12,
"webauthn": 9
}
},
"password_reset": {
"requested": 7,
"completed": 5
},
"sessions": {
"active": 120,
"with_mfa": 14
}
}