---
title: "Update View"
method: PATCH
path: "/api/v1/project/{project_id}/views/{view_id}"
tags: ["project"]
---

# Update View

`PATCH /api/v1/project/{project_id}/views/{view_id}`

Update a single view with partial data and atomic ownership validation.

Args:
    project_id: UUID of the project (validated to be owned by current user)
    view_id: String ID of the view to update
    request: Request containing the partial view update data
    view_service: View service for business logic

Returns:
    Response with success status and updated view data

Raises:
    HTTPException: 404 if project/view not found or user doesn't own it,
        409 if ``expected_version`` is stale (the view changed concurrently).

## Path parameters

- `view_id` string, required

## Request body

- ViewUpdateRequest — Request model for updating a single view with partial updates. Attributes: view: Partial view data with only the fields to update expected_version: The view ``version`` the client's edit is based on. When set, the write is compare-and-set: a stale base raises 409 instead of silently overwriting a newer same-view edit.
  - `view` ViewUpdateModel, required — Model for partial view updates - all fields optional except id.
    - `id` string, required
    - `name` string, nullable
    - `description` string, nullable
    - `layerFilters` object, nullable
    - `mapFilters` MapFilterModel — Model for a map filter (spatial filter)
      - `geometries` object[], required
      - `type` 'intersects', required
    - `layerColumnVisibility` object, nullable
    - `layerColumnOrder` object, nullable
    - `layerColumnPinned` object, nullable
    - `layerColumnSort` object, nullable
    - `layerColumnWidths` object, nullable
    - `layerGroupByColumn` object, nullable
    - `layerVisibility` object, nullable
    - `layerViz` object, nullable
    - `basemap` string, nullable
    - `currentLayerId` string, nullable
    - `isEditable` boolean, nullable
    - `showFavoritesOnly` boolean, nullable
  - `expected_version` integer, nullable

## Response `200`

Successful Response

- ViewUpdateResponse — Response model for updating a single view. Attributes: success: Boolean indicating if the update was successful view: The updated view model
  - `success` boolean, required
  - `view` ViewModelOutput, required — Model for a view
    - `id` string, required
    - `name` string, required
    - `description` string, nullable
    - `layerFilters` object
    - `mapFilters` MapFilterModel — Model for a map filter (spatial filter)
      - `geometries` object[], required
      - `type` 'intersects', required
    - `layerColumnVisibility` object
    - `layerColumnOrder` object
    - `layerColumnPinned` object
    - `layerColumnSort` object
    - `layerColumnWidths` object
    - `layerGroupByColumn` object
    - `layerVisibility` object, nullable
    - `layerViz` object, nullable
    - `basemap` string, nullable
    - `currentLayerId` string, nullable
    - `isEditable` boolean, nullable
    - `showFavoritesOnly` boolean
    - `version` integer

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/maia-analytics/apis/maia-api.md) · [All operations](https://skmtc.dev/maia-analytics/apis/maia-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/maia-analytics/maia-api/revisions/0c94a4b5a00e/schema)
