Skip to main content

Saved Views

A saved view is a named bundle of issue filters and sort preferences a user wants to recall later. It backs the “Star this view” / “Open saved view” surface on the issues list — the FE owns the schema of filters_json and sort_json; the server stores the bytes opaquely. Implementation: internal/api/saved_view_handler.go. Backed by the saved_views table.
All endpoints require an authenticated session and workspace context.

Endpoints

Visibility model

Each row is owned by one user but can optionally be shared with the entire workspace via the shared flag. List returns the union:
A view owned by another user but shared is returned read-only — Update and Delete are restricted to the owner (user_id must match the session user, otherwise the handler returns 403 Only the view owner can update/delete it).

View shape

Endpoint reference

CRUD over saved views. Reads return own + shared rows; writes are restricted to the owner.

GET /api/v1/saved-views

List the calling user’s views plus every shared view in the workspace. Defaults pinned to the top, then alphabetical by name. Request: No request body or query parameters. Auth: authenticated session + workspace context. Response: 200 OK — JSON array (never null).

POST /api/v1/saved-views

Create a new saved view owned by the calling user. Auth: authenticated session + workspace context + OWNER, ADMIN, or MANAGER role (requireRole("create")). Request body: is_default is always false on create — promote a view to default with PATCH. Response: 201 Created with the saved view object (same shape as a List entry).

PATCH /api/v1/saved-views/{viewId}

Partial update. Only the owner of the view can update it — Update reads user_id from the row and compares it against the session user. Auth: authenticated session + workspace context + OWNER, ADMIN, or MANAGER role + ownership of the row. Request body: every field optional; only provided keys are written. Response: 200 OK with the full updated view object.

DELETE /api/v1/saved-views/{viewId}

Hard delete. As with PATCH, only the owner can delete. Request: No request body. The {viewId} path parameter identifies the saved view. Auth: authenticated session + ownership of the row. (No role gate beyond ownership — a user can always delete their own view.) Response: 204 No Content.

See also

  • Issues — the list this view filters.
  • User Preferences — adjacent per-user state (UI density, last-opened tabs); preferences are a flat key-value store, saved views are first-class rows because they’re shared.