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

<div class="openapi">

# Get an authentication token

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

Gets an authorization token. The format is OAuth 2.0. The token is included in the header of each request as Authorization: Bearer token.

{% note alert %}

The request body must be sent as a single line.

{% cut "Request Example" %}

```
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

client ID

_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

secret

_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

Type of access

_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

Access rights

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

</div>

## Responses

<div class="openapi__response__code__200">

## 200 OK

Successful authentication

<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

Error in the parameters, the response contains a list of validation errors

<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

Error code agreed with Yandex
{.table-cell}
||
||

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

Error message

_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

Internal server errors

<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.