# User List

| **API URL**     | {{url}}/admin-service/user/admin-users |
| --------------- | -------------------------------------- |
| **Method**      | POST                                   |
| **Description** | Get user list                          |

#### **Sample Input** <a href="#userlist-v2-sampleinput" id="userlist-v2-sampleinput"></a>

| **Field Name**         | **Type** | **Mandatory** | **Example**                                                                                                                             |
| ---------------------- | -------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| countryId              | Bigint   | Yes           | Country id                                                                                                                              |
| tenantId               | Bigint   | No            | Tenant Id                                                                                                                               |
| limit                  | Bigint   | Yes           | Limit to fetching data                                                                                                                  |
| skip                   | Bigint   | No            | Skip data to filter data                                                                                                                |
| searchTerm             | String   | No            | Search Term to filter data                                                                                                              |
| roleNames              | String   | No            | List of roles name                                                                                                                      |
| isSiteUsers            | Boolean  | Yes           | Site Users                                                                                                                              |
| tenantBased            | Boolean  | Yes           | TenantBased                                                                                                                             |
| tenantIds              | String   | Yes           | Tenant Ids                                                                                                                              |
| appTypes               | String   | Yes           | App type for the user                                                                                                                   |
| Authorization (Header) | String   | Yes           | Bearer 1ba363a1edf54402b51f58060aa52b11d30f99a490295adec900fdabf2b472181c0bfb165be18f4f5c430c7218a244bd29b9300d3471acc08197ccfb996118f6 |
| client                 | String   | Yes           | web                                                                                                                                     |

```
{
  "countryId": 1,
  "tenantId": "1",
  "limit": 10,
  "skip": 0,
  "searchTerm": "",
  "roleNames": [],
  "isSiteUsers": true,
  "tenantBased": false,
  "tenantIds": [],
  "appTypes": [
    "COMMUNITY"
  ]
}
```

#### **Sample Output** <a href="#userlist-v2-sampleoutput" id="userlist-v2-sampleoutput"></a>

| **Field Name**               | **Type** | **Comments**                            |
| ---------------------------- | -------- | --------------------------------------- |
| message                      | String   | Got users.                              |
| status                       | String   | Entity status                           |
| entityList                   | String   | Entity List                             |
| id                           | Bigint   | Medication id                           |
| firstName                    | String   | First Name of user                      |
| roles                        | String   | Roles for the user                      |
| lastName                     | String   | Last name for the user                  |
| gender                       | String   | User gender                             |
| phoneNumber                  | Bigint   | User phone Number                       |
| username                     | String   | login user name                         |
| countryCode                  | Bigint   | Country Code                            |
| country                      | String   | Country details                         |
| organizations                | String   | Organizations details                   |
| tenantId                     | Bigint   | Tenant Id                               |
| fhirId                       | Bigint   | Fhir Id for user                        |
| suiteAccess                  | String   | mob                                     |
| Villages                     | String   | List of villages                        |
| culture                      | String   | User culture                            |
| timezone                     | Date     | User timezone                           |
| defaultRoleName              | String   | CHW                                     |
| isTermsAndConditionsAccepted | Boolean  | Check for Terms And Conditions Accepted |
| designation                  | String   | Designation                             |
| active                       | Boolean  | Status for user                         |
| redRisk                      | Boolean  | RedRisk for user                        |

```
{
  "message": "Got All users.",
  "entity": null,
  "status": true,
  "entityList": [
      {
          "id": 5,
          "firstName": "CHW",
          "roles": [
              {
                  "id": 2,
                  "name": "CHW",
                  "level": null,
                  "groupName": "SPICE",
                  "displayName": "Community Health Worker",
                  "suiteAccessName": "mob",
                  "appTypes": [
                      "COMMUNITY"
                  ],
                  "reportPrivileges": [
                      "hf4"
                  ]
              }
          ],
          "lastName": "FHIR",
          "gender": "male",
          "phoneNumber": "86XXXXX111",
          "username": "cXXXX_fXXr@test.com",
          "countryCode": "23",
          "country": {
              "id": 1,
              "name": "Sierra Leone",
              "phoneNumberCode": "232",
              "unitMeasurement": null,
              "regionCode": "1",
              "appTypes": [
                  "COMMUNITY"
              ],
              "tenantId": 1
          },
          "organizations": [
              {
                  "id": 11,
                  "formDataId": 6,
                  "name": "Rainbow HF",
                  "sequence": null,
                  "parentOrganizationId": 4,
                  "formName": "healthfacility"
              }
          ],
          "tenantId": 11,
          "fhirId": "9606",
          "suiteAccess": [
              "mob"
          ],
          "villages": [
              {
                  "id": 1,
                  "name": "Guindy",
                  "villagecode": null,
                  "chiefdomId": 1,
                  "userId": null,
                  "countryId": 1,
                  "districtId": 1,
                  "chiefdomCode": null,
                  "districtCode": null,
                  "memberSequence": 0,
                  "householdSequence": 0,
                  "code": "0001"
              }
          ],
          "culture": {
              "id": 1,
              "name": "English",
              "code": "en"
          },
          "timezone": {
              "id": 1,
              "offset": "+05:30",
              "description": "Indian Time"
          },
          "defaultRoleName": "CHW",
          "insightUserOrganization": [],
          "reportUserOrganization": [],
          "isTermsAndConditionsAccepted": false,
          "designation": {
              "id": null,
              "name": null
          },
          "active": false,
          "redRisk": false
      }
  ],
  "responseCode": 200,
  "totalCount": 1
}
```
