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

# Edit a filter

This request allows you to change the parameters of an issue filter.

<div class="request_example method_patch yfm-clipboard">
    <p>PATCH</p>
    <pre><code>https://api.tracker.yandex.net/v3/filters/&lt;filter_id></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 -->

{% note warning %}

When you edit a filter, the `filter` parameter is replaced entirely, not partially updated. To keep the existing filter conditions and add new ones, pass all conditions in the request — both old and new.

{% endnote %}

## Request format {#query}

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

To edit a filter, use an HTTP request with the `PATCH` method. Specify parameters in JSON format in the request body.

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

{
    "name": "<new_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 parameters" %}

**Required parameters**

Parameter | Description | Data type
----- | ----- | -----
\<filter_id\> | Filter ID. | Number

{% endcut %}

{% cut "Request body parameters" %}

A JSON object with the editable filter parameters is passed in the request body.

**Additional parameters**

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

For the full list of supported parameters, see 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 [query language](https://yandex.com/support/tracker/user/query-filter.html) format. | String ||
|| fields | The list of issue fields to display in the Tracker user interface. For example: `["key", "summary", "status", "assignee", "priority", "created", "updated"]`.

The `fields` parameter only affects the display in the Tracker interface; it doesn't affect API request results. When using a filter via the API (the `/v2/issues/_search` method), issue fields are returned based on the parameters passed in the `_search` method call. | Array of strings ||
|| [sorts](#sorts) | An array of objects for sorting results. | Array of objects ||
|| groupBy | The field for grouping results. | String or object ||
|| folder | The 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 at the same time isn't supported.

{% endnote %}

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

Parameter | Description | Data type
----- | ----- | -----
field | The key of the issue field to sort by. | String
isAscending | Sorting order: `true` — ascending, `false` — descending. | Boolean

{% endcut %}

> Example 1: Change the filter name
>
> - The HTTP PATCH method is used.
> - The filter with ID 12345 is edited.
> - Only the `name` parameter (the filter name) is changed.
> - **`filter` object:** not specified, so the filtering conditions remain unchanged.
>
> ```json
> PATCH /v3/filters/12345 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": "New filter name"
> }
> ```

> Example 2: Change filter conditions
>
> - The HTTP PATCH method is used.
> - The filter with ID 12345 is edited.
> - **Goal:** change the filter so that it shows high-priority issues assigned to the current user.
> - **`filter` object:** two new conditions are set:
>   - Priority is critical (`critical`)
>   - Assignee is the current user (`me()`)
> - **Important:** the `filter` parameter replaces conditions completely. All previous filter conditions are removed.
>
> ```json
> PATCH /v3/filters/12345 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>
>
> {
>     "filter": {
>         "priority": "critical",
>         "assignee": "me()"
>     }
> }
> ```

> Example 3: Add sorting by priority
>
> - The HTTP PATCH method is used.
> - The filter with ID 12345 is edited.
> - **Goal:** add sorting by priority (from highest to lowest) to an existing filter.
> - **`sorts` parameter:** sorting results by the `priority` field in descending order (`isAscending: false`) is added.
> - **Note:** this example doesn't specify the `filter` parameter, so the existing filter conditions remain unchanged. Only the sorting is changed.
>
> ```json
> PATCH /v3/filters/12345 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>
>
> {
>     "sorts": [
>         {
>             "field": "priority",
>             "isAscending": false
>         }
>     ]
> }
> ```

## Response format {#answer}

{% list tabs %}

- Request completed successfully

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

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

    ```json
    {
        "id": 12345,
        "self": "https://api.tracker.yandex.net/v3/filters/12345",
        "name": "New filter name",
        "filter": {
            "assignee": "me()",
            "status": "open"
        },
        "sorts": [
            {
                "field": {
                    "self": "https://api.tracker.yandex.net/v3/fields/priority",
                    "id": "priority",
                    "display": "Priority"
                },
                "isAscending": false
            }
        ],
        "favorite": false,
        "permissions": {
            "WRITE": {
                "users": [
                    {
                        "self": "https://api.tracker.yandex.net/v3/users/1234567890",
                        "id": "1234567890",
                        "display": "User Name",
                        "cloudUid": "ajevuhegoiuhfasjhiu",
                        "passportUid": 1234567890
                    }
                ],
                "groups": [],
                "roles": []
            },
            "READ": {
                "users": [],
                "groups": [
                    {
                        "self": "https://api.tracker.yandex.net/v3/groups/5",
                        "id": "5",
                        "display": "All employees"
                    }
                ],
                "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 | The address of the API resource that contains information about the filter. | String
    name | Filter name. | String
    [filter](#filter-response) | An object with filter conditions. | Object
    [sorts](#sorts-response) | An array of objects for sorting results. Returned if sorting is configured for the filter. | Array of objects
    favorite | Favorite filter flag: `true` — the filter is added to favorites, `false` — not added. | Boolean
    [permissions](#permissions) | An object with information about filter access permissions. | Object
    [owner](#owner) | An object with information about the filter owner. | Object

    **Fields of objects in the `sorts` array** {#sorts-response}

    Parameter | Description | Data type
    ----- | ----- | -----
    [field](#sort-field) | An object with information about the field to sort by. | Object
    isAscending | Sorting order: `true` — ascending, `false` — descending. | Boolean

    **Fields of the `field` object** {#sort-field}

    Parameter | Description | Data type
    ----- | ----- | -----
    self | The address of the API resource that contains information about the field. | String
    id | Field ID. | String
    display | Display name of the field. | String

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

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

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

    Parameter | Description | Data type
    ----- | ----- | -----
    users | An array of users with the corresponding permissions. | Array of objects
    groups | An array of groups with the corresponding permissions. | Array of objects
    roles | An array of roles with 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 failed

    If the request wasn't 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 -->

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

{% endlist %}