---
title: "Save the current To-do filters as a named view"
method: POST
path: "/to-do/saved-views"
tags: ["to-do-saved-views"]
---

# Save the current To-do filters as a named view

`POST /to-do/saved-views`

## 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`
- Auth: HTTP bearer

## Request body

- CreateToDoSavedViewDto
  - `name` string, required: Trimmed. Unique per user, case-insensitively.
  - `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'

## Response `201`

- 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

- `409`: Body is { code, message }. code is "to_do_saved_view_name_taken" when the caller already has a view with this name (case-insensitive), or "to_do_saved_view_limit_reached" when they already have 100 views; the latter is not retryable with a different name

---

[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)
