# Login

| **API URL**     | {{url}}/auth-service/session |
| --------------- | ---------------------------- |
| **Method**      | POST                         |
| **Description** | Login and get Access Token   |

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

| **Field Name** | **Type** | **Mandatory** | **Example**               |
| -------------- | -------- | ------------- | ------------------------- |
| username       | String   | Yes           | <superXXXn@XXX.mdt>       |
| password       | String   | Yes           | Hashed Password           |
| client(Header) | String   |               | spice web or spice mobile |

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

#### { <a href="#login" id="login"></a>

&#x20;   "username": "<spxxxice@xx.mdt>",

&#x20;   "password": "1ba363a1edf54402b51f58060aa52b11d30f99a490295adec900fdabf2b472181c0bfb165be18f4f5c430c7218a244bd29b9300d3471acc08197ccfb996118f6"

}

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

| **Field Name**       | **Type** | **Comments** |
| -------------------- | -------- | ------------ |
| `id`                 | String   | User ID      |
| `username`           | String   |              |
| `gender`             | String   |              |
| `roles`              | Object   |              |
| `active`             |          |              |
| `accountExpired`     |          |              |
| `accountLocked`      |          |              |
| `credentialsExpired` |          |              |
| `authorization`      |          |              |
| `currentDate`        |          |              |
| `firstName`          |          |              |
| `lastName`           |          |              |
| `middleName`         |          |              |
| `subject`            |          |              |
| `phoneNumber`        |          |              |
| `timezone`           | Object   |              |
| `organizations`      | Object   |              |
| `tenantId`           |          |              |
| `countryCode`        |          |              |
| `isBlocked`          |          |              |
| `country`            |          |              |
| `deviceInfoId`       |          |              |
| `isSuperUser`        |          |              |
| `cultureId`          |          |              |

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

```
 {
    "id": 23,
    "username": "suXXXXmin@spXXXce.mXt",
    "gender": "Female",
    "roles": [
        {
            "id": 2,
            "name": "SUPER_ADMIN",
            "level": null,
            "authority": "SUPER_ADMIN",
            "createdBy": 1,
            "updatedBy": 1,
            "createdAt": 1684844119755,
            "updatedAt": 1684844119755,
            "active": true,
            "deleted": false
        }
    ],
    "active": true,
    "accountExpired": false,
    "accountLocked": false,
    "credentialsExpired": false,
    "authorization": null,
    "currentDate": 1685102162753,
    "firstName": "Super",
    "lastName": "Admin",
    "middleName": null,
    "subject": null,
    "phoneNumber": "XXX764XXX3",
    "timezone": {
        "id": 1,
        "offset": "+05:30",
        "description": "(UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi"
    },
    "organizations": [],
    "tenantId": 3,
    "countryCode": "256",
    "isBlocked": false,
    "country": null,
    "deviceInfoId": null,
    "isSuperUser": false,
    "cultureId": null
}
```
