> For the complete documentation index, see [llms.txt](https://spice.docs.medtroniclabs.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://spice.docs.medtroniclabs.org/engineering/api-documentation/common-services/login.md).

# Login

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

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

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

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

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

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

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

}

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

| **Field Name**               | **Type**                   | **Comments**                       |
| ---------------------------- | -------------------------- | ---------------------------------- |
| id                           | Bigint                     | User ID                            |
| firstName                    | String                     | User First Name                    |
| lastName                     | String                     | User Last Name                     |
| username                     | String                     | Login Email ID                     |
| phoneNumber                  | String                     | User Phone number                  |
| roles                        | String                     | User Role                          |
| active                       | Boolean                    | Is active                          |
| currentDate                  | Timestamp without timezone | Current Date                       |
| tenantId                     | Bigint                     | User Tenant ID                     |
| countryCode                  | Bigint                     | Country Code of User               |
| country                      | String                     | User’s Country                     |
| isSuperUser                  | Boolean                    | Super User Check                   |
| isJobUser                    | Boolean                    | Job User Check                     |
| organizationIds              | Bigint                     | User’s Organization                |
| suiteAccess                  | String                     | Suit Access of User                |
| client                       | String                     | Client mob or web                  |
| fhirId                       | Bigint                     | User’s Fhir ID                     |
| timezone                     | Timestamp                  | User Timezone                      |
| cultureId                    | Bigint                     | Culter Id                          |
| culture                      | String                     | User’s Culture                     |
| isTermsAndConditionsAccepted | Boolean                    | User Terms and Conditions Accepted |

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

```
 {
  "id" : 1,
  "firstName" : "SuXXXr",
  "lastName" : "AXXXin",
  "username" : "suXXXXXmin@spice.mdt",
  "phoneNumber" : "79XXXXXX85",
  "roles" : [ {
    "id" : 1,
    "name" : "SUPER_ADMIN",
    "level" : null,
    "suiteAccessName" : "admin",
    "appTypes" : [ "COMMUNITY" ],
    "reportPrivileges" : [ ],
    "authority" : "SUPER_ADMIN"
  }],
  "active" : true,
  "currentDate" : 1736413152095,
  "tenantId" : 1,
  "countryCode" : "232",
  "country" : {
    "id" : 1,
    "name" : "SierXXXXXne",
    "phoneNumberCode" : "232",
    "unitMeasurement" : null,
    "regionCode" : "1",
    "appTypes" : [ "COMMUNITY" ],
    "tenantId" : 1
  },
  "isSuperUser" : false,
  "isJobUser" : false,
  "organizationIds" : [ ],
  "suiteAccess" : [ "insights", "admin" ],
  "client" : "web",
  "fhirId" : "11",
  "timezone" : {
    "id" : 1,
    "offset" : "+05:30",
    "description" : "Indian Time"
  },
  "cultureId" : 1,
  "culture" : {
    "id" : 1,
    "name" : "English",
    "code" : "en"
  },
  "isTermsAndConditionsAccepted" : false
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://spice.docs.medtroniclabs.org/engineering/api-documentation/common-services/login.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
