---
url: https://gudhub.com/docs/rest-api/sharing-folder/group-sharing/managing-users-in-groups/
title: "Managing Users In Groups\n                #"
description: "This chapter describes each of the requests related to a user who belongs to a group. They all have a certain logic of operation and a few important rules. Each"
lang: uk
updated: 2026-09-11T14:15:45.733Z
---

# Managing Users In Groups [#](https://gudhub.com/docs/rest-api/sharing-folder/group-sharing/managing-users-in-groups/#managing-users-in-groups)

This chapter describes each of the requests related to a user who belongs to a group. They all have a certain logic of operation and a few important [rules](#users-rules).

> Each of users in the group has his/her own [permission](#user-permissions).

Each of the groups uses these requests to work with users:

-   [sharing-group/add-user-to-group](#sharing-group-add-user-to-group)
-   [sharing-group/get-users-by-group](#sharing-group-get-users-by-group)
-   [sharing-group/update-user-in-group](#sharing-group-update-user-in-group)
-   [sharing-group/delete-user-from-group](#sharing-group-delete-user-from-group)
-   [sharing-group/get-groups-by-user](#sharing-group-get-groups-by-user)

## Users Rules [#](https://gudhub.com/docs/rest-api/sharing-folder/group-sharing/managing-users-in-groups/#users-rules)

There are two important rules for users:

-   Group Owner/Admin can add User to group and set his/her permission.
-   User can delete himself from group. In other words, user can leave the group.

## User Permissions [#](https://gudhub.com/docs/rest-api/sharing-folder/group-sharing/managing-users-in-groups/#user-permissions)

| Value | Meaning | Message |
| :-- | :-- | :-- |
| 0 | blocked | user who is not allowed to have any rights for a certain group of applications(the group will not be displayed in this user\`s app\_list) |
| 1 | member | user that can read and write data in a certain group of applications |
| 2 | admin | user who has the rights to add, delete and update applications in the group |
| 3 | owner | default permission for creator of the group; owner can all what can admin |

## sharing-group/add-user-to-group [#](https://gudhub.com/docs/rest-api/sharing-folder/group-sharing/managing-users-in-groups/#sharing-group-add-user-to-group)

This request allows to add a new user to the group.

### Request [#](https://gudhub.com/docs/rest-api/sharing-folder/group-sharing/managing-users-in-groups/#request)

| Request Method | Content Type | Request URL |
| :-- | :-- | :-- |
| `POST` | `Form Data` | `https://gudhub.com/GudHub/api/sharing-group/add-user-to-group` |

This request sent token, user and group IDs, and user permission to the group.

| Property | Type | Description |
| :-- | :-- | :-- |
| token | `string` | _using to getting the access to the group_ |
| group\_id | `number` | _ID of the destination group_ |
| user\_id | `number` | _ID of the user that will be added_ |
| group\_permission | `number` | _ID of the permission of the user_ |

#### **Example Request:** [#](https://gudhub.com/docs/rest-api/sharing-folder/group-sharing/managing-users-in-groups/#example-request)

Copy

```json
    token: gvydsjtynywadogvejv_bawqlztqfjabdyuhrsnref 
    group_id: 3
    user_id: 23456
    group_permission: 2
```

### Response [#](https://gudhub.com/docs/rest-api/sharing-folder/group-sharing/managing-users-in-groups/#response)

In response, you will get the ID of the added user and his/her permission to the group.

Copy

```json
{
    "user_id": 74872,
    "group_permission": 2,
    "group_id": 3
}
```

### Status Code [#](https://gudhub.com/docs/rest-api/sharing-folder/group-sharing/managing-users-in-groups/#status-code)

| Status Code | Message |
| :-- | :-- |
| 200 | response |
| 600 | attempt to create delete event with null entity |
| 601 | such permission does not exist |
| 710 | access is not allowed |

## sharing-group/get-users-by-group [#](https://gudhub.com/docs/rest-api/sharing-folder/group-sharing/managing-users-in-groups/#sharing-group-get-users-by-group)

This chapter describes each of the queries related to a user who belongs to a group. get a list of users who belong to group.

> Each of users in the group has his/her own [permission](#user-permissions). to a certain group.

### Request [#](https://gudhub.com/docs/rest-api/sharing-folder/group-sharing/managing-users-in-groups/#request-1)

| Request Method | Content Type | Request URL |
| :-- | :-- | :-- |
| `POST` | `Form Data` | `https://gudhub.com/GudHub/api/sharing-group/get-users-by-group` |

It only accepts the token and the group ID.

| Property | Type | Description |
| :-- | :-- | :-- |
| token | `string` | _using to getting the access to the group_ |
| group\_id | `number` | _ID of the group from which you want to pull the list of users_ |

#### **Example Request:** [#](https://gudhub.com/docs/rest-api/sharing-folder/group-sharing/managing-users-in-groups/#example-request-1)

Copy

```json
    token: gvydsjtynywadogvejv_bawqlztqfjabdyuhrsnref
    group_id: 5
```

### Response [#](https://gudhub.com/docs/rest-api/sharing-folder/group-sharing/managing-users-in-groups/#response-1)

The current response request returns an array of user objects. Each of them contains the group ID, the user ID, and his/her rights for that group.

Copy

```json
[{
    "user_id": 24381,
    "group_permission": 4,
    "group_id": 5
},{
    "user_id": 24382,
    "group_permission": 1,
    "group_id": 5
},{
    "user_id": 24383,
    "group_permission": 1,
    "group_id": 5
},{
    "user_id": 24384,
    "group_permission": 0,
    "group_id": 5
}]
```

### Status Code [#](https://gudhub.com/docs/rest-api/sharing-folder/group-sharing/managing-users-in-groups/#status-code-1)

| Status Code | Message |
| :-- | :-- |
| 200 | response |
| 600 | attempt to create delete event with null entity |
| 710 | access is not allowed |

## sharing-group/update-user-in-group [#](https://gudhub.com/docs/rest-api/sharing-folder/group-sharing/managing-users-in-groups/#sharing-group-update-user-in-group)

The current request is called to change the user permission to the group.

### Request [#](https://gudhub.com/docs/rest-api/sharing-folder/group-sharing/managing-users-in-groups/#request-2)

| Request Method | Content Type | Request URL |
| :-- | :-- | :-- |
| `POST` | `Form Data` | `https://gudhub.com/GudHub/api/sharing-group/update-user-in-group` |

The request contains group and user IDs, and a new permission.

| Property | Type | Description |
| :-- | :-- | :-- |
| token | `string` | _using to getting the access to the group_ |
| group\_id | `number` | _ID of the group in which the permission of the certain user will be updated_ |
| user\_id | `number` | _ID of the user whose permission will be updated_ |
| group\_permission | `number` | _ID of permission that is granted to the user_ |

#### **Example Request:** [#](https://gudhub.com/docs/rest-api/sharing-folder/group-sharing/managing-users-in-groups/#example-request-2)

Copy

```json
    token: gvydsjtynywadogvejv_bawqlztqfjabdyuhrsnref
    group_id: 4
    user_id: 32424
    group_permission: 0
```

### Response [#](https://gudhub.com/docs/rest-api/sharing-folder/group-sharing/managing-users-in-groups/#response-2)

It returns the ID of the group and the user, and, accordingly, the new permission of the user in the group.

Copy

```json
{
    "group_id": 4,
    "user_id": 23456,
    "group_permission": 0
}
```

### Status Code [#](https://gudhub.com/docs/rest-api/sharing-folder/group-sharing/managing-users-in-groups/#status-code-2)

| Status Code | Message |
| :-- | :-- |
| 200 | response |
| 600 | attempt to create delete event with null entity |
| 601 | such permission does not exist |
| 710 | access is not allowed |

## sharing-group/delete-user-from-group [#](https://gudhub.com/docs/rest-api/sharing-folder/group-sharing/managing-users-in-groups/#sharing-group-delete-user-from-group)

To delete other users and leave the group, the user deletion request is used.

### Request [#](https://gudhub.com/docs/rest-api/sharing-folder/group-sharing/managing-users-in-groups/#request-3)

| Request Method | Content Type | Request URL |
| :-- | :-- | :-- |
| `POST` | `Form Data` | `https://gudhub.com/GudHub/api/sharing-group/delete-user-from-group` |

This request sends the token, group and user IDs.

| Property | Type | Description |
| :-- | :-- | :-- |
| token | `string` | _using to getting the access to the group_ |
| group\_id | `number` | _ID of the group from which the user will be deleted_ |
| user\_id | `number` | _ID of the user that will be deleted_ |

#### **Example Request:** [#](https://gudhub.com/docs/rest-api/sharing-folder/group-sharing/managing-users-in-groups/#example-request-3)

Copy

```json
    token: gvydsjtynywadogvejv_bawqlztqfjabdyuhrsnref
    group_id: 6
    user_id: 52738
```

### Response [#](https://gudhub.com/docs/rest-api/sharing-folder/group-sharing/managing-users-in-groups/#response-3)

In response, you will get the data about deleted user: ID of the group, his/her user ID and permission.

Copy

```json
{
    "user_id": 34453,
    "group_permission": 2,
    "group_id": 6
}
```

### Status Code [#](https://gudhub.com/docs/rest-api/sharing-folder/group-sharing/managing-users-in-groups/#status-code-3)

| Status Code | Message |
| :-- | :-- |
| 200 | response |
| 600 | attempt to create delete event with null entity |
| 710 | access is not allowed |

## sharing-group/get-groups-by-user [#](https://gudhub.com/docs/rest-api/sharing-folder/group-sharing/managing-users-in-groups/#sharing-group-get-groups-by-user)

This request allows to get the full list of the groups the certain user belongs to.

### Request [#](https://gudhub.com/docs/rest-api/sharing-folder/group-sharing/managing-users-in-groups/#request-4)

| Request Method | Content Type | Request URL |
| :-- | :-- | :-- |
| `POST` | `Form Data` | `https://gudhub.com/GudHub/api/sharing-group/get-groups-by-user` |

It contains only the token and user ID.

| Property | Type | Description |
| :-- | :-- | :-- |
| token | `string` | _using to getting the access to the group_ |
| user\_id | `number` | _ID of the user that is used for searching_ |

#### **Example Request:** [#](https://gudhub.com/docs/rest-api/sharing-folder/group-sharing/managing-users-in-groups/#example-request-4)

Copy

```json
    token: gvydsjtynywadogvejv_bawqlztqfjabdyuhrsnref
    user_id: 15432
```

### Response [#](https://gudhub.com/docs/rest-api/sharing-folder/group-sharing/managing-users-in-groups/#response-4)

In response, you get an array of groups objects to which the user belongs.

Copy

```json
[{
    "group_id": 1,
    "group_name": "Management",
    "user_id": 15432,
    "group_permission": 1
},{
    "group_id": 2,
    "group_name": "Developing",
    "user_id": 15432,
    "group_permission": 0
},{
    "group_id": 3,
    "group_name": "Sales",
    "user_id": 15432,
    "group_permission": 3
}]
```

### Status Code [#](https://gudhub.com/docs/rest-api/sharing-folder/group-sharing/managing-users-in-groups/#status-code-4)

| Status Code | Message |
| :-- | :-- |
| 200 | response |
| 600 | attempt to create delete event with null entity |
| 710 | access is not allowed |
