API ReferenceGroups

Top groups

GET
/groups/top

List your organization's most active groups of a given type (e.g. teams or workspaces) over a window, sortable by active users, events, or last-seen. Covers all projects in your organization unless project_id is given; requires owner/admin. The built-in company type is not supported here (use top_companies). Events are attributed to the group sent with each event, not current membership. Returns group_key, name, events, users, and last_seen per group.

Authorization

AuthorizationBearer <token>

Organization API Token (prefixed sk_) sent as Authorization: Bearer sk_.... Create one in Settings and grant it scopes. Server-side only.

In: header

Query Parameters

group_type*string

The group type key, e.g. "workspace" or "team". Not "company".

Match^[a-z][a-z0-9_]{0,63}$
project_id?string

Limit results to one project (a project_id from list_projects). Omit to include every project in your organization.

Match^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
Formatuuid
range_days?integer

Look-back window in days (1-365). Defaults to 30.

Range1 <= value <= 365
sort?string

Sort field. Defaults to "users".

Value in

  • "users"
  • "events"
  • "last_seen"
limit?integer

Maximum groups to return (1-200). Defaults to 50.

Range1 <= value <= 200

Response Body

curl -X GET "https://example.com/groups/top?group_type=string"
Empty