---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.6
  - property: og:type
    content: article
  - property: article:section
    content: Справочник API
  - property: og:title
    content: Добавить внешнюю связь
  - property: article:tag
    content: Техническая инструкция
alternate:
  - https://yandex.ru/support/tracker/en/api-ref/issues/add-external-link.md
  - https://yandex.ru/support/tracker/ru/api-ref/issues/add-external-link.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.ru/support/tracker/en/llms.txt


# Adding an external link

Use this request to create a link for working with an [external application object](https://yandex.ru/support/tracker/en/external-links.md).

<div class="request_example method_post yfm-clipboard">
    <p>POST</p>
    <pre><code>https://api.tracker.yandex.net/v3/issues/&lt;issue_ID>/remotelinks?backlink=true</code></pre>
    <button class="yfm-clipboard-button"><svg width="16" height="16" viewBox="0 0 24 24" class="yfm-clipboard-icon" data-animation="15">
    <path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path>
    <path stroke="currentColor" fill="transparent" strokewidth="1.5" d="M9.5 13l3 3l5 -5" visibility="hidden">
        <animate id="visibileAnimation-15" attributeName="visibility" from="hidden" to="visible" dur="0.2s" fill="freeze" begin=""></animate>
        <animate id="hideAnimation-15" attributeName="visibility" from="visible" to="hidden" dur="1s" begin="visibileAnimation-15.end+1" fill="freeze"></animate>
    </path>
</svg>
</button>
</div>

<!-- source: en/api-ref/_assets/style/methods.md -->

<!-- endsource: en/api-ref/_assets/style/methods.md -->

## Query format {#rec-format}

Before making a request, [get permission to access the API](https://yandex.ru/support/tracker/en/api-ref/access.md).

To create an external link, use an HTTP `POST` request.

```
POST /v3/issues/<issue_ID>/remotelinks?backlink=true
Host: api.tracker.yandex.net
Authorization: OAuth <OAuth_token>
X-Org-ID or X-Cloud-Org-ID: <organization_ID>

{
    "relationship": "RELATES",
    "key": "<object_key>",
    "origin": "<application_ID>"
}
```


<!-- source: en/api-ref/_includes/headings.md -->
{% cut "Headers" %}

* `Host`: address of the node that provides the API.

* <!-- source: en/api-ref/_includes/authorization.md -->
  `Authorization`: Authorization token about these formats:

    - `OAuth <OAuth_token>`: For authorization using the OAuth 2.0 protocol. [Learn more](https://yandex.ru/support/tracker/en/api-ref/access.md#about_OAuth)

    - `Bearer <IAM_token>`: For authorization using an IAM token, if a Yandex Identity Hub organization is linked to Tracker. [Learn more](https://yandex.ru/support/tracker/en/api-ref/access.md#iam-token)
  <!-- endsource: en/api-ref/_includes/authorization.md -->


* <!-- source: en/api-ref/_includes/org-id.md -->
  `X-Org-ID` or `X-Cloud-Org-ID`: Organization ID.

  - Use the `X-Org-ID` header if a Tracker organization is linked to Yandex 360 for Business.

  - Use the `X-Cloud-Org-ID` header if a Tracker organization is linked to Yandex Identity Hub.

  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/api-ref/_includes/org-id.md -->


{% endcut %}
<!-- endsource: en/api-ref/_includes/headings.md -->

<!-- source: en/api-ref/_includes/resource-issue-id.md -->
{% cut "Resource" %}

| Parameter | Description | Data type |
-------- | -------- | ----------
| \<issue_key_or_ID\> | ID or key of the current issue. | String |

{% endcut %}
<!-- endsource: en/api-ref/_includes/resource-issue-id.md -->

{% cut "Request parameters" %}

**Additional parameters**

| Parameter | Description | Data type |
----- | ----- | -----
| backlink | Set `true` to execute a [request from Tracker, when adding a link, to create a duplicate link in an external application](../../ext-app-setup.md#create). | Boolean |

{% endcut %}

{% cut "Request body parameters" %}

**Required parameters**

| Parameter | Description | Data type |
----- | ----- | -----
| relationship | Link type. We recommend using the value `RELATES`. | String |
| key | Key of the external application object. | String |
| origin | ID of the application whose object you need to create a link to. | String |

{% endcut %}

## Response format {#answer}

{% list tabs %}

- Request executed successfully

  <!-- source: en/api-ref/_includes/answer-201.md -->
  If the request is successful, the API returns a response with code `201 Created`.
  <!-- endsource: en/api-ref/_includes/answer-201.md -->

  The request body contains information about the created link in JSON format.

   ```json
    {
        "self": "https://api.tracker.yandex.net/v3/issues/<issue_ID>/remotelinks/51******",
        "id": 51******,
        "type": {
            "self": "https://api.tracker.yandex.net/v3/linktypes/relates",
            "id": "relates",
            "inward": "Linked",
            "outward": "Linked"
        },
        "direction": "outward",
        "object": {
            "self": "https://api.tracker.yandex.net/v3/applications/ru.yandex.bitbucket/objects/13570010********",
            "id": "13570010********",
            "key": "TEST-17",
            "application": {
                "self": "https://api.tracker.yandex.net/v3/applications/25811000********",
                "id": "25811000********",
                "type": "app",
                "name": "test-app"
            }
        },
        "createdBy": {
            "self": "https://api.tracker.yandex.net/v3/users/11********",
            "id": "11********",
            "display": "display-user-name"
        },
        "updatedBy": {
            "self": "https://api.tracker.yandex.net/v3/users/11********",
            "id": "11********",
            "display": "display-user-name"
        },
        "createdAt": "2021-07-19T06:18:09.327+0000",
        "updatedAt": "2021-07-19T06:18:09.327+0000"
    }

    ```

    {% cut "Response parameters" %}

    | Parameter | Description | Data type |
    ----- | ----- | -----
    | self | Address of the API resource with information about the external link. | String |
    | id | Link ID. | String |
    | [type](#type) | Block with information about the link type. | Map item |
    | direction {#direction} | Link direction. This parameter is relevant for non-symmetric link types, e.g., _Parent issue — Sub-issue_. Possible values:<ul><li>`outward`: The issue specified in the request is the main one for the object.</li><li>`inward`: The object is the main one for the issue specified in the request.</li></ul> | String |
    | [object](#object){#object-param} | Block with information about an external application object. | Map item |
    | [createdBy](#createdBy) | Block with information about the user who created the link. | Map item |
    | [updatedBy](#updatedBy) | Block with information about the employee who updated the link last. | Map item |
    | createdAt | Link creation date and time | String |
    | updatedAt | Date and time when the link was last updated. | String |


    `type` **object fields** {#type}

    | Parameter | Description | Data type |
    ----- | ----- | -----
    | self | Address of the API resource with information about the link type. | String |
    | id | ID of the link type. | String |
    | inward | Link type name depending on the [direction](#direction). | String |
    | outward | Link type name depending on the [direction](#direction). | String |


    `object` **object fields** {#object}

    | Parameter | Description | Data type |
    ----- | ----- | -----
    | self | Address of the API resource with information about the external application object. | String |
    | id | Object ID. | String |
    | key | Object key. | String |
    | [application](#application) | Block with information about the external application. | Map item |

    `application` **object fields** {#application}

    | Parameter | Description | Data type |
    ----- | ----- | -----
    | self | Address of the API resource with information about the external application. | String |
    | id | Application ID. | String |
    | type | Application type. | String |
    | name | Application name displayed. | String |


    `createdBy` **object fields** {#createdBy}

    <!-- source: en/api-ref/_includes/user.md -->
    | Parameter | Description | Data type |
    ----- | ----- | -----
    | self | Address of the API resource with information about the user | String |
    | id | User ID. | String |
    | display | Displayed user name | String |
    | passportUid | Unique ID of the user account in the Yandex 360 for Business organization and Yandex ID. | Number |
    | cloudUid | Unique user ID in Yandex Identity Hub | String |
    <!-- endsource: en/api-ref/_includes/user.md -->


    `updatedBy` **object fields** {#updatedBy}

    <!-- source: en/api-ref/_includes/user.md -->
    | Parameter | Description | Data type |
    ----- | ----- | -----
    | self | Address of the API resource with information about the user | String |
    | id | User ID. | String |
    | display | Displayed user name | String |
    | passportUid | Unique ID of the user account in the Yandex 360 for Business organization and Yandex ID. | Number |
    | cloudUid | Unique user ID in Yandex Identity Hub | String |
    <!-- endsource: en/api-ref/_includes/user.md -->

    {% endcut %}

- Request failed

  If the request is processed incorrectly, the API returns a response with an error code:

    <!-- source: en/api-ref/_includes/answer-error-400.md -->
    400
    :   One or more request parameters have an invalid value.
    <!-- endsource: en/api-ref/_includes/answer-error-400.md -->

    <!-- source: en/api-ref/_includes/answer-error-401.md -->
    401
    :   The user is not authorized. Make sure that actions described in the [API access](https://yandex.ru/support/tracker/en/api-ref/access.md) section are performed.
    <!-- endsource: en/api-ref/_includes/answer-error-401.md -->

    <!-- source: en/api-ref/_includes/answer-error-403.md -->
    403
    :   You are not authorized to perform this action. You can check what rights you have in the Tracker interface. The same rights are required to perform an action via the API and interface.
    <!-- endsource: en/api-ref/_includes/answer-error-403.md -->

    <!-- source: en/api-ref/_includes/answer-error-404.md -->
    404
    :   The requested object was not found. You may have specified an invalid object ID or key.
    <!-- endsource: en/api-ref/_includes/answer-error-404.md -->

{% endlist %}

