# Login

## Login

<mark style="color:green;">`POST`</mark> `https://professional.signius.eu:8200/api/auth/login`

This request providers you with the user's token, which is needed to futher requests.

#### Headers

| Name          | Type   | Description      |
| ------------- | ------ | ---------------- |
| Content-Type  | String | application/json |
| User-Language | String | Example: en      |

#### Request Body

| Name                                       | Type   | Description   |
| ------------------------------------------ | ------ | ------------- |
| login<mark style="color:red;">\*</mark>    | String | User email    |
| password<mark style="color:red;">\*</mark> | String | User password |

{% tabs %}
{% tab title="400: Bad Request Bad request" %}
{% code title="Example response:" %}

```json
{
    "massage": "<message>"
}
```

{% endcode %}
{% endtab %}

{% tab title="200: OK Login succeded" %}
{% code title="Example response:" %}

```json
{
    "token": "<token>",
    "userId": "<user_id>",
    "identifier": "<email>",
    "status": "ACTIVATED",
    "locale": "pl"
}
```

{% endcode %}
{% endtab %}

{% tab title="200: OK Wrong password" %}
{% code title="Example response:" %}

```json
{
    "exception": "LoginFailedException",
    "code": "400",
    "timestamp": "2023-08-28T06:34:02.569Z",
    "message": "Incorrect login or password"
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Session

<mark style="color:blue;">`GET`</mark> `https://professional.signius.eu:8200/api/auth/session`

Checks if user is logged in.

#### Headers

| Name                                           | Type   | Description        |
| ---------------------------------------------- | ------ | ------------------ |
| X-AUTH-TOKEN<mark style="color:red;">\*</mark> | String | User access token. |

{% tabs %}
{% tab title="401: Unauthorized Unauthorized acces" %}
{% code title="Example response:" %}

```json
{
    "exception": "UnauthorizedAccessException",
    "code": 401,
    "message": "error.no.access",
    "timestamp": "2023-08-28T08:38:20.622Z",
    "status": "UNAUTHORIZED",
    "details": {
        "objectName": "authorization",
        "error": {
            "objectName": "authorization",
            "codes": [
                "error.no.access"
            ],
            "arguments": null,
            "defaultMessage": "error.no.access",
            "code": "error.no.access"
        }
    }
}
```

{% endcode %}
{% endtab %}

{% tab title="200: OK Operation succeded" %}
{% code title="Example response:" %}

```json
{
    "connected": true,
    "api": "signius",
    "locale": "en"
}
```

{% endcode %}
{% endtab %}
{% endtabs %}


---

# 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://docs.signius.eu/api/harmony-api-1/login.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.
