# Validate User Email

| **API URL**     | {{url}}/user-service/user/validate-user |
| --------------- | --------------------------------------- |
| **Method**      | POST                                    |
| **Description** | Validating a new user’s username        |

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

| **Field Name**         | **Type** | **Mandatory** | **Example**                                                                                                                             |
| ---------------------- | -------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| Authorization (Header) | String   | Yes           | Bearer 1ba363a1edf54402b51f58060aa52b11d30f99a490295adec900fdabf2b472181c0bfb165be18f4f5c430c7218a244bd29b9300d3471acc08197ccfb996118f6 |

#### **Sample Input:** <a href="#validateuseremail-sampleinput" id="validateuseremail-sampleinput"></a>

```
{
    "email":"superXXXin@XXX.mdt"
}
```

#### **Sample Output 1: If new user** <a href="#validateuseremail-sampleoutput1-ifnewuser" id="validateuseremail-sampleoutput1-ifnewuser"></a>

```
{
    "message": "Got user.",
    "entity": null,
    "status": true,
    "entityList": null,
    "responseCode": 200,
    "totalCount": null
}
```

#### **Sample Output 2: If user exist** <a href="#validateuseremail-sampleoutput2-ifuserexist" id="validateuseremail-sampleoutput2-ifuserexist"></a>

```
{
    "message": "Got user.",
    "entity": {
        "id": 2,
        "username": "DDDD-bd@DDD.mdt",
        "gender": "Female",
        "roles": [
            {
                "id": 2,
                "name": "SUPER_ADMIN",
                "level": null,
                "authority": "SUPER_ADMIN",
                "createdBy": 1,
                "updatedBy": 1,
                "createdAt": "2023-01-12T23:00:47+06:00",
                "updatedAt": "2023-01-12T23:00:47+06:00",
                "active": true,
                "deleted": false
            }
        ],
        "active": true,
        "firstName": "Superadmin",
        "lastName": "Test",
        "phoneNumber": "24AASS534534",
        "timezone": {
            "id": 2,
            "offset": "-08:00",
            "description": "(UTC-08:00) Baja California"
        },
        "organizations": [],
        "isBlocked": false,
        "countryCode": "202",
        "tenantId": 15,
        "isSuperUser": false,
        "defaultRoleName": "SUPER_ADMIN",
        "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/spice-docs/engineering/api-documentation/common-services/validate-user-email.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.
