Platform API reference

Platform API · Workspace-Stats

get/v1/workspaces/{workspace_id}/statsAuth

Workspace stats

Member count, active platform API keys, admin changes in the window with a daily series, the last admin change and the last API-key use, for the console dashboard. Admin changes are workspace audit events that record a mutation. Reads (any action ending `.read`), sign-ins (`auth.signin.succeeded`) and MCP tool-call rows (`workspace.mcp_tool.*`) are not counted, so opening the console does not move the numbers. Days are UTC. Counts and timestamps only: no actor 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` and the length of `series`, in UTC days ending today.

Response · 200 Workspace 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 admin change (same definition as `in_window.audit_events`: reads, sign-ins and MCP tool-call rows excluded), any time. Null when none.

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

totals*object

Current counts.

in_window*object

Counts for the window.

series*object

Daily admin changes.

Example

Request

GET https://api.platform-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": {}
}