# Authorization

## Получение токена доступа

<mark style="color:green;">`POST`</mark> `/api/v1/auth/token/login/`

Эндпоинт используется для получения токена доступа (auth\_token) при авторизации. Токен необходим для выполнения всех дальнейших запросов.&#x20;

**Headers**

| Name         | Value              |
| ------------ | ------------------ |
| Content-Type | `application/json` |

**Body**

| Name                                          | Type   | Description             |
| --------------------------------------------- | ------ | ----------------------- |
| `username` <mark style="color:red;">\*</mark> | string | Ваш логин               |
| `password` <mark style="color:red;">\*</mark> | string | Ваш пароль              |
| `otp_code`                                    | string | ОТП-код для авторизации |

**Response**

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

```json
{
  "auth_token": "828sdh370fdbc52ad25c06cf99107f6d77253110"
}
```

{% endtab %}

{% tab title="400" %}

```json
{
"non_field_errors": [
        "Невозможно войти с предоставленными учетными данными."
    ]
}
```

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