---
title: Patch a saved filter
description: Partially updates a saved filter.
breadcrumbs: ドキュメント > API > Patch a saved filter
---

> For the complete documentation index, see [llms.txt](https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/llms.txt).

# Patch a saved filter

## v2 (latest)

| Datadog site      | API endpoint                                                                             |
| ----------------- | ---------------------------------------------------------------------------------------- |
| app.datadoghq.com | PATCH https://api.datadoghq.com/api/v2/feature-flags/saved-filters/{saved_filter_id}     |
| us3.datadoghq.com | PATCH https://api.us3.datadoghq.com/api/v2/feature-flags/saved-filters/{saved_filter_id} |
| us5.datadoghq.com | PATCH https://api.us5.datadoghq.com/api/v2/feature-flags/saved-filters/{saved_filter_id} |
| app.datadoghq.eu  | PATCH https://api.datadoghq.eu/api/v2/feature-flags/saved-filters/{saved_filter_id}      |
| ap1.datadoghq.com | PATCH https://api.ap1.datadoghq.com/api/v2/feature-flags/saved-filters/{saved_filter_id} |
| ap2.datadoghq.com | PATCH https://api.ap2.datadoghq.com/api/v2/feature-flags/saved-filters/{saved_filter_id} |
| uk1.datadoghq.com | PATCH https://api.uk1.datadoghq.com/api/v2/feature-flags/saved-filters/{saved_filter_id} |
| app.ddog-gov.com  | PATCH https://api.ddog-gov.com/api/v2/feature-flags/saved-filters/{saved_filter_id}      |
| us2.ddog-gov.com  | PATCH https://api.us2.ddog-gov.com/api/v2/feature-flags/saved-filters/{saved_filter_id}  |

### Overview

Partially updates a saved filter. Supports both `LIST` and `RULES` filters.
Supply at least one of `name`, `description`, or `targeting_rules`. Omitted or null fields
are preserved. Supplying `targeting_rules` replaces the entire collection and propagates
changes to every feature flag that references the saved filter.
Metadata-only updates do not require edit permission or approval on those feature flags.
Rule updates require edit permission on all consumer flags and are rejected when approval
is required, unless the caller has the `feature_flag_approvals_override` permission.
The optional `last_updated_at` field detects stale updates. It does not set the update time.

This endpoint requires the `feature_flag_config_write` permission.

