# Operations with Specific UserGroup

This resource provides access to the user groups in YouTrack.

|  Resource  |     ```GENERIC /api/groups/{groupID} ```    |
| --- | --- |
|  Returned entity  |  [UserGroup](api-entity-UserGroup.html). For the description of the entity attributes, see [Supported Fields](#UserGroup-supported-fields) section.  |
|  Supported methods  |      * `GET`: [Read a Specific UserGroup](#get-UserGroup-method).    * `POST`: [Update a Specific UserGroup](#update-UserGroup-method).    * `DELETE`: [Delete a Specific UserGroup](#delete-UserGroup-method).    |

## UserGroup attributes

Represents a group of users.

### Related Resources

Below you can find the list of resources that let you work with this entity.

* [User Groups](resource-api-groups.html)

* [User Groups in the User Bundle](resource-api-admin-customFieldSettings-bundles-user-bundleID-groups.html)

### Attributes

This table describes attributes of the `UserGroup` 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 ID of the user group. `Read-only`.  |
|  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 Specific UserGroup

Read attributes of the specific user group in YouTrack.

### 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}?{fields}
```

|  {groupID}  |  The database ID of the user group in YouTrack.  |
| --- | --- |

### Request parameters

|  Parameter  |  Type  |  Description  |
| --- | --- | --- |
|  fields  |  String  |  A list of UserGroup attributes that should be returned in the response. If no field is specified, only the `entityID` is returned.  |

### Sample

#### Sample request

```CURL
https://example.youtrack.cloud/api/groups/3-2?fields=id,name,usersCount,parentGroup(name),subGroups(name)
```

#### Sample response body

```JSON
{
  "subGroups": [],
  "parentGroup": {
    "name": "Reporters",
    "$type": "NestedGroup"
  },
  "usersCount": 3,
  "name": "Accounting",
  "id": "3-2",
  "$type": "NestedGroup"
}
```

## Update a Specific UserGroup

Update a specific user group in YouTrack.

### Required permissions

Requires permission: Update Project or Low-level Admin Write.

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

### Request syntax

```GENERIC
POST /api/groups/{groupID}?{fields}
```

|  {groupID}  |  The database ID of the user group in YouTrack.  |
| --- | --- |

### Request parameters

|  Parameter  |  Type  |  Description  |
| --- | --- | --- |
|  fields  |  String  |  A list of UserGroup attributes that should be returned in the response. If no field is specified, only the `entityID` is returned.  |

### Sample

#### Sample request

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

#### Sample request body

```JSON
{
  "name": "General Accounting"
}
```

#### Sample response body

```JSON
{
  "subGroups": [],
  "parentGroup": {
    "name": "Reporters",
    "$type": "NestedGroup"
  },
  "usersCount": 3,
  "name": "General Accounting",
  "id": "23-154",
  "$type": "NestedGroup"
}
```

## Delete a Specific UserGroup

Delete a specific user group in YouTrack while setting a successor group.

Deleting a group triggers a background synchronization process with Hub. The changes may not be reflected immediately.

Required fields: `successor`. Use the database ID of the successor group as the value.

### Required permissions

Requires permission: Update Project or Low-level Admin Write.

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

### Request syntax

```GENERIC
DELETE /api/groups/{groupID}
```

|  {groupID}  |  The database ID of the user group in YouTrack.  |
| --- | --- |

### Request parameters

|  Parameter  |  Type  |  Description  |
| --- | --- | --- |
|  fields  |  String  |  A list of UserGroup attributes that should be returned in the response. If no field is specified, only the `entityID` is returned.  |

### Sample

#### Sample request

```CURL
https://example.youtrack.cloud/api/groups/3-2?successor=23-11
```

