Auth API reference

Auth API · Platform-Stats

get/v1/workspaces/{workspace_id}/statsAuth

Auth stats for a workspace

Active end users over 1, 7 and 30 days, total and new end users, production app count, last end-user activity and a daily active-users series, for the workspace's **production** apps only. **Active** means the end user signed in successfully or refreshed a session. Customer backends verify access tokens locally against the JWKS, so use between two refreshes is invisible to ProductCraft; resolution is bounded by each app's access-token lifetime. Days are UTC. Counts only: no end-user identifiers. Cached for up to 60 seconds (`generated_at`).

Path parameters

workspace_id*string · uuid

Workspace id.

Query parameters

windowenum (3)

Window for `in_window.new_end_users` and the length of `series`. The three `active_users_*` counts are always returned.

Response · 200 Auth stats.

window*object

Window the counts cover.

Example: "30d"

generated_at*string · date-time

When these numbers were computed. Responses are cached for up to 60 seconds.

Example: "2026-10-07T09:00:00.000Z"

last_activity_at*string · date-time

Most recent end-user sign-in or session refresh across the workspace's production apps. Null when none is on record.

Example: "2026-10-07T08:41:12.000Z"

totals*object

All-time counts.

in_window*object

Activity counts.

series*object

Daily active users.

by_app*array

Every production app in the workspace, busiest first: by `active_users_30d`, then `end_users`. Empty when the workspace has no production app.

Example

Request

GET https://api.auth.productcraft.co/v1/workspaces/{workspace_id}/stats
Authorization: Bearer YOUR_TOKEN

Response

{
  "window": "30d",
  "generated_at": "2026-10-07T09:00:00.000Z",
  "last_activity_at": "2026-10-07T08:41:12.000Z",
  "totals": {},
  "in_window": {},
  "series": {},
  "by_app": [
    {
      "app_id": "5b1f0c2e-8a7d-4c2b-9f53-0d1e6f3a9b21",
      "active_users_30d": 97,
      "end_users": 1020
    }
  ]
}