---
metadata:
  - name: generator
    content: Diplodoc Platform v5.47.3
alternate:
  - https://yandex.com.tr/support/tracker/en/api-ref/filters/create-filter.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com.tr/support/tracker/en/llms.txt

# Create a filter

The request allows you to create a new issue filter.

<div class="request_example method_post yfm-clipboard">
    <p>POST</p>
    <pre><code>https://api.tracker.yandex.net/v3/filters/</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/_assets/style/methods.md -->

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

## Request format {#query}

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

To create a filter, use an HTTP request with the `POST` method. Specify the parameters in JSON format in the request body:

```json
POST /v3/filters/
Host: api.tracker.yandex.net
Authorization: OAuth y0__xAbc******
Content-Type: application/json
X-Org-ID or X-Cloud-Org-ID: <organization_ID>

{
    "name": "<filter_name>",
    "filter": {
        "status": "open"
    }
}
```

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

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

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

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

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


* <!-- source: en/_includes/api/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 Cloud Organization.

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


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

{% cut "Request body parameters" %}

The request body contains the information required to create a new filter:

**Required parameters**

Parameter | Description | Data type
----- | ----- | -----
name | Filter name. | String

**Additional parameters**

#|
|| **Parameter** | **Description** | **Data type** ||
|| [filter](#filter) | Object with filtering parameters that defines **issue selection conditions** — which issues will be included in the filter results. The object keys are issue field names, and the values are filtering conditions for these fields.

You can find the full list of supported parameters on the [https://tracker.yandex.com/admin/fields](https://tracker.yandex.com/admin/fields) page.

Example values for different field types:
- **Text fields and users:** `"assignee": "me()"`, `"assignee": "userlogin"`, `"createdBy": "username"`
- **Statuses and enumerations:** `"status": "open"` or an array `"status": ["open", "inProgress"]`
- **Dates:** `"created": "2024-01-01..2024-12-31"` (date range) | Object ||
|| query | Filter conditions in the [query language](https://yandex.com/support/tracker/user/query-filter.html) format. | String ||
|| fields | List of issue fields to display in the Tracker UI. For example: `["key", "summary", "status", "assignee", "priority", "created", "updated"]`.

The `fields` parameter only affects the display in the Tracker UI and does not affect the results of API requests. When using a filter via the API (the `/v2/issues/_search` method), issue fields are returned based on the parameters passed when calling the `_search` method. | Array of strings ||
|| [sorts](#sorts) | Array of objects for sorting results. | Array of objects ||
|| groupBy | Field for grouping results. | String or object ||
|| folder | Folder where the filter will be saved. | String or object ||
|#

{% note info %}

You can use either the `query` parameter or the `filter` parameter. Using both parameters simultaneously is not supported.

{% endnote %}

**Fields of the** `sorts` **object** {#sorts}

Parameter | Description | Data type
----- | ----- | -----
field | Key of the issue field to sort by. | String
isAscending | Sort direction: `true` — ascending, `false` — descending. | Boolean

{% endcut %}

> Example 1: Create a filter with multiple conditions
>
> - The HTTP POST method is used.
> - A filter named "My Open Issues" is created.
> - **The `filter` object:** selects issues based on two conditions simultaneously (logical AND):
>   - Status — open issues (`open`)
>   - Assignee — the current user (`me()`)
>
> ```json
> POST /v3/filters/ HTTP/1.1
> Host: api.tracker.yandex.net
> Authorization: OAuth y0__xAbc******
> Content-Type: application/json
> X-Org-ID or X-Cloud-Org-ID: <organization_ID>
>
> {
>     "name": "My Open Issues",
>     "filter": {
>         "status": "open",
>         "assignee": "me()"
>     }
> }
> ```

> Example 2: Create a filter with a condition, sorting, and field selection
>
> - The HTTP POST method is used.
> - A filter named "Open Issues" is created.
> - **The `filter` object:** selects only issues with the `open` status.
> - **The `sorts` parameter:** results are sorted by creation date (newest first).
> - **The `fields` parameter:** only three fields — `key`, `summary`, and `status` — will be displayed in the UI. Other issue fields will be hidden in the interface.
>
> ```json
> POST /v3/filters/ HTTP/1.1
> Host: api.tracker.yandex.net
> Authorization: OAuth y0__xAbc******
> Content-Type: application/json
> X-Org-ID or X-Cloud-Org-ID: <organization_ID>
>
> {
>     "name": "Open Issues",
>     "filter": {
>         "status": "open"
>     },
>     "sorts": [
>         {
>             "field": "created",
>             "isAscending": false
>         }
>     ],
>     "fields": ["key", "summary", "status"]
> }
> ```

## Response format {#answer}

{% list tabs %}

- Request completed successfully

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

    The response body contains information about the created filter in JSON format.

    ```json
    {
        "id": 12345,
        "self": "https://api.tracker.yandex.net/v3/filters/12345",
        "name": "My Open Issues",
        "filter": {
            "assignee": "me()",
            "status": "open"
        },
        "favorite": false,
        "permissions": {
            "READ": {
                "users": [],
                "groups": [
                    {
                        "self": "https://api.tracker.yandex.net/v3/groups/5",
                        "id": "5",
                        "display": "All employees"
                    }
                ],
                "roles": []
            },
            "WRITE": {
                "users": [
                    {
                        "self": "https://api.tracker.yandex.net/v3/users/1234567890",
                        "id": "1234567890",
                        "display": "User Name",
                        "cloudUid": "ajevuhegoiuhfasjhiu",
                        "passportUid": 1234567890
                    }
                ],
                "groups": [],
                "roles": []
            }
        },
        "owner": {
            "self": "https://api.tracker.yandex.net/v3/users/1234567890",
            "id": "1234567890",
            "display": "User Name",
            "cloudUid": "ajevuhegoiuhfasjhiu",
            "passportUid": 1234567890
        }
    }
    ```

    {% cut "Response parameters" %}

    Parameter | Description | Data type
    ----- | ----- | -----
    id | Filter ID. | Number
    self | Address of the API resource that contains information about the filter. | String
    name | Filter name. | String
    [filter](#filter-response) | Object with filtering conditions. | Object
    query | String with filtering conditions written in the query language. | String
    favorite | Favorite filter flag: `true` — the filter is added to favorites, `false` — not added. | Boolean
    [permissions](#permissions) | Object with information about access rights to the filter. | Object
    [owner](#owner) | Object with information about the filter owner. | Object

    **Fields of the** `permissions` **object** {#permissions}

    Parameter | Description | Data type
    ----- | ----- | -----
    [READ](#permission-item) | Object with information about read permissions for the filter. | Object
    [WRITE](#permission-item) | Object with information about edit permissions for the filter. | Object

    **Fields of the** `READ` **and** `WRITE` **objects** {#permission-item}

    Parameter | Description | Data type
    ----- | ----- | -----
    users | Array of users who have the corresponding permissions. | Array of objects
    groups | Array of groups that have the corresponding permissions. | Array of objects
    roles | Array of roles that have the corresponding permissions. | Array of objects

    **Fields of the** `owner` **object** {#owner}

    <!-- source: en/_includes/api/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 Cloud Organization | String |
    <!-- endsource: en/_includes/api/user.md -->

    {% endcut %}

- Request completed with an error

    If the request was not processed successfully, the API returns a response with an error code:

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

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

    <!-- source: en/_includes/api/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/_includes/api/answer-error-403.md -->

{% endlist %}