/v1/stats/meAuthAggregate counts for the signed-in PlatformUser
Returns total Auth apps owned by workspaces the caller is a member of, end-users across those apps, and active API keys across those apps. Pass `workspace_id` to scope the counts to a single workspace — required from the dashboard so cross-tenant data does not bleed into the totals.
Query parameters
workspace_idstringLimit the result to this one workspace (UUID). The caller must be a member; an id the caller does not belong to returns nothing. Omit to cover every workspace the caller belongs to.
Response · 200 Aggregate counts.
apps*numberAuth apps the caller is a member of (any role).
Example: 3
end_users*numberEndUsers across those apps.
Example: 1247
api_keys_active*numberAPI keys across those apps. Rows are hard-deleted on revoke so existence implies active.
Example: 8
Example
Request
GET https://api.auth.productcraft.co/v1/stats/me
Authorization: Bearer YOUR_TOKENimport { Auth } from "@productcraft/auth";
// Admin routes read PRODUCTCRAFT_API_KEY; consumer routes need no key
const auth = new Auth();
const platformUserStats = await auth.stats.me();auth.stats.me(params?, options?): Auth.PlatformUserStats
Response
{
"apps": 3,
"end_users": 1247,
"api_keys_active": 8
}