---
url: https://gudhub.com/docs/rest-api/sharing-folder/sharing/
title: "User Sharing\n                #"
description: "The sharing requests allows not only share the application with other users. Due to them you can literally manage accesses to the application. Each user can hav"
lang: uk
updated: 2026-09-08T15:41:47.330Z
---

# User Sharing [#](https://gudhub.com/docs/rest-api/sharing-folder/sharing/#user-sharing)

The sharing requests allows not only share the application with other users. Due to them you can literally manage accesses to the application. Each user can have one of the [permissions](#description-of-sharing_permission-value) to access the application.

The sharing request allows the user to share the app, assign access permission and invite people to GudHub:

1.  [sharing/add](#sharing-add)
2.  [sharing/get-app-users](#sharing-get-app-users)
3.  [sharing/update](#sharing-update)
4.  [sharing/delete](#sharing-delete)
5.  [invitation/add](#invitation-add)

## Description of sharing\_permission Value [#](https://gudhub.com/docs/rest-api/sharing-folder/sharing/#description-of-sharing-permission-value)

| Value | Meaning | Description |
| :-- | :-- | :-- |
| 0 | Block | ban on having any rights to the certain application(it will not be displayed in this user\`s app\_list) |
| 1 | Read | right only to read data of a certain application |
| 2 | Write | right to read and write in a certain application |
| 3 | Admin | right to add, delete, and update fields in application |
| 4 | Owner | default permission for application creating; is given to user that create this application; can all what can admin, delete and share application |

## sharing/add [#](https://gudhub.com/docs/rest-api/sharing-folder/sharing/#sharing-add)

Due to this request, you can expand an application with other users. It contains token, user ID, application ID, and a number of sharing permission.

### Request [#](https://gudhub.com/docs/rest-api/sharing-folder/sharing/#request)

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

It contains token, user ID, application ID, and a number of sharing permission.

| Property | Type | Description |
| :-- | :-- | :-- |
| token | `string` | _using for getting access_ |
| app\_id | `object` | _application object, which is created_ |
| user\_id | `number` | _personal user ID_ |
| sharing\_permision | `number` | _rights to application which are granted to user_ |

#### **Example:** [#](https://gudhub.com/docs/rest-api/sharing-folder/sharing/#example)

Copy

```json
        app_id: 178
        sharing_permission: 0
        token: bbcvqhzgr.swms-_-.oj_vdia_bert.gkanyfww_cg
        user_id: 28
```

### Response [#](https://gudhub.com/docs/rest-api/sharing-folder/sharing/#response)

In response will be data about user and his permission.

Copy

```json
{
        "user_id":28,
        "app_id":178,
        "permission":0
}
```

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

| Name | Description |
| :-- | :-- |
| 200 | user has accessed the application |
| 710 | user have no rights for sharing |

## sharing/get-app-users [#](https://gudhub.com/docs/rest-api/sharing-folder/sharing/#sharing-get-app-users)

The current request is called to get the list of users who has permission to the application. It is automatically called when the user clicks [Sharing](https://gudhub.com/docs/gh-elements/sharing-element/).

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

| Request Method | Content Type | Request URL |
| :-- | :-- | :-- |
| `POST` | `Form Data` | `https://gudhub.com/GudHub_Test/sharing/get-app-users` |

This request send the token and ID of the application.

| Property | Type | Description |
| :-- | :-- | :-- |
| app\_id | `number` | _The ID of the application from which the users will be gotten_ |
| token | `string` | _allows to get access_ |

#### **Example:** [#](https://gudhub.com/docs/rest-api/sharing-folder/sharing/#example-1)

Copy

```json
app_id: 28877
token: thog-tayjf-.k-cbeapsebnqawkphhiny-ursyqsn
```

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

It returns an array of all users that have access rights to this application.

Copy

```json
[{
        "app_id": 28877,
        "avatar_128": "https://gudhub.com/avatars/123.jpg",
        "avatar_512": "https://gudhub.com/avatars/345.jpg",
        "fullname": "John Dow",
        "sharing_permission": 2,
        "user_id": 1578
}]
```

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

| Name | Description |
| :-- | :-- |
| 200 | user is registered |
| 400 Bad Request | incorrect request syntax |

## sharing/update [#](https://gudhub.com/docs/rest-api/sharing-folder/sharing/#sharing-update)

This is the request that allows to update the user permission.

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

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

This request contains all the same token, user ID, application ID, and a number of the new user permission.

| Property | Type | Description |
| :-- | :-- | :-- |
| app\_id | `number` | _contains ID of the application_ |
| sharing\_permission | `number` | _contains number of the permission_ |
| token | `string` | _contains working token_ |
| user\_id | `number` | _contains ID of user whose access will be update_ |

#### **Example:** [#](https://gudhub.com/docs/rest-api/sharing-folder/sharing/#example-2)

Copy

```json
        app_id: 28753
        sharing_permission: 3
        token: lrxvzikg-mij-_szdgipxtjeybd.-v._amkdbdsxjk
        user_id: 1571
```

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

In response will be updated data about user and his new permission.

Copy

```json
{
        "user_id":1571,
        "app_id":28753,
        "permission":3
}
```

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

| Name | Description |
| :-- | :-- |
| 200 | user has accessed the application |
| 710 | user have no rights for updating |

## sharing/delete [#](https://gudhub.com/docs/rest-api/sharing-folder/sharing/#sharing-delete)

The current request is invoked when the [owner or administrator](#description-of-sharing-permission-value) of an application deletes a user from that application. It is not the same as the [blocked permission](#description-of-sharing-permission-value) that. The deleted user can open that app if it is public. If permission is [Blocked](#description-of-sharing-permission-value), the blocked user will not be able to open this application anyway.

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

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

The request sends the token, the ID of the user to be deleted, and the ID of the application from which the user will be deleted.

| Property | Type | Description |
| :-- | :-- | :-- |
| app\_id | `number` | _ID of the application in which the operation is performed_ |
| token | `string` | _used to get the access_ |
| user\_id | `number` | _ID of the user that will be deleted_ |

#### **Example:** [#](https://gudhub.com/docs/rest-api/sharing-folder/sharing/#example-3)

Copy

```json
app_id: 22208
token: bgikl-szbeaqivhj.fdqu/trwbwqbgh..ffjqwb
user_id: 1534
```

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

The response will be a remote user object.

Copy

```json
{
        "app_id": 22208,
        "permission": 1,
        "user_id": 1534
}
```

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

| Name | Description |
| :-- | :-- |
| 200 | user has accessed the application |
| 710 | user have no rights for deleting other users |

## invitation/add [#](https://gudhub.com/docs/rest-api/sharing-folder/sharing/#invitation-add)

This is the request that is sent to invite the user to the GudHub. With this invitation, the user sends access to some selected applications. The user sending invitations can give any permission of the shared application to the invitee.

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

| Request Method | Content Type | Request URL |
| :-- | :-- | :-- |
| `POST` | `Form Data` | `https://gudhub.com/GudHub_Test/api/invitation/add` |

The current request sends an array with invitees emails, an array of app objects, and token.

| Property | Type | Description |
| :-- | :-- | :-- |
| guests\_emails | `array` | _contains all emails addresses to which the invitations will be sent_ |
| apps | `array` | _contains ID and permission of the application_ |
| token | `string` | _allows to get access to the apps_ |

#### **Example:** [#](https://gudhub.com/docs/rest-api/sharing-folder/sharing/#example-4)

Copy

```json
guests_emails: ["john@dow.com","johana@dow.com"]
apps: [{"app_id":27781,"permission":1},{"app_id":31080,"permission":2}]
token: jezyusdfmbzvqn-un._fk.ydnvamdoph.ybbdameo
```

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

In response, we will get an array with objects containing the email to which the invitation will be sent, the application ID and the permission given to the invitee.

Copy

```json
[{
        "guest_email": "john@dow.com", 
        "app_id": 27781, 
        "permission": 1
},{
        "guest_email": "johana@dow.com", 
        "app_id": 27781, 
        "permission": 1
},{
        "guest_email": "john@dow.com", 
        "app_id": 31080, 
        "permission": 2
},{
        "guest_email": "johana@dow.com",
        "app_id": 31080, 
        "permission": 2
}]
```

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

| Name | Description |
| :-- | :-- |
| 200 | user has accessed the application |
