# Авторизация

## Авторизация

<mark style="color:green;">`POST`</mark> `https://api.livesklad.com/auth`

В случае успешной авторизации в ответ придет токен, он будет действителен в течение 15 минут, данный токен должен передаваться в каждом запросе в заголовке:\
**Authorization:** \<token>

#### Request Body

| Name     | Type   | Description |
| -------- | ------ | ----------- |
| login    | string | Логин       |
| password | string | Пароль      |

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

```
{
    token: "PGhXX81XLhkiUm5ua7IsUShqBJiBYroLhG8Y5jjgiY4t2NMrBX6M91x1WXqeKhaA",
    ttl: 900
    remainRequest: 99,
    expireDate: "2022-12-13T09:09:20.861Z"
}
```

{% endtab %}

{% tab title="401 Ошибка авторизации" %}

```json
{
  error: {
    statusCode: 401,
    name: "Error",
    message: "Access denied"
  }
}
```

{% endtab %}

{% tab title="403 Заблокировано" %}

```json
{
  statusCode: 403,
  name: "Error",
  message: "Forbidden",
  expireDate: "2022-12-13T10:02:13.953Z"
}
```

{% endtab %}

{% tab title="429: Too Many Requests Превышен лимит" %}

```json
{
  error: {
    statusCode: 429,
    name: "Error",
    message: "Too Many Requests",
    expireDate: "2022-12-13T09:02:13.953Z"
  }
}
```

{% endtab %}
{% endtabs %}

<details>

<summary>LOGIN_FAILED – где взять логин / пароль для работы с API</summary>

Логин и пароль для работы с API необходимо сформировать в разделе "Настройки / [Доступ к API](https://my.livesklad.com/settings/api)"

<figure><img src="/files/OTdngooi7KsfP6ZWQPQe" alt=""><figcaption></figcaption></figure>

</details>


---

# 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://developer.livesklad.com/api/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.
