---
metadata:
  - name: generator
    content: Diplodoc Platform v5.54.5
  - property: og:type
    content: article
  - property: article:section
    content: Платформа плагинов
  - property: og:title
    content: Working with the Yandex Tracker API
  - property: article:tag
    content: Техническая инструкция
alternate:
  - https://yandex.com.tr/support/tracker/en/plugins/publicApi.md
  - href: en/plugins/publicApi.md
    type: text/markdown
    title: Markdown version
  - href: ../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com.tr/support/tracker/en/llms.txt


# Working with the Yandex Tracker API

Plugins work with the same public Tracker API that is available to external apps. The entire supported API contract is available through `trackerApi`.

Whether a particular action can be performed via the API depends on the plugin's permissions and on the access rights of the user on whose behalf the requests are made.

To work with the Tracker API, the [SDK](tools/sdk) provides the `trackerApi` object:

```ts
import { trackerApi } from '@weavix/tracker-plugin-sdk-react';

const issue = await trackerApi.v3.get['/issues/{id}']({
  pathParams: { id: 'KEY-1' },
  queryParams: { expand: ['COMMENTS'] },
});
```

For endpoints that accept file uploads, the attachment is placed in the `file` field:

```ts
const atttachment = await trackerApi.v3.post['/attachments']({
  bodyParams: { filename },
  file,
});
```


At the beginning, in square brackets, you specify the path from the [Tracker REST API](https://yandex.com.tr/support/tracker/en/api-ref/about-api.md), followed by the parameters from the REST API.

## API error codes {#error-codes}

When calling methods, the platform may return an error with a code. Constants are exported from the package:

```typescript
import {
  METHOD_NOT_SUPPORTED,
  MISSING_REQUIRED_SCOPE,
  PLUGIN_ID_IS_NOT_CORRECT,
  PLUGIN_ID_OR_SLOT_NOT_PROVIDED,
  UNKNOWN_ERROR,
  VALIDATION_ERROR,
} from '@weavix/tracker-plugin-sdk-react';
```

| Constant | Code | Description |
|-----------|-----|----------|
| `PLUGIN_ID_OR_SLOT_NOT_PROVIDED` | 1000 | Required plugin initialization parameters are missing. |
| `PLUGIN_ID_IS_NOT_CORRECT` | 1001 | Incorrect or mismatched pluginId. |
| `VALIDATION_ERROR` | 1002 | Request validation error. |
| `METHOD_NOT_SUPPORTED` | 1003 | Method is not supported. |
| `MISSING_REQUIRED_SCOPE` | 1004 | Insufficient permissions (scope). |
| `UNKNOWN_ERROR` | 6666 | Unknown error. |