OAuth apps require the `feature_flag_config_write` authorization [scope](https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/ja/api/latest/scopes.md#feature-flags) to access this endpoint.

### Arguments

#### Path Parameters

| Field                        | Type   | Description                 |
| ---------------------------- | ------ | --------------------------- |
| saved_filter_id [*required*] | string | The ID of the saved filter. |

### Request

#### Body Data (required)

{% tabs %}
{% tab label="Model" %}
| Parent field    | Field                   | Type      | Description                                                                                                                                                                                                                                                                                                      |
| --------------- | ----------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                 | data [*required*]       | object    | The saved filter fields to update.                                                                                                                                                                                                                                                                               |
| data            | attributes [*required*] | object    | Fields to update. At least one of `name`, `description`, or `targeting_rules` must have a non-null value. Omitted or null fields are preserved. The creation type cannot be changed.                                                                                                                             |
| attributes      | description             | string    | The new description. Send an empty string to clear the description. If omitted or null, the existing description is preserved.                                                                                                                                                                                   |
| attributes      | last_updated_at         | date-time | The `updated_at` value returned by a previous read, as an RFC 3339 timestamp. If it differs from the stored update time, truncated to seconds, the request returns a 409 response. For metadata-only updates, this check does not prevent all concurrent writes. This field alone does not constitute an update. |
| attributes      | name                    | string    | The new name of the saved filter. Must not be empty.                                                                                                                                                                                                                                                             |
| attributes      | targeting_rules         | [object]  | The complete replacement targeting rules, combined with OR. Conditions within each rule are combined with AND. Replaces all existing rules. Values are not appended. Must contain at least one rule. Saved filters cannot reference other saved filters.                                                         |
| targeting_rules | conditions [*required*] | [object]  | Inline conditions combined with AND. Must contain at least one condition.                                                                                                                                                                                                                                        |
| conditions      | attribute [*required*]  | string    | The attribute evaluated by the condition.                                                                                                                                                                                                                                                                        |
| conditions      | operator [*required*]   | enum      | The comparison operator used by a saved filter condition. Allowed enum values: `LT`, `LTE`, `GT`, `GTE`, `MATCHES`, `NOT_MATCHES`, `ONE_OF`, `NOT_ONE_OF`, `IS_NULL`, `EQUALS`, `SEMVER_EQ`, `SEMVER_NEQ`, `SEMVER_LT`, `SEMVER_LTE`, `SEMVER_GT`, `SEMVER_GTE`.                                                 |
| conditions      | value [*required*]      | [string]  | Values used by the condition operator. Values must satisfy the selected operator and the organization targeting limits.                                                                                                                                                                                          |
| data            | type [*required*]       | enum      | The saved filter resource type. Allowed enum values: `saved-filters`.                                                                                                                                                                                                                                            |
{% /tab %}

{% tab label="Example" %}
**Patch a saved filter accepts the current timestamp for metadata**

```json
{
  "data": {
    "attributes": {
      "description": "Metadata with current timestamp.",
      "last_updated_at": "2026-10-16T20:20:29Z"
    },
    "type": "saved-filters"
  }
}
```

**Patch a saved filter accepts the current timestamp for rules**

```json
{
  "data": {
    "attributes": {
      "last_updated_at": "2026-10-16T20:20:30Z",
      "targeting_rules": [
        {
          "conditions": [
            {
              "attribute": "user_id",
              "operator": "ONE_OF",
              "value": [
                "test-user-2"
              ]
            }
          ]
        }
      ]
    },
    "type": "saved-filters"
  }
}
```

**Patch a saved filter clears the description with an empty string**

```json
{
  "data": {
    "type": "saved-filters",
    "attributes": {
      "description": ""
    }
  }
}
```
{% /tab %}
{% /tabs %}

### Response

{% tabs %}
{% tab label="200" %}
OK

{% tabs %}
{% tab label="Model" %}
Response containing a saved filter and its targeting rules.

| Parent field    | Field                        | Type      | Description                                                                                                                                                                                                                                                      |
| --------------- | ---------------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                 | data [*required*]            | object    | A saved filter resource.                                                                                                                                                                                                                                         |
| data            | attributes [*required*]      | object    | Saved filter details, including the full targeting rules and conditions.                                                                                                                                                                                         |
| attributes      | archived_at                  | date-time | The time the saved filter was archived. Omitted when the filter is not archived.                                                                                                                                                                                 |
| attributes      | created_at [*required*]      | date-time | The time the saved filter was created.                                                                                                                                                                                                                           |
| attributes      | created_by [*required*]      | string    | The ID of the user who created the saved filter.                                                                                                                                                                                                                 |
| attributes      | creation_type [*required*]   | enum      | How the saved filter was authored. RULES indicates rule-based authoring and LIST indicates list import. Both types return targeting rules and conditions. Allowed enum values: `RULES`, `LIST`.                                                                  |
| attributes      | description                  | string    | A description of the saved filter. Omitted when no description is set.                                                                                                                                                                                           |
| attributes      | migration_metadata           | any       | Optional JSON metadata supplied by migration tools for tracking the source of a saved filter.                                                                                                                                                                    |
| attributes      | name [*required*]            | string    | The name of the saved filter.                                                                                                                                                                                                                                    |
| attributes      | targeting_rules [*required*] | [object]  | Targeting rules combined with OR. Conditions within each rule are combined with AND. Both saved lists and saved rules use this structure.                                                                                                                        |
| targeting_rules | conditions [*required*]      | [object]  | Conditions combined with AND within this targeting rule.                                                                                                                                                                                                         |
| conditions      | attribute [*required*]       | string    | The attribute evaluated by the condition.                                                                                                                                                                                                                        |
| conditions      | id [*required*]              | uuid      | The ID of the condition.                                                                                                                                                                                                                                         |
| conditions      | operator [*required*]        | enum      | The comparison operator used by a saved filter condition. Allowed enum values: `LT`, `LTE`, `GT`, `GTE`, `MATCHES`, `NOT_MATCHES`, `ONE_OF`, `NOT_ONE_OF`, `IS_NULL`, `EQUALS`, `SEMVER_EQ`, `SEMVER_NEQ`, `SEMVER_LT`, `SEMVER_LTE`, `SEMVER_GT`, `SEMVER_GTE`. |
| conditions      | value [*required*]           | [string]  | Values used by the condition operator.                                                                                                                                                                                                                           |
| targeting_rules | id [*required*]              | uuid      | The ID of the targeting rule.                                                                                                                                                                                                                                    |
| attributes      | updated_at [*required*]      | date-time | The time the saved filter was last updated.                                                                                                                                                                                                                      |
| data            | id [*required*]              | uuid      | The ID of the saved filter.                                                                                                                                                                                                                                      |
| data            | type [*required*]            | enum      | The saved filter resource type. Allowed enum values: `saved-filters`.                                                                                                                                                                                            |
{% /tab %}

{% tab label="Example" %}
```json
{
  "data": {
    "attributes": {
      "archived_at": "2026-01-03T12:00:00Z",
      "created_at": "2026-01-01T12:00:00Z",
      "created_by": "550e8400-e29b-41d4-a716-446655440091",
      "creation_type": "RULES",
      "description": "Users selected by email address or organization ID.",
      "migration_metadata": {
        "provider": "launchdarkly",
        "segment_key": "early-access-users"
      },
      "name": "Early access users",
      "targeting_rules": [
        {
          "conditions": [
            {
              "attribute": "email",
              "id": "550e8400-e29b-41d4-a716-446655440093",
              "operator": "ONE_OF",
              "value": [
                "user@example.com"
              ]
            }
          ],
          "id": "550e8400-e29b-41d4-a716-446655440092"
        }
      ],
      "updated_at": "2026-01-02T12:00:00Z"
    },
    "id": "550e8400-e29b-41d4-a716-446655440090",
    "type": "saved-filters"
  }
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="400" %}
Bad Request

{% tabs %}
{% tab label="Model" %}
API error response.

| Parent field | Field               | Type     | Description                                                                     |
| ------------ | ------------------- | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail              | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                | object   | Non-standard meta-information about the error                                   |
| errors       | source              | object   | References to the source of the error.                                          |
| source       | header              | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter           | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer             | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status              | string   | Status code of the response.                                                    |
| errors       | title               | string   | Short human-readable summary of the error.                                      |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="403" %}
Forbidden

{% tabs %}
{% tab label="Model" %}
An authentication or permission error, or a resource listing consumer flags that the caller cannot edit.

| Parent field | Field                     | Type     | Description                                                                                       |
| ------------ | ------------------------- | -------- | ------------------------------------------------------------------------------------------------- |
|              | Option 1                  | object   | A saved filter authorization error containing at least one error message.                         |
| Option 1     | errors [*required*]       | [string] | The authorization error messages.                                                                 |
|              | Option 2                  | object   | A saved filter error containing at least one JSON:API error object.                               |
| Option 2     | errors [*required*]       | [object] | The error details.                                                                                |
| errors       | detail                    | string   | A human-readable explanation specific to this occurrence of the error.                            |
| errors       | meta                      | object   | Non-standard meta-information about the error                                                     |
| errors       | source                    | object   | References to the source of the error.                                                            |
| source       | header                    | string   | A string indicating the name of a single request header which caused the error.                   |
| source       | parameter                 | string   | A string indicating which URI query parameter caused the error.                                   |
| source       | pointer                   | string   | A JSON pointer to the value in the request document that caused the error.                        |
| errors       | status                    | string   | Status code of the response.                                                                      |
| errors       | title                     | string   | Short human-readable summary of the error.                                                        |
|              | Option 3                  | object   | The caller lacks edit permission on one or more feature flags that reference this saved filter.   |
| Option 3     | data [*required*]         | object   | The caller lacks edit permission on one or more feature flags that reference this saved filter.   |
| data         | attributes [*required*]   | object   | The caller lacks edit permission on one or more feature flags that reference this saved filter.   |
| attributes   | denied_flags [*required*] | [object] | Feature flags preventing this update.                                                             |
| denied_flags | id [*required*]           | uuid     | The ID of the feature flag.                                                                       |
| denied_flags | name [*required*]         | string   | The name of the feature flag.                                                                     |
| attributes   | message [*required*]      | string   | The reason the saved filter update was rejected.                                                  |
| data         | id [*required*]           | uuid     | The ID of the saved filter.                                                                       |
| data         | type [*required*]         | enum     | The resource type for this saved filter update error. Allowed enum values: `update-grace-denied`. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Forbidden",
    "Failed permission authorization checks"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="404" %}
Not Found

{% tabs %}
{% tab label="Model" %}
API error response.

| Parent field | Field               | Type     | Description                                                                     |
| ------------ | ------------------- | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail              | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                | object   | Non-standard meta-information about the error                                   |
| errors       | source              | object   | References to the source of the error.                                          |
| source       | header              | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter           | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer             | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status              | string   | Status code of the response.                                                    |
| errors       | title               | string   | Short human-readable summary of the error.                                      |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="409" %}
Conflict

{% tabs %}
{% tab label="Model" %}
A stale update, duplicate name, or other conflict, or a resource listing consumer flags requiring approval.

| Parent field            | Field                                | Type     | Description                                                                                            |
| ----------------------- | ------------------------------------ | -------- | ------------------------------------------------------------------------------------------------------ |
|                         | Option 1                             | object   | A saved filter error containing at least one JSON:API error object.                                    |
| Option 1                | errors [*required*]                  | [object] | The error details.                                                                                     |
| errors                  | detail                               | string   | A human-readable explanation specific to this occurrence of the error.                                 |
| errors                  | meta                                 | object   | Non-standard meta-information about the error                                                          |
| errors                  | source                               | object   | References to the source of the error.                                                                 |
| source                  | header                               | string   | A string indicating the name of a single request header which caused the error.                        |
| source                  | parameter                            | string   | A string indicating which URI query parameter caused the error.                                        |
| source                  | pointer                              | string   | A JSON pointer to the value in the request document that caused the error.                             |
| errors                  | status                               | string   | Status code of the response.                                                                           |
| errors                  | title                                | string   | Short human-readable summary of the error.                                                             |
|                         | Option 2                             | object   | One or more feature flags that reference this saved filter require approval for the rule update.       |
| Option 2                | data [*required*]                    | object   | One or more feature flags that reference this saved filter require approval for the rule update.       |
| data                    | attributes [*required*]              | object   | One or more feature flags that reference this saved filter require approval for the rule update.       |
| attributes              | approval_required_flags [*required*] | [object] | Feature flags preventing this update.                                                                  |
| approval_required_flags | id [*required*]                      | uuid     | The ID of the feature flag.                                                                            |
| approval_required_flags | name [*required*]                    | string   | The name of the feature flag.                                                                          |
| attributes              | message [*required*]                 | string   | The reason the saved filter update was rejected.                                                       |
| data                    | id [*required*]                      | uuid     | The ID of the saved filter.                                                                            |
| data                    | type [*required*]                    | enum     | The resource type for this saved filter update error. Allowed enum values: `update-approval-conflict`. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="429" %}
Too many requests

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}
{% /tabs %}

### Code Example

{% tabs %}
{% tab label="Curl" %}
```bash
# Path parameters
export saved_filter_id="550e8400-e29b-41d4-a716-446655440090"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.com" # Or us3.datadoghq.com, us5.datadoghq.com, datadoghq.eu, ap1.datadoghq.com, ap2.datadoghq.com, uk1.datadoghq.com, ddog-gov.com, us2.ddog-gov.com
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/feature-flags/saved-filters/${saved_filter_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "description": "Metadata with current timestamp.",
      "last_updated_at": "2026-10-16T20:20:29Z"
    },
    "type": "saved-filters"
  }
}
EOF
```

```bash
# Path parameters
export saved_filter_id="550e8400-e29b-41d4-a716-446655440090"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.com" # Or us3.datadoghq.com, us5.datadoghq.com, datadoghq.eu, ap1.datadoghq.com, ap2.datadoghq.com, uk1.datadoghq.com, ddog-gov.com, us2.ddog-gov.com
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/feature-flags/saved-filters/${saved_filter_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "last_updated_at": "2026-10-16T20:20:30Z",
      "targeting_rules": [
        {
          "conditions": [
            {
              "attribute": "user_id",
              "operator": "ONE_OF",
              "value": [
                "test-user-2"
              ]
            }
          ]
        }
      ]
    },
    "type": "saved-filters"
  }
}
EOF
```

```bash
# Path parameters
export saved_filter_id="550e8400-e29b-41d4-a716-446655440090"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.com" # Or us3.datadoghq.com, us5.datadoghq.com, datadoghq.eu, ap1.datadoghq.com, ap2.datadoghq.com, uk1.datadoghq.com, ddog-gov.com, us2.ddog-gov.com
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/feature-flags/saved-filters/${saved_filter_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "type": "saved-filters",
    "attributes": {
      "description": ""
    }
  }
}
EOF
```
{% /tab %}
{% /tabs %}
