# Nested Groups

The subgroups of the user group.
|  Resource  |     ```GENERIC /api/groups/{groupID}/subGroups ```    |
| --- | --- |
|  Returned entity  |  [NestedGroup](api-entity-NestedGroup.html). For the description of the entity attributes, see [Supported Fields](#NestedGroup-supported-fields) section.  |
|  Supported methods  |      * `GET`: [Read a List of NestedGroups](#get_all-NestedGroup-method).    |

## NestedGroup attributes

Represents a user group in YouTrack that either has a parent or subgroups.

Extends [UserGroup](api-entity-UserGroup.html)

### Attributes

This table describes attributes of the `NestedGroup` entity.

* To receive an attribute in the response from the server, specify it explicitly in the `fields` request parameter.

* To update an attribute, provide it in the body of a POST request.

|  Field  |  Type  |  Description  |
| --- | --- | --- |
|  id  |  String  |  The database ID of the group. `Read-only`.  |
|  parentGroup  |  [NestedGroup](api-entity-NestedGroup.html)  |  The parent group of the user group.  |
|  subGroups  |  [NestedGroup](api-entity-NestedGroup.html)  |  The subgroups of the user group.  |
|  ownUsers  |  [User](api-entity-User.html)  |  The users added to the user group directly.  |
|  requireTwoFactorAuthentication  |  Boolean  |  True if the group requires two-factor authentication from its members. Otherwise, false.  |
|  viewers  |      * [User](api-entity-User.html)    * [UserGroup](api-entity-UserGroup.html)    |  The users and groups added to the "Visible to" setting for the user group.  |
|  updaters  |      * [User](api-entity-User.html)    * [UserGroup](api-entity-UserGroup.html)    |  The users and groups added to the "Updatable by" setting for the user group.  |
|  autoJoin  |  Boolean  |  True if users automatically join the group at first login. Otherwise, false.  |
|  autoJoinDomain  |  String  |  Users from this domain automatically join the group at first login. `Can be null`.  |
|  name  |  String  |  The name of the group.  |
|  ringId  |  String  |  ID of the group in Hub. Use this ID for operations in Hub, and for matching groups between YouTrack and Hub. `Read-only`. `Can be null`.  |
|  usersCount  |  Long  |  The number of users in the group. `Read-only`.  |
|  icon  |  String  |  The URL of the group logo. `Read-only`. `Can be null`.  |
|  allUsersGroup  |  Boolean  |  True if this group contains all users, otherwise false. `Read-only`.  |
|  users  |  [Array of Users](api-entity-User.html)  |  All users in this group, including transitive users. `Read-only`.  |

## Read a List of NestedGroups

Read the list of subgroups of the specific group.

### Required permissions

Requires access to the "Read Groups" feature, Update Project permission, or Low-Level Admin Read permission.

Additionally, you must not be filtered out by the "Visible to" list for this group.

### Request syntax

```GENERIC
GET /api/groups/{groupID}/subGroups?{fields}&{$top}&{$skip}
```

|  null  |  The database ID of NestedGroup  |
| --- | --- |

### Request parameters

|  Parameter  |  Type  |  Description  |
| --- | --- | --- |
|  fields  |  String  |  A list of NestedGroup attributes that should be returned in the response. If no field is specified, only the `entityID` is returned.  |
|  $skip  |  Int  |  Optional. Lets you set a number of returned entities to skip before returning the first one.  |
|  $top  |  Int  |     Optional. Lets you specify the maximum number of entries that are returned in the response. If you don't set the $top value, the server limits the maximum number of returned entries.       The server returns a maximum of 42 entries for most resources that return collections. For more information, see [Pagination](api-concept-pagination.html).     |

### Sample

#### Sample request

```CURL
https://example.youtrack.cloud/api/groups/23-1/subGroups?fields=id,name,usersCount
```

#### Sample response body

```JSON
[
  {
    "name": "General Accounting",
    "id": "23-154",
    "$type": "NestedGroup"
  }
]
```

