---
title: "Rename a saved view or replace its filters / sort mode"
method: PATCH
path: "/to-do/saved-views/{id}"
tags: ["to-do-saved-views"]
---

# Rename a saved view or replace its filters / sort mode

`PATCH /to-do/saved-views/{id}`

## Request

- Base URL: `https://api.focusbear.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.focusbear.io/to-do/saved-views/{id}`
- Auth: HTTP bearer

## Path parameters

- `id` string, required

## Request body

- UpdateToDoSavedViewDto
  - `name` string
  - `filters` ToDoSavedViewFiltersDto
    - `project_ids` string[]: A task matches if it belongs to any of these projects. Empty or absent = all projects.
    - `energy_level` 'low' | 'full': `low` = perspiration 0–3, `full` = 4–10.
    - `due_date` SavedViewDueDateFilterDto
      - `kind` 'any' | 'preset' | 'custom', required: `any` = no due-date filter.
      - `preset` 'today' | 'thisWeek' | 'nextWeek' | 'next30Days': Required when kind is `preset`, rejected otherwise. Relative: evaluated when the view is applied.
      - `start` string: Only with kind `custom`. Inclusive local calendar day; omit for an open start.
      - `end` string: Only with kind `custom`. Inclusive local calendar day; omit for an open end.
  - `sort_mode` 'SMART' | 'CHRONOLOGICAL' | 'DUE_DATE'

## Response `200`

- ToDoSavedViewResponseDto
  - `id` string, uuid, required
  - `name` string, required
  - `filters` ToDoSavedViewFiltersDto, required
    - `project_ids` string[]: A task matches if it belongs to any of these projects. Empty or absent = all projects.
    - `energy_level` 'low' | 'full': `low` = perspiration 0–3, `full` = 4–10.
    - `due_date` SavedViewDueDateFilterDto
      - `kind` 'any' | 'preset' | 'custom', required: `any` = no due-date filter.
      - `preset` 'today' | 'thisWeek' | 'nextWeek' | 'next30Days': Required when kind is `preset`, rejected otherwise. Relative: evaluated when the view is applied.
      - `start` string: Only with kind `custom`. Inclusive local calendar day; omit for an open start.
      - `end` string: Only with kind `custom`. Inclusive local calendar day; omit for an open end.
  - `sort_mode` 'SMART' | 'CHRONOLOGICAL' | 'DUE_DATE', required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required

## Other responses

- `404`: No saved view with this id belongs to the caller
- `409`: The caller already has a view with this name (case-insensitive); body is { code: "to_do_saved_view_name_taken", message }

---

[API](https://skmtc.dev/focusbear/apis/focusbear-api.md) - [All operations](https://skmtc.dev/focusbear/apis/focusbear-api/llms.txt) - [OpenAPI document](https://skmtc.dev/focusbear/apis/focusbear-api/revisions/3a83a3b9a811?raw)
