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

# 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`.  This endpoint is for CMD datasets only.

## Query parameters

- `submitted` boolean

## Headers

- `If-Match` string, required

## Request body

- UpdateFilterRequest: A description of a job to generate a customised dataset
  - `filter_id` string: A unique id for this resource
  - `links` FilterLinks: 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
    - `dimensions` object
      - `href` string: A URL to list the dimensions selected for the filter
    - `self` object
      - `href` string: A URL to link to the filter record
  - `dataset` object: A dataset to filter on
    - `version` integer: A version of the dataset to filter on

## Response `200`

The filter job has been updated

- UpdateFilterResponse: A description of a job to generate a customised dataset
  - `filter_id` string: A unique id for this resource
  - `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
    - `dimensions` object
      - `href` string: A URL to list the dimensions selected for the filter
    - `self` object
      - `href` string: A URL to link to the filter record
    - `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
  - `instance_id` string: A unique id for this resource
  - `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
  - `dimensions` DimensionOptions[]: A list of dimensions in the filter job
    - `name` string: The name of the dimension to filter on
    - `options` string[]: A list of options for dimension to filter on a dataset
  - `published` boolean: Indicates if the dataset is published or not

## Other responses

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

---

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