# Get User Details

| **API URL**     | {{url}}/user-service/user/details/{{userId}} |
| --------------- | -------------------------------------------- |
| **Method**      | POST                                         |
| **Description** | To get user details by user ID               |

#### **Input** <a href="#getuserdetails-v2-input" id="getuserdetails-v2-input"></a>

| **Field Name**        | **Type** | **Mandatory** | **Example**                          |
| --------------------- | -------- | ------------- | ------------------------------------ |
| userId(parameter)     | Bigint   | Yes           | User unique identification number    |
| Authorization(Header) | String   | Yes           | Authorized token from login response |
| client(Header)        | String   | Yes           | web                                  |

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

{{url}}/user-service/user/details/248

#### **Output** <a href="#getuserdetails-v2-output" id="getuserdetails-v2-output"></a>

| **Field Name**               | **Type**  | **Comments**                |
| ---------------------------- | --------- | --------------------------- |
| message                      | String    | Got user                    |
| id                           | Integer   | User ID                     |
| firstName                    | String    | User First Name             |
| roles                        | String    | Roles of the user           |
| lastName                     | String    | User Last Name              |
| gender                       | String    | User Gender                 |
| phoneNumber                  | String    | User Phone number           |
| username                     | String    | User Username               |
| countryCode                  | String    | Country Code                |
| country                      | String    | Country details             |
| organizations                | String    | Organization                |
| tenantId                     | String    | Tenant id of user           |
| fhirId                       | Bigint    | Fhir ID for the user        |
| suiteAccess                  | String    | User Suite Access           |
| villages                     | String    | User Villages               |
| culture                      | String    | Culture details of the User |
| timezone                     | Timestamp | User Timezone               |
| defaultRoleName              | String    | User’s Role Name            |
| insightUserOrganization      | String    | Insights User               |
| reportUserOrganization       | String    | Report User                 |
| insightId                    | String    | Insight id                  |
| isTermsAndConditionsAccepted | Boolean   | Terms and Condition         |
| designation                  | String    | User’s designation          |
| redRisk                      | Boolean   | True or False               |

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

```
{
    "message": "Got user.",
    "entity": {
        "id": 63,
        "firstName": "Super",
        "roles": [
            {
                "id": 7,
                "name": "SUPER_ADMIN",
                "level": null,
                "groupName": "SPICE",
                "displayName": "Super Admin",
                "suiteAccessName": "admin",
                "appTypes": [
                    "COMMUNITY"
                ],
                "reportPrivileges": []
            }
        ],
        "lastName": "Admin",
        "gender": "Male",
        "phoneNumber": "98XXX321",
        "username": "mcf_labtechnicxxx@spice.mdt",
        "countryCode": "232",
        "country": {
            "id": 1,
            "name": "Sierra Leone",
            "phoneNumberCode": "232",
            "unitMeasurement": null,
            "regionCode": "1",
            "appTypes": [
                "COMMUNITY"
            ],
            "tenantId": 1
        },
        "organizations": [],
        "tenantId": 77,
        "fhirId": "49753",
        "suiteAccess": [
            "insights",
            "admin"
        ],
        "villages": [],
        "culture": {
            "id": 1,
            "name": "English",
            "code": "en"
        },
        "timezone": {
            "id": 1,
            "offset": "+05:30",
            "description": "Indian Time"
        },
        "defaultRoleName": "SUPER_ADMIN",
        "insightUserOrganization": [
            {
                "id": 4,
                "formDataId": 1,
                "name": "AMC Healthcare",
                "sequence": null,
                "parentOrganizationId": 3,
                "formName": "healthfacility"
            }
        ],
        "reportUserOrganization": [],
        "insightId": 195,
        "isTermsAndConditionsAccepted": false,
        "designation": {
            "id": null,
            "name": null
        },
        "redRisk": false
    },
    "status": true,
    "entityList": null,
    "responseCode": 200,
    "totalCount": null
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://spice.docs.medtroniclabs.org/engineering/api-documentation/common-services/get-user-details.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
