---
metadata:
  - name: generator
    content: Diplodoc Platform v5.47.3
  - property: og:type
    content: article
  - property: article:section
    content: API reference
  - property: og:title
    content: API access
  - property: article:tag
    content: Technical instructions
alternate:
  - https://yandex.com.tr/support/tracker/en/api-ref/access.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com.tr/support/tracker/en/llms.txt


# API access


When working with Yandex Tracker API, requests are executed on behalf of a Tracker user. To perform certain actions via the API, the user on whose behalf the request is made must have the appropriate permissions in Tracker. For example, if a user doesn't have permission to change queue settings, the corresponding API requests will be unavailable. For more information about user permissions, see [Roles and permissions](https://yandex.com/support/tracker/role-model.html).


To access Yandex Tracker API, you can use one of the following authentication methods:

* OAuth 2.0 protocol. Used in both Yandex 360 organizations and Yandex Cloud organizations. In this case, specify the following header in requests to Tracker API:

  `Authorization: OAuth <OAuth-token>`

  For more information, see [Get API access via OAuth 2.0 protocol](#about_OAuth).

* Using an IAM token. Available only in Yandex Cloud organizations, including when using [service accounts](https://yandex.cloud/en/docs/iam/concepts/users/service-accounts). In this case, specify the following header in requests to Tracker API:

  `Authorization: Bearer <IAM-token>`

  For more information, see [Get API access via IAM token](#iam-token).


{% note warning "" %}

In addition to the token, you need to specify your organization ID in the request headers. The header format is described in [Headers](https://yandex.com.tr/support/tracker/en/api-ref/common-format.md#headings).

{% endnote %}

   If you use the Python client to call the API, specify the authorization data when initializing the client: [How to use the Python client](#about-python-client).


## Get API access via OAuth 2.0 protocol {#about_OAuth}

{% note warning "" %}

If you use a federated or service account, authenticate using an [IAM token](#iam-token).

{% endnote %}


To get a token:



1. Go to [https://oauth.yandex.com/](https://oauth.yandex.com/).

1. On the **Your applications** page, click <svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" fill="currentColor" aria-hidden="true" class="yc-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 14"><path fill="currentColor" fill-rule="evenodd" d="M7.873 13.125a.875.875 0 1 1-1.75 0V7.87H.875a.875.875 0 0 1 0-1.75h5.248V.874a.875.875 0 1 1 1.75 0V6.12h5.249a.875.875 0 0 1 0 1.751H7.873v5.255z" clip-rule="evenodd"/></svg></svg> **Create**.

1. In the window that opens, select the **For API access or debugging** option and click **Proceed to creation**.

1. Specify the application name and contact email.


1. Add permissions to access user data. To select a permission, start typing its name in the **Access name** field:
   * **Write to tracker (tracker:write)** — all data operations: create, delete, edit.
   * **Read from tracker (tracker:read)** — read-only access to data.

1. Click **Create application**.

1. In the [Yandex OAuth](https://oauth.yandex.com/) personal account, select the previously created application and copy its ID from the **ClientID** field.


1. Generate the token request link:

   ```
   https://oauth.yandex.com/authorize?response_type=token&client_id=<application_id>
   ```

1. Log in to the account on whose behalf you will work with the API and go to the generated link. 

   A sequence of characters will appear on the page — this is the OAuth token. Copy it and save it.



To check if you have access to the API, execute the [request for information about the current user](https://yandex.com.tr/support/tracker/en/api-ref/users/get-user-info.md). If access was not obtained, the request will return a response with code `401 Unauthorized`.

Example request for information about the current user using curl:

<!-- source: en/_includes/api/curl-request.md -->
{% list tabs %}

- Unix

   ```bash
   curl -X GET 'https://api.tracker.yandex.net/v3/myself' \
        -H 'Authorization: OAuth y0__xAbc******' \
        -H 'X-Org-ID: 1234******'
   ```

- Windows

   ```bash
   curl -X GET "https://api.tracker.yandex.net/v3/myself" ^
        -H "Authorization: OAuth y0__xAbc******" ^
        -H "X-Org-ID: 1234******"
   ```

{% endlist %}
<!-- endsource: en/_includes/api/curl-request.md -->


## Get API access via IAM token {#iam-token}

If you use Tracker as part of a Yandex Cloud organization, you can use an IAM token for API authorization.

An IAM token is a unique sequence of characters issued to a user after authentication. Using this token, the user authorizes in Yandex Tracker API and performs operations with resources.

To send requests to the Tracker API on behalf of a service account, first contact [support](https://yandex.com.tr/support/tracker/en/feedback.md) specifying the cloud organization ID and service account ID. Otherwise, API requests will fail with error code `401 Unauthorized`.

For more information about this authentication method, see the [Identity and Access Management service documentation](https://yandex.cloud/en/docs/iam/concepts/authorization/iam-token).

* [How to get an IAM token for a Yandex account](https://yandex.cloud/en/docs/iam/operations/iam-token/create)
* [How to get an IAM token for a service account](https://yandex.cloud/en/docs/iam/operations/iam-token/create-for-sa)
* [How to get an IAM token for a federated account](https://yandex.cloud/en/docs/iam/operations/iam-token/create-for-federation)

{% note info "" %}

An IAM token is valid for no more than 12 hour and is limited by the cookie lifetime of the [federation](https://yandex.cloud/en/docs/organization/concepts/add-federation). After the token expires, an error with code `401 Unauthorized` will be returned.

{% endnote %}



## How to use the Python client {#about-python-client}

When developing applications in Python, you can use the [yandex_tracker_client](https://github.com/yandex/yandex_tracker_client) package — a client that simplifies working with Tracker API.

To start using the client:

1. Download and install the latest version of Python from [https://www.python.org/downloads/](https://www.python.org/downloads/) on your computer.

1. Run the following command in your OS command line:


    ```
    pip install yandex_tracker_client
    ```



1. Get an [OAuth token](#about_OAuth) or [IAM token](#iam-token) for authorization.

1. Find out your organization ID.

    <!-- source: en/_includes/api/org-id.md -->
    To get the organization ID, go to **Administration** → [**Organizations**](https://tracker.yandex.com/admin/orgs) and copy the value from the **ID** field. {#find-id}
    <!-- endsource: en/_includes/api/org-id.md -->

1. Initialize the client in your program code:

   <!-- source: en/_includes/python-init.md -->
   {% list tabs %}

   - For a Yandex 360 for Business organization

       ```
       from yandex_tracker_client import TrackerClient
       client = TrackerClient(token='<OAuth_token>', org_id='<organization_ID>')
       ```
   - For a Yandex Cloud organization

       ```
       from yandex_tracker_client import TrackerClient
       client = TrackerClient(token='<OAuth_token>', cloud_org_id='<organization_ID>')
       ```

   {% endlist %}


   Here, `<OAuth_token>` is your token and `<organization_ID>` is your organization ID.
   <!-- endsource: en/_includes/python-init.md -->

The client uses the same data format as Yandex Tracker API.

To learn more about how the client works and its terms of use, see its page on GitHub: [https://github.com/yandex/yandex_tracker_client](https://github.com/yandex/yandex_tracker_client).


<!-- source: en/_assets/style/image.md -->

<!-- endsource: en/_assets/style/image.md -->
