---
updatedAt: 2026-09-08T20:26:09.000Z
agentTools:
  projectIndex: https://docs.observeinc.com/llms.txt
---

# Update a dataset query filter

Update an existing query filter using JSON Merge Patch semantics

# OpenAPI definition

````json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Observe by Snowflake API",
    "description": "# Overview\nWelcome to the Observe API Docs!\n\nThe Observe API is a RESTful API. POST bodies and responses are typically JSON-encoded.\n\n## Authentication\nRequests to the Observe API are authenticated with an API token. The token can be supplied using HTTP Bearer authentication:\n```\n// passing token as bearer token\ncurl -H \"Authorization: Bearer <customerid> <token>\" https://<customerid>.<observe-domain>.com/v1/...\n```\n",
    "version": "1.0.230307"
  },
  "servers": [
    {
      "url": "https://{customerid}.observeinc.com",
      "description": "US west server",
      "variables": {
        "customerid": {
          "default": "OBSERVE_CUSTOMERID",
          "description": "The customer ID for your instance."
        }
      }
    },
    {
      "url": "https://{customerid}.{cluster}.observeinc.com",
      "description": "Specific regional cluster (prod)",
      "variables": {
        "customerid": {
          "default": "OBSERVE_CUSTOMERID",
          "description": "The customer ID for your instance."
        },
        "cluster": {
          "enum": [
            "eu-1",
            "ap-1"
          ],
          "default": "eu-1",
          "description": "For regional clusters, choose one."
        }
      }
    },
    {
      "url": "https://{customerid}.{domain}.com",
      "description": "Specific Observe server",
      "variables": {
        "customerid": {
          "default": "OBSERVE_CUSTOMERID",
          "description": "The customer ID for your instance."
        },
        "domain": {
          "default": "OBSERVE_DOMAIN",
          "description": "The Observe domain for your instance."
        }
      }
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Dataset Query Filter",
      "x-displayName": "Dataset Query Filter",
      "description": "Manage dataset query filters. Learn more about [dataset query filters](https://docs.observeinc.com/docs/dataset-query-filters).\n"
    }
  ],
  "paths": {
    "/v1/datasets/{datasetId}/query-filters/{id}": {
      "patch": {
        "summary": "Update a dataset query filter",
        "description": "Update an existing query filter using JSON Merge Patch semantics",
        "operationId": "UpdateDatasetQueryFilter",
        "tags": [
          "Dataset Query Filter"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/DatasetIdParam"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the query filter to update",
            "schema": {
              "type": "string",
              "format": "int64"
            },
            "example": "7890123"
          },
          {
            "$ref": "#/components/parameters/ExpandParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DatasetQueryFilter-UpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Dataset query filter updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DatasetQueryFilter-Resource"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse-400"
          },
          "401": {
            "$ref": "#/components/responses/ErrorResponse-401"
          },
          "403": {
            "$ref": "#/components/responses/ErrorResponse-403"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse-404"
          },
          "429": {
            "$ref": "#/components/responses/ErrorResponse-429"
          },
          "5XX": {
            "$ref": "#/components/responses/ErrorResponse-5XX"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "Authorization: Bearer <customerid> <apitoken>\n"
      }
    },
    "schemas": {
      "ObjectId": {
        "type": "string",
        "format": "ObjectId"
      },
      "User": {
        "title": "User",
        "type": "object",
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "title": "User Identifier",
            "$ref": "#/components/schemas/ObjectId"
          },
          "label": {
            "title": "User Label",
            "type": "string"
          },
          "timezone": {
            "type": "string"
          },
          "locale": {
            "type": "string"
          }
        }
      },
      "DatasetQueryFilter-Resource": {
        "title": "DatasetQueryFilter",
        "type": "object",
        "required": [
          "id",
          "label",
          "filter",
          "pipeline",
          "disabled",
          "createdBy",
          "createdAt",
          "updatedBy",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/ObjectId"
          },
          "label": {
            "type": "string",
            "description": "Human-readable name for the filter",
            "minLength": 1,
            "maxLength": 255
          },
          "description": {
            "type": "string",
            "description": "Long-form description of the filter"
          },
          "filter": {
            "type": "string",
            "description": "Legacy OPAL boolean expression string for the filter predicate (without the leading `filter` verb).\n\nDeprecated in favor of `pipeline` and may be removed in a future API version. When creating or updating a filter, clients must provide exactly one of `filter` or `pipeline`.\nAPI responses always include both `filter` and `pipeline`; clients should consume `pipeline`.\n",
            "minLength": 1
          },
          "pipeline": {
            "type": "string",
            "description": "Canonical OPAL pipeline snippet for the filter. May contain only filter verbs (and comments).\n\nWhen creating or updating a filter, clients must provide exactly one of `filter` or `pipeline`.\nAPI responses always include both `filter` and `pipeline`; clients should consume `pipeline`.\n",
            "minLength": 1
          },
          "disabled": {
            "type": "boolean",
            "description": "Whether the filter is disabled by the user"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "List of error messages if the filter has issues (omitted if no errors)"
          },
          "createdBy": {
            "$ref": "#/components/schemas/User",
            "description": "User who created the filter"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the filter was created"
          },
          "updatedBy": {
            "$ref": "#/components/schemas/User",
            "description": "User who last updated the filter"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the filter was last updated"
          },
          "startTime": {
            "type": "string",
            "format": "date-time",
            "description": "Activation window start time (inclusive). If omitted, the filter applies from negative infinity (unbounded from the past)."
          },
          "endTime": {
            "type": "string",
            "format": "date-time",
            "description": "Activation window end time (exclusive). If omitted, the filter applies to positive infinity (unbounded to the future)."
          },
          "layout": {
            "type": "string",
            "description": "UI layout/metadata for the filter builder. This field is used by the Observe UI and should be omitted by other clients."
          }
        }
      },
      "ErrorMessage": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "A stable, machine-readable identifier for the kind of error."
          },
          "message": {
            "type": "string",
            "description": "Error message"
          }
        },
        "required": [
          "type",
          "message"
        ]
      },
      "DatasetQueryFilter-UpdateRequest": {
        "title": "DatasetQueryFilterUpdateRequest",
        "type": "object",
        "properties": {
          "label": {
            "type": "string",
            "description": "Human-readable name for the filter",
            "minLength": 1,
            "maxLength": 255
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Long-form description of the filter"
          },
          "filter": {
            "type": "string",
            "description": "Legacy OPAL boolean expression string for the filter predicate (without the leading `filter` verb).\n\nDeprecated in favor of `pipeline` and may be removed in a future API version. When updating a filter's semantics, a request may provide either `filter` or `pipeline`, but not both.\n",
            "minLength": 1
          },
          "pipeline": {
            "type": "string",
            "description": "Canonical OPAL pipeline snippet for the filter. May contain only filter verbs (and comments).\n\nWhen updating a filter's semantics, a request may provide either `filter` or `pipeline`, but not both. `pipeline` is preferred, as `filter` may be removed in a future API version.\n",
            "minLength": 1
          },
          "disabled": {
            "type": "boolean",
            "description": "Whether the filter is disabled by the user"
          },
          "startTime": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Activation window start time (inclusive). If omitted, the filter applies from negative infinity (unbounded from the past)."
          },
          "endTime": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Activation window end time (exclusive). If omitted, the filter applies to positive infinity (unbounded to the future)."
          },
          "layout": {
            "type": [
              "string",
              "null"
            ],
            "description": "UI layout/metadata for the filter builder. This field is used by the Observe UI and should be omitted by other clients."
          }
        }
      }
    },
    "parameters": {
      "DatasetIdParam": {
        "name": "datasetId",
        "in": "path",
        "required": true,
        "description": "The ID of the dataset",
        "schema": {
          "type": "string",
          "format": "int64"
        }
      },
      "ExpandParam": {
        "name": "expand",
        "in": "query",
        "description": "Whether to expand resources referenced in the response to include additional fields",
        "schema": {
          "type": "boolean"
        }
      }
    },
    "responses": {
      "ErrorResponse-400": {
        "description": "Bad request",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorMessage"
            }
          }
        }
      },
      "ErrorResponse-401": {
        "description": "Unauthorized",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorMessage"
            }
          }
        }
      },
      "ErrorResponse-403": {
        "description": "Forbidden",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorMessage"
            }
          }
        }
      },
      "ErrorResponse-404": {
        "description": "Resource not found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorMessage"
            }
          }
        }
      },
      "ErrorResponse-429": {
        "description": "Rate limit reached",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorMessage"
            }
          }
        }
      },
      "ErrorResponse-5XX": {
        "description": "Internal server error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorMessage"
            }
          }
        }
      }
    }
  }
}
````