---
title: "List realm groups"
method: GET
path: "/clusters/{cluster_id}/realms/{realm_name}/groups"
tags: ["Realm Groups"]
---

# List realm groups

`GET /clusters/{cluster_id}/realms/{realm_name}/groups`

## Request

- Base URL: `http://localhost:8000`
- URL: `http://localhost:8000/clusters/{cluster_id}/realms/{realm_name}/groups`
- Auth: API key in header `API-Key`

Returns groups defined in the specified realm.

When `include_subgroups=true`, each top-level group includes its direct child groups in `subgroups`.

Required scope: `realm-groups:read`

## Path parameters

- `cluster_id` string, uuid, required
- `realm_name` string, required: Keycloak realm name (not ID). Must start with a letter; allows letters, digits, and hyphens.

## Query parameters

- `include_subgroups` boolean

## Headers

- `API-Version` '2026-06-01.beta', required

## Response `200`

The request has succeeded.

- RealmGroup[]
  - `id` string, uuid, required
  - `name` string, required
  - `path` string, required: Canonical realm group path.
  - `sub_group_count` integer: Number of direct child groups.
  - `subgroups` RealmSubGroup[]: Direct child groups. Only populated when `include_subgroups=true` is passed to the list endpoint.
    - `id` string, uuid, required
    - `name` string, required
    - `path` string, required: Canonical realm group path.
    - `sub_group_count` integer: Number of direct child groups.

## Other responses

- `401`: Access is unauthorized.
- `403`: Access is forbidden.
- `404`: The server cannot find the requested resource.
- `429`: Client error
- `500`: Server error
- `501`: Server error

---

[API](https://skmtc.dev/skycloak/apis/skycloak-public-api.md) · [All operations](https://skmtc.dev/skycloak/apis/skycloak-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/skycloak/apis/skycloak-public-api/revisions/33a69e2ce35f?raw)
