---
metadata:
  - name: generator
    content: Diplodoc Platform v5.48.2
alternate:
  - https://yandex.com/dev/eda-vendor/doc/ru/ref/Autentifikaciya/partner.auth.post.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/dev/eda-vendor/doc/ru/llms.txt

<div class="openapi">

# Получить токен аутентификации

<!-- markdownlint-disable-file -->

Получает токен авторизации. Формат – OAuth 2.0. Токен передается в заголовке каждого запроса
как `Authorization : Bearer token`.

{% note alert %}

Тело запроса должно быть передано в одну строку.

{% cut "Пример запроса" %}

```
curl -X 'POST' \
'{host}/security/oauth/token' \
-H 'accept: application/json' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'client_id=client_id&client_secret=client_secret&grant_type=client_credentials&scope=read%20write'
```

{% endcut %}

{% endnote %}


## Request

<div class="openapi__requests">

<div class="openapi__request__wrapper" style="--method: var(--dc-openapi-methods-post);margin-bottom: 12px">

<div class="openapi__request">

POST {.openapi__method}
```text translate=no
/security/oauth/token
```

</div>

</div>

</div>

<div class="openapi-entity">

### Body

{% cut "application/x-www-form-urlencoded" %}

```json translate=no
{
  "client_id": "123123123",
  "client_secret": "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
  "grant_type": "client_credentials",
  "scope": "read write"
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_client_id_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Идентификатор клиента

_Example:_{.json-schema-reset .json-schema-example} `client_id`
{.table-cell}
||
||

_client_secret_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Секрет

_Example:_{.json-schema-reset .json-schema-example} `client_secret`
{.table-cell}
||
||

_grant_type_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Тип доступа

_Default:_{.json-schema-reset .json-schema-value} `client_credentials`
{.table-cell}
||
||

_scope_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Права доступа

_Default:_{.json-schema-reset .json-schema-value} `read write`
{.table-cell}
||
|#{.json-schema-properties}

</div>

## Responses

<div class="openapi__response__code__200">

## 200 OK

Успешная аутентификация

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "access_token": "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_access_token_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
|#{.json-schema-properties}

</div>

</div>

<div class="openapi__response__code__400">

## 400 Bad Request

Ошибка в параметрах, в ответе список ошибок валидации

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
[
  {
    "code": 100,
    "description": "Description of error"
  }
]
```

{% endcut %}

**Type**: [ErrorItem](#entity-ErrorItem)[]

</div>

<div class="openapi-entity">

### ErrorItem {#entity-ErrorItem}

#|
|| **Name** | **Description** ||
||

_code_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: integer

Согласованный с Яндекс.Еда числовой код ошибки
{.table-cell}
||
||

_description_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Сообщение об ошибке

_Example:_{.json-schema-reset .json-schema-example} `Description of error`
{.table-cell}
||
|#{.json-schema-properties}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "code": 100,
  "description": "Description of error"
}
```

{% endcut %}

</div>

</div>

<div class="openapi__response__code__500">

## 500 Internal Server Error

Внутренние ошибки сервера

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
[
  {
    "code": 100,
    "description": "Description of error"
  }
]
```

{% endcut %}

**Type**: [ErrorItem](#entity-ErrorItem)[]

</div>

</div>

</div>

[*Deprecated]: No longer supported, please use an alternative and newer version.