---
metadata:
  - name: generator
    content: Diplodoc Platform v5.63.0
alternate:
  - en/api-ref/Auth/rpcexchangeServiceAccountToken-post
  - ru/api-ref/Auth/rpcexchangeServiceAccountToken-post
  - href: en/api-ref/Auth/rpcexchangeServiceAccountToken-post.md
    type: text/markdown
    title: Markdown version
csp:
  - script-src:
      - https://mc.yandex.ru
    img-src:
      - https://mc.yandex.ru
    connect-src:
      - https://mc.yandex.ru
      - wss://mc.yandex.ru
    child-src:
      - 'blob:'
      - https://mc.yandex.ru
    frame-src:
      - 'blob:'
      - https://mc.yandex.ru
    frame-ancestors:
      - 'blob:'
      - https://mc.yandex.ru
canonical: en/api-ref/Auth/rpcexchangeServiceAccountToken-post.html
vcsPath: en/api-ref/Auth/rpcexchangeServiceAccountToken-post.md
---
<div class="openapi">

# Exchange service account token

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

Exchanges service account token for DataLens access token.

## 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
http://<хост_on-premises>/rpc/exchangeServiceAccountToken
```

</div>

</div>

</div>

### Headers

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

_x-dl-api-version_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

API version header.

_Const:_{.json-schema-reset .json-schema-value} `2`

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

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "saToken": "example"
}
```

{% endcut %}

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

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

Service account token

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

</div>

## Responses

<div class="openapi__response__code__200">

## 200 OK

Response

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "accessToken": "example"
}
```

{% endcut %}

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

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

Service account access token

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

</div>

</div>

</div>

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