---
title: "Update a filter"
method: PUT
path: "/filters/{id}"
tags: ["Private"]
---

# Update a filter

`PUT /filters/{id}`

## Request

- Base URL: `/v1` (relative, and the document’s source URL is not known)
- URL: `/v1/filters/{id}`
- Auth: none declared. Required headers: `If-Match`

Update the filter by providing new properties, submit a filter for processing by setting query parameter `submitted` to `true`

## Headers

- `If-Match` string, required

## Request body

- UpdateFilterRequest: A model used to update filters. Dimensions are optional, while downloads and events are for internal use only.
  - `dataset` Dataset: A version of an edition for a dataset to filter on.
    - `id` string: The unique identifier of a dataset
    - `edition` string: An edition of a dataset
    - `version` integer: A version of a dataset
  - `events` Event[]
    - `timestamp` string, string: The time of the event happened
    - `name` string: The type of event which happened
  - `population_type` string: The population type the information is selected from.

## Response `200`

The filter job has been updated

- UpdateFilterResponse: A model for the response body when updating a filter
  - `filter_id` string: id of filter
  - `instance_id` string: id of instance filter is based on
  - `dataset` Dataset: A version of an edition for a dataset to filter on.
    - `id` string: The unique identifier of a dataset
    - `edition` string: An edition of a dataset
    - `version` integer: A version of a dataset
  - `published` boolean: is dataset published or not
  - `disclosure_control` DisclosureControl
    - `status` string: An indicator of the status of the filter query, e.g. OK for no blocked categories, BLOCKED where disclosure rules have been triggered
    - `dimension` string: The name of the dimension that triggers the disclosure rules
    - `blockedoptions` BlockedOptions
      - `blocked_options` string[]: A list of blocked options applicable to the dimension
      - `blocked_count` integer: The count of blocked options
  - `type` string: type of filter(e.g. flexible)
  - `population_type` string: census dataset/blob filter is based on
  - `links` object: A list of links related to this resource
    - `version` object
      - `href` string: A URL to the version being filtered
      - `id` string: An ID of the version being filtered
    - `self` object
      - `href` string: A URL to the filter
      - `id` string: An ID of the version being filtered
    - `dimensions` object
      - `href` string: A URL to the dimensions list
    - `filter_output` object: A link object containing the url to the filter output document, this is only returned once the submitted query parameter is set to true.
      - `href` string: A URL to the filter output document
      - `id` string: An ID of the created filter output document

## Other responses

- `400`: Invalid request body or If-Match header not provided
- `404`: Filter not found
- `409`: #/responses/FilterConflict
- `500`: Failed to process the request due to an internal error

---

[API](https://skmtc.dev/office-of-national-statistics/apis/cantabular-filter-flex-api.md) - [All operations](https://skmtc.dev/office-of-national-statistics/apis/cantabular-filter-flex-api/llms.txt) - [OpenAPI document](https://skmtc.dev/office-of-national-statistics/apis/cantabular-filter-flex-api/revisions/e753ac2d26bd?raw)
