List Groups
List groups, newest first. With tenant_id, only that tenant's groups; without it, groups in every tenant you manage plus your MSP's own company. A tenant_id outside your MSP returns an empty list.
Paginate by passing next_cursor as cursor with the same filters and limit, until next_cursor is null. The last page can be empty. The cursor is the last group's created_at, so groups sharing a timestamp across a page boundary can be skipped; to enumerate every group, page with limit and offset (ordered by created_at, then id). Use cursor or offset, not both: offset skips groups after the cursor is applied.
Requires an API key for an MSP user whose role includes the Manage Groups permission. Tenant (company) users, including tenant admins, receive 403. Groups in tenants your MSP does not manage are never returned or changed.
Query Parameters
- Type: stringnullabletenant
_id Tenant ID to filter by (e.g., tenant_abc123)
- Type: integerlimitmin:1max:100
Number of groups to return
- Type: stringnullablecursor
The
next_cursorfrom the previous page (a created_at timestamp; URL-encode it) - Type: stringnullablesearch
_term Case-insensitive substring match on the group name
- Type: stringnullablename
Exact, case-sensitive group name
- Type: integeroffsetmin:0
Number of groups to skip. Use
cursorinstead to page through results.
Responses
- application/json
- application/json
- application/json
- application/json
- application/json
curl 'https://ai.hatz.ai/v1/admin/groups?limit=50&offset=0' \
--header 'X-API-Key: YOUR_SECRET_TOKEN'
{
"groups": [
{
"id": "group_X7VAK72dp5nX3Cd6JXwdPg6OxD",
"name": "Sales",
"description": "Sales team",
"tenant_id": "tenant_abc123",
"owner": {
"id": "user_gE4JlrAxlgKXEfvA3jZexy6Pxq",
"email": "admin@yourmsp.com",
"first_name": "Alex",
"last_name": "Admin"
},
"members": [
{
"id": "user_n55abP89ZowO6iKAx7vqWjrqnZ",
"email": "sam@example.com",
"first_name": "Sam",
"last_name": "Rivera"
}
],
"workshop_items": [
{
"id": "5143da6d-c5de-4c2f-a0b6-3df4d0e542f0",
"item_type": "agent"
}
],
"created_at": "2026-11-05T20:02:42.715415+00:00",
"updated_at": "2026-11-05T20:02:42.715415+00:00"
}
],
"next_cursor": "string"
}