# User Group

### Get All User Groups

<mark style="color:blue;">`GET`</mark> `[ENADOC_URL] /api/v3/usergroups`

***Pre-requisites from Enadoc:*** *You must have created user groups within your organization. Each individual user can be assigned to one or many user groups. User groups are created globally, and group permission can be managed at the global level and library level*&#x20;

#### Path Parameters

| Name          | Type   | Description                                                         |
| ------------- | ------ | ------------------------------------------------------------------- |
| Authorization | string | <p>Type - Bearer<br>Access token will be sent in request header</p> |

{% tabs %}
{% tab title="200 If request proceeds successfully, you will receive status code 200 with the details of user groups. The details consist of user group id, user group name, user group description, user group security level.

" %}

```c
[
  {
    "id": 1,
    "name": "Administrators",
    "description": "",
    "securityLevel": 6
  }
]
```

{% endtab %}
{% endtabs %}

### Get Specific User Group

<mark style="color:blue;">`GET`</mark> `[ENADOC_URL] /api/v3/usergroups/{id}`

***Pre-requisites from Enadoc:*** *You must have created user groups within your organization.*

#### Path Parameters

| Name | Type    | Description   |
| ---- | ------- | ------------- |
| id   | integer | User group id |

#### Headers

| Name          | Type   | Description                                                          |
| ------------- | ------ | -------------------------------------------------------------------- |
| Authorization | string | <p>Type - Bearer<br>Access token will be sent in request headers</p> |

{% tabs %}
{% tab title="200 If request proceeds success, you will receive status code 200 with the details of requested user group. The details consist of user group id, user group name, user group description, user group security level.

" %}

```c
{
  "id": 1,
  "name": "Administrators",
  "description": "",
  "securityLevel": 6
}
```

{% endtab %}
{% endtabs %}

### Get Users by User Group

<mark style="color:blue;">`GET`</mark> `[ENADOC_URL] /api/v3/usergroups/{id}/users`

***Pre-requisites from Enadoc:*** *You must have created user groups and users within your organization.*

#### Path Parameters

| Name | Type    | Description   |
| ---- | ------- | ------------- |
| id   | integer | User group id |

#### Headers

| Name          | Type   | Description                                                          |
| ------------- | ------ | -------------------------------------------------------------------- |
| Authorization | string | <p>Type - Bearer<br>Access token will be sent in request headers</p> |

{% tabs %}
{% tab title="200 If the request proceeds success, you will receive status code 200 with the list of users who belong to requested user group. The details of each user consist of user id, organization id, organization name, organization logo url, security level, user name, email, first name, last name, Is restricted, Is active, Is first login, user profile image url and full name.
" %}

```c
{
  "count": 1,
  "users": [
    {
      "id": 1,
      "organizationId": 1,
      "organizationName": "Enadoc",
      "organizationLogoUrl": "https://enadocapp.com/api/v3/organizations/1/logo",
      "securityLevel": 6,
      "userType": 1,
      "userName": "meghon@enadoc.com",
      "email": "meghon@enadoc.com",
      "firstName": "Meghon ",
      "lastName": "Charlotte",
      "isRestricted": false,
      "isActive": true,
      "isFirstLogin": false,
      "imageUrl": "https://enadocapp.com/api/v3/contents/picture?token=ZGVSgsdmYXVsdC5wbmc%3d-8%2f6OH3Pk6v0%3d",
      "fullName": "Meghon Charlotte"
    }
  ]
}
```

{% endtab %}
{% endtabs %}

### Get Libraries by User Group

<mark style="color:blue;">`GET`</mark> `[ENADOC_URL] /api/v3/usergroups/{id}/libraries`

***Pre-requisites from Enadoc:*** *You must have created user groups and libraries within your organization.*&#x20;

#### Path Parameters

| Name | Type    | Description   |
| ---- | ------- | ------------- |
| id   | integer | User group id |

#### Headers

| Name          | Type   | Description   |
| ------------- | ------ | ------------- |
| Authorization | string | Type - Bearer |

{% tabs %}
{% tab title="200 If request proceeds success, you will receive status code 200 with the list of libraries assigned to requested user group. The details consist of library id, library name, library color, Is active status.
" %}

```c
[
  {
    "id": 1,
    "name": "General",
    "color": "ff4366",
    "isActive": true
  }
]
```

{% endtab %}
{% endtabs %}

##
