# Login with password

Given that the user credentials are correct, this returns a `token` that can then be used to authorise other secured operations.

The token returned is valid for 5 minutes from last activity.

***

### End point

```markup
https://api.up2.money/auth/login
```

### Headers

<details>

<summary>Security</summary>

**REQUEST BODY SCHEMA: application/json**

&#x20;:closed\_lock\_with\_key: **API SECRET: x-secret**

Add `YWJjMTIzIQ==` in  `x-secret` in headers.  &#x20;

**Header parameter name:** `x-secret`

</details>

***

### Payload

```json
{
    "email": "", // YOUR EMAIL
    "password": {
        "value": "" // YOUR TOKENIZED PASSWORD
    }
}
```

### Sample Request

***

```javascript
curl --location 'https://api.up2.money/auth/login' \
--header 'x-secret: YWJjMTIzIQ==' \
--header 'Content-Type: application/json' \
--data-raw '{
    "email": "YOUR_EMAIL", 
    "password": {
        "value": "YOUR_TOKENIZED_PASSWORD" 
    }
}'
```

***

### Sample Response

***

{% tabs %}
{% tab title="Success - 200" %}

```json
{
    "credentials": {
        "id": "",
        "type": "ROOT"
    },
    "identity": {
        "id": "",
        "type": "CONSUMER" // OR "CORPORATE"
    },
    "token": "",
    "tokenType": "ACCESS"
}
```

{% endtab %}

{% tab title="Error - 400" %}

```json
{
    "response": {
        "errorCode": "TOKEN_EXPIRED"
    },
    "message": "Login failed."
}
```

{% endtab %}
{% endtabs %}

### Response Status

***

<mark style="color:green;">**200 Success**</mark>

<details>

<summary><mark style="color:red;"><strong>400 Bad Request Error - Your request is invalid.</strong></mark></summary>

```json
{
  "message": "string",
  "syntaxErrors": {
    "invalidFields": [
      {
        "params": [
          "string"
        ],
        "fieldName": "string",
        "error": "REQUIRED"
      }
    ]
  }
}
```

</details>

<mark style="color:red;">**401 Unauthorized - Your credentials or access token are invalid.**</mark>

<mark style="color:red;">**403 Forbidden - The authentication credentials are not found or are incorrect.**</mark>

<mark style="color:red;">**404 Not found - The requested token couldn't be found.**</mark>

<mark style="color:red;">**410 Gone - The requested token is expired.**</mark>

<mark style="color:red;">**423 Locked - Account is temporarily locked due to failed consecutive login attempts. Try again in 30 minutes.**</mark>

<mark style="color:red;">**429 Too many requests.**</mark>

<mark style="color:red;">**500 Internal Server Error - There is a problem with the server. Please try again later.**</mark>

<mark style="color:red;">**503 Service Unavailable - We're temporarily offline for maintenance. Please try again later.**</mark>
