# Authorization

## Initialize authorization

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

Starts authorization of user. Sends SMS token to the phone number binded to the user profile.

#### Headers

| Name                                           | Type   | Description                     |
| ---------------------------------------------- | ------ | ------------------------------- |
| X-AUTH-TOKEN<mark style="color:red;">\*</mark> | String | User auth token                 |
| Content-Type                                   | String | application/json; charset=utf-8 |
| User-Language                                  | String | Example: en                     |

{% tabs %}
{% tab title="200: OK Authorization started." %}
{% code title="Example response:" %}

```json
{
    "challengeId": "<id>"
}
```

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

## Authorization

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

Validates the SMS token (OTP).

#### Headers

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

#### Request Body

| Name                                              | Type   | Description                        |
| ------------------------------------------------- | ------ | ---------------------------------- |
| challengeId<mark style="color:red;">\*</mark>     | String | challengeId from initAuthorization |
| challengeResult<mark style="color:red;">\*</mark> | String | SMS token                          |

{% tabs %}
{% tab title="200: OK User authorized" %}
{% code title="Example response:" %}

```json
{
    "validated": <true_or_false>
}
```

{% 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/authorization.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.
