---
title: "Update a view"
method: PATCH
path: "/v1/tables/{tableId}/views/{viewId}"
tags: ["Tables"]
---

# Update a view

`PATCH /v1/tables/{tableId}/views/{viewId}`

## Request

- Base URL: `https://api.banksync.io`
- URL: `https://api.banksync.io/v1/tables/{tableId}/views/{viewId}`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer

A compare-and-set on `expectedVersion`: a stale token is a 409 `VIEW_VERSION_CONFLICT`. Another user’s personal view is a 404 `VIEW_NOT_FOUND`, never a 403 that confirms it exists.

## Path parameters

- `tableId` string, required: Table ID
- `viewId` string, required: View ID

## Request body

- object
  - `name` string
  - `icon` string, nullable
  - `query` object
    - `filter` union: A filter tree shared by tables, dashboards and widgets. A clause names a field by key (or one hop through a relation as `relation.field`), an operator, and a value; groups combine clauses with and / or / not.
      - union
        - object
          - `field` string, required: Field key, or `relation.field` for one hop.
          - `op` 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'nin' | 'contains' | 'starts-with' | 'ends-with' | 'between' | 'is-null' | 'is-not-null' | 'matches' | 'has-passed' | 'not-passed', required
          - `value` union
            - union
              - …
            - union
              - …
            - union
              - …
            - union
              - …
            - union
              - …
            - union
              - …
            - union
              - …
            - union
              - …
            - union
              - …
            - union
              - …
          - `security` boolean: Server-bound clause: cannot be dropped by a viewer and is enforced at the data plane.
          - `optional` boolean: Skip the clause (treat as passing) for rows where `field` is absent, as opposed to present-but-null. Default false.
        - object
          - `logic` 'and', required
          - `conditions` FilterNode[], required
          - `field` string, required: Field key, or `relation.field` for one hop.
          - `op` 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'nin' | 'contains' | 'starts-with' | 'ends-with' | 'between' | 'is-null' | 'is-not-null' | 'matches' | 'has-passed' | 'not-passed', required
          - `value` union
            - string
            - number
            - boolean
            - union[]
              - …
            - object: An inclusive date range.
              - …
            - object: An inclusive numeric range.
              - …
            - object: A relative date range, resolved when the query runs.
              - …
            - object: Compare against another field of the same row, by key.
              - …
            - object: Bind to a dashboard filter by id; resolved when the dashboard renders.
              - …
            - object: Bind to a query parameter by name; resolved against the widget bindings.
              - …
          - `security` boolean: Server-bound clause: cannot be dropped by a viewer and is enforced at the data plane.
          - `optional` boolean: Skip the clause (treat as passing) for rows where `field` is absent, as opposed to present-but-null. Default false.
        - object
          - `logic` 'or', required
          - `conditions` FilterNode[], required
          - `field` string, required: Field key, or `relation.field` for one hop.
          - `op` 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'nin' | 'contains' | 'starts-with' | 'ends-with' | 'between' | 'is-null' | 'is-not-null' | 'matches' | 'has-passed' | 'not-passed', required
          - `value` union
            - string
            - number
            - boolean
            - union[]
              - …
            - object: An inclusive date range.
              - …
            - object: An inclusive numeric range.
              - …
            - object: A relative date range, resolved when the query runs.
              - …
            - object: Compare against another field of the same row, by key.
              - …
            - object: Bind to a dashboard filter by id; resolved when the dashboard renders.
              - …
            - object: Bind to a query parameter by name; resolved against the widget bindings.
              - …
          - `security` boolean: Server-bound clause: cannot be dropped by a viewer and is enforced at the data plane.
          - `optional` boolean: Skip the clause (treat as passing) for rows where `field` is absent, as opposed to present-but-null. Default false.
        - object
          - `logic` 'not', required
          - `condition` FilterNode, required (recursive)
          - `field` string, required: Field key, or `relation.field` for one hop.
          - `op` 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'nin' | 'contains' | 'starts-with' | 'ends-with' | 'between' | 'is-null' | 'is-not-null' | 'matches' | 'has-passed' | 'not-passed', required
          - `value` union
            - string
            - number
            - boolean
            - union[]
              - …
            - object: An inclusive date range.
              - …
            - object: An inclusive numeric range.
              - …
            - object: A relative date range, resolved when the query runs.
              - …
            - object: Compare against another field of the same row, by key.
              - …
            - object: Bind to a dashboard filter by id; resolved when the dashboard renders.
              - …
            - object: Bind to a query parameter by name; resolved against the widget bindings.
              - …
          - `security` boolean: Server-bound clause: cannot be dropped by a viewer and is enforced at the data plane.
          - `optional` boolean: Skip the clause (treat as passing) for rows where `field` is absent, as opposed to present-but-null. Default false.
      - union
        - object
          - `field` string, required
          - `op` 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'nin' | 'contains' | 'starts-with' | 'ends-with' | 'between' | 'is-null' | 'is-not-null' | 'matches' | 'has-passed' | 'not-passed', required
          - `value` union
            - string
            - number
            - boolean
            - unknown
            - union[]
              - …
            - object
              - …
            - object
              - …
            - object
              - …
            - object
              - …
            - object
              - …
            - object
              - …
          - `security` boolean
          - `optional` boolean
          - `logic` 'and' | 'or', required
          - `conditions` FilterNode[], required
        - object
          - `logic` 'and', required
          - `conditions` FilterNode[], required
        - object
          - `logic` 'or', required
          - `conditions` FilterNode[], required
      - union
        - object
          - `field` string, required
          - `op` 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'nin' | 'contains' | 'starts-with' | 'ends-with' | 'between' | 'is-null' | 'is-not-null' | 'matches' | 'has-passed' | 'not-passed', required
          - `value` union
            - string
            - number
            - boolean
            - unknown
            - union[]
              - …
            - object
              - …
            - object
              - …
            - object
              - …
            - object
              - …
            - object
              - …
            - object
              - …
          - `security` boolean
          - `optional` boolean
          - `logic` 'not', required
          - `condition` FilterNode, required (recursive)
        - object
          - `logic` 'not', required
          - `condition` FilterNode, required (recursive)
    - `sort` object[]
      - `field` string, required
      - `direction` 'asc' | 'desc', required
    - `group` object[]
      - `field` string, required
      - `direction` 'asc' | 'desc'
      - `hideEmpty` boolean
  - `fields` object
    - `order` string[]
    - `hidden` string[]
    - `widths` object
    - `pins` object
      - `left` string[]
      - `right` string[]
    - `wrap` string[]
  - `calculations` object
  - `decorations` union[]
    - union
      - object
        - `id` string, required
        - `kind` 'condition'
        - `condition` union, required: A filter tree shared by tables, dashboards and widgets. A clause names a field by key (or one hop through a relation as `relation.field`), an operator, and a value; groups combine clauses with and / or / not.
          - union
            - object
              - …
            - object
              - …
            - object
              - …
            - object
              - …
          - union
            - object
              - …
            - object
              - …
            - object
              - …
          - union
            - object
              - …
            - object
              - …
        - `color` 'gray' | 'red' | 'orange' | 'yellow' | 'green' | 'teal' | 'blue' | 'purple' | 'pink' | 'brown', required
        - `style` 'row' | 'stripe'
      - object
        - `id` string, required
        - `kind` 'field', required
        - `field` string, required
        - `style` 'row' | 'stripe'
  - `density` 'comfortable' | 'compact' | 'tight'
  - `toolbar` object
    - `pinned` string[]
  - `layout` union
    - object
      - `layout` 'grid', required
    - object
      - `layout` 'board', required
      - `groupField` string, required
      - `cardFields` string[]
      - `laneOrder` string[]
      - `hideEmptyLanes` boolean
      - `cardSize` 'small' | 'medium' | 'large'
    - object
      - `layout` 'calendar', required
      - `dateField` string, required
      - `endField` string
      - `cardFields` string[]
      - `defaultMode` 'month' | 'week' | 'day'
      - `colorField` string
    - object
      - `layout` 'gallery', required
      - `coverField` string
      - `coverFit` 'cover' | 'contain'
      - `cardFields` string[]
      - `cardSize` 'small' | 'medium' | 'large'
    - object
      - `layout` 'timeline', required
      - `startField` string, required
      - `endField` string
      - `laneField` string
      - `dependencyField` string
      - `cardFields` string[]
      - `zoom` 'day' | 'week' | 'month' | 'quarter'
    - object
      - `layout` 'list', required
      - `cardFields` string[]
    - object
      - `layout` 'form', required
      - `title` string
      - `description` string
      - `fields` object[]
        - `field` string, required
        - `required` boolean
        - `label` string
        - `help` string
      - `submitLabel` string
      - `afterSubmit` 'message' | 'another'
      - `message` string
    - object
      - `layout` 'chart', required
      - `kind` 'bar' | 'column' | 'line' | 'area' | 'donut' | 'number'
      - `x` string
      - `y` object
        - `calculation` 'count_all' | 'count_unique' | 'sum' | 'average' | 'median' | 'min' | 'max'
        - `field` string
      - `series` string
      - `sort` 'value-desc' | 'value-asc' | 'x-asc' | 'x-desc'
      - `limit` integer
      - `stacked` boolean
      - `showValues` boolean
  - `expectedVersion` integer, required

## Response `200`

View updated

- object
  - `success` true, required
  - `data` object, required
    - `id` string, required
    - `workspaceId` string, required
    - `tableId` string, required
    - `name` string, required
    - `icon` string
    - `scope` 'shared' | 'personal', required
    - `ownerUserId` string
    - `query` object, required
      - `filter` union: A filter tree shared by tables, dashboards and widgets. A clause names a field by key (or one hop through a relation as `relation.field`), an operator, and a value; groups combine clauses with and / or / not.
        - union
          - object
            - `field` string, required: Field key, or `relation.field` for one hop.
            - `op` 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'nin' | 'contains' | 'starts-with' | 'ends-with' | 'between' | 'is-null' | 'is-not-null' | 'matches' | 'has-passed' | 'not-passed', required
            - `value` union
              - …
            - `security` boolean: Server-bound clause: cannot be dropped by a viewer and is enforced at the data plane.
            - `optional` boolean: Skip the clause (treat as passing) for rows where `field` is absent, as opposed to present-but-null. Default false.
          - object
            - `logic` 'and', required
            - `conditions` FilterNode[], required
            - `field` string, required: Field key, or `relation.field` for one hop.
            - `op` 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'nin' | 'contains' | 'starts-with' | 'ends-with' | 'between' | 'is-null' | 'is-not-null' | 'matches' | 'has-passed' | 'not-passed', required
            - `value` union
              - …
            - `security` boolean: Server-bound clause: cannot be dropped by a viewer and is enforced at the data plane.
            - `optional` boolean: Skip the clause (treat as passing) for rows where `field` is absent, as opposed to present-but-null. Default false.
          - object
            - `logic` 'or', required
            - `conditions` FilterNode[], required
            - `field` string, required: Field key, or `relation.field` for one hop.
            - `op` 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'nin' | 'contains' | 'starts-with' | 'ends-with' | 'between' | 'is-null' | 'is-not-null' | 'matches' | 'has-passed' | 'not-passed', required
            - `value` union
              - …
            - `security` boolean: Server-bound clause: cannot be dropped by a viewer and is enforced at the data plane.
            - `optional` boolean: Skip the clause (treat as passing) for rows where `field` is absent, as opposed to present-but-null. Default false.
          - object
            - `logic` 'not', required
            - `condition` FilterNode, required (recursive)
            - `field` string, required: Field key, or `relation.field` for one hop.
            - `op` 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'nin' | 'contains' | 'starts-with' | 'ends-with' | 'between' | 'is-null' | 'is-not-null' | 'matches' | 'has-passed' | 'not-passed', required
            - `value` union
              - …
            - `security` boolean: Server-bound clause: cannot be dropped by a viewer and is enforced at the data plane.
            - `optional` boolean: Skip the clause (treat as passing) for rows where `field` is absent, as opposed to present-but-null. Default false.
        - union
          - object
            - `field` string, required
            - `op` 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'nin' | 'contains' | 'starts-with' | 'ends-with' | 'between' | 'is-null' | 'is-not-null' | 'matches' | 'has-passed' | 'not-passed', required
            - `value` union
              - …
            - `security` boolean
            - `optional` boolean
            - `logic` 'and' | 'or', required
            - `conditions` FilterNode[], required
          - object
            - `logic` 'and', required
            - `conditions` FilterNode[], required
          - object
            - `logic` 'or', required
            - `conditions` FilterNode[], required
        - union
          - object
            - `field` string, required
            - `op` 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'nin' | 'contains' | 'starts-with' | 'ends-with' | 'between' | 'is-null' | 'is-not-null' | 'matches' | 'has-passed' | 'not-passed', required
            - `value` union
              - …
            - `security` boolean
            - `optional` boolean
            - `logic` 'not', required
            - `condition` FilterNode, required (recursive)
          - object
            - `logic` 'not', required
            - `condition` FilterNode, required (recursive)
      - `sort` object[]
        - `field` string, required
        - `direction` 'asc' | 'desc', required
      - `group` object[]
        - `field` string, required
        - `direction` 'asc' | 'desc'
        - `hideEmpty` boolean
    - `fields` object, required
      - `order` string[]
      - `hidden` string[]
      - `widths` object
      - `pins` object
        - `left` string[]
        - `right` string[]
      - `wrap` string[]
    - `calculations` object
    - `decorations` union[]
      - union
        - object
          - `id` string, required
          - `kind` 'condition'
          - `condition` union, required: A filter tree shared by tables, dashboards and widgets. A clause names a field by key (or one hop through a relation as `relation.field`), an operator, and a value; groups combine clauses with and / or / not.
            - union
              - …
            - union
              - …
            - union
              - …
          - `color` 'gray' | 'red' | 'orange' | 'yellow' | 'green' | 'teal' | 'blue' | 'purple' | 'pink' | 'brown', required
          - `style` 'row' | 'stripe'
        - object
          - `id` string, required
          - `kind` 'field', required
          - `field` string, required
          - `style` 'row' | 'stripe'
    - `density` 'comfortable' | 'compact' | 'tight'
    - `layout` union, required
      - object
        - `layout` 'grid', required
      - object
        - `layout` 'board', required
        - `groupField` string, required
        - `cardFields` string[]
        - `laneOrder` string[]
        - `hideEmptyLanes` boolean
        - `cardSize` 'small' | 'medium' | 'large'
      - object
        - `layout` 'calendar', required
        - `dateField` string, required
        - `endField` string
        - `cardFields` string[]
        - `defaultMode` 'month' | 'week' | 'day'
        - `colorField` string
      - object
        - `layout` 'gallery', required
        - `coverField` string
        - `coverFit` 'cover' | 'contain'
        - `cardFields` string[]
        - `cardSize` 'small' | 'medium' | 'large'
      - object
        - `layout` 'timeline', required
        - `startField` string, required
        - `endField` string
        - `laneField` string
        - `dependencyField` string
        - `cardFields` string[]
        - `zoom` 'day' | 'week' | 'month' | 'quarter'
      - object
        - `layout` 'list', required
        - `cardFields` string[]
      - object
        - `layout` 'form', required
        - `title` string
        - `description` string
        - `fields` object[]
          - `field` string, required
          - `required` boolean
          - `label` string
          - `help` string
        - `submitLabel` string
        - `afterSubmit` 'message' | 'another'
        - `message` string
      - object
        - `layout` 'chart', required
        - `kind` 'bar' | 'column' | 'line' | 'area' | 'donut' | 'number'
        - `x` string
        - `y` object
          - `calculation` 'count_all' | 'count_unique' | 'sum' | 'average' | 'median' | 'min' | 'max'
          - `field` string
        - `series` string
        - `sort` 'value-desc' | 'value-asc' | 'x-asc' | 'x-desc'
        - `limit` integer
        - `stacked` boolean
        - `showValues` boolean
    - `toolbar` object
      - `pinned` string[]
    - `lock` object
      - `by` union, required
        - object
          - `kind` 'user', required
          - `userId` string, required
        - object
          - `kind` 'sync', required
          - `feedId` string, required
          - `jobId` string
          - `cause` object
            - `automationId` string, required
            - `runId` string, required
            - `depth` integer, required
            - `untrustedSender` true
        - object
          - `kind` 'extractor', required
          - `feedId` string, required
          - `jobId` string
          - `untrustedSender` true
        - object
          - `kind` 'import', required
          - `importId` string, required
          - `userId` string, required
        - object
          - `kind` 'api', required
          - `clientId` string, required
        - object
          - `kind` 'system', required
          - `reason` string, required
        - object
          - `kind` 'automation', required
          - `automationId` string, required
          - `revision` string, required
          - `grantId` string, required
          - `runId` string, required
          - `node` string, required
          - `startedBy` ActorRef, required (recursive)
          - `depth` integer, required
          - `untrustedSender` true
      - `at` string, required
      - `note` string
    - `pinned` boolean
    - `position` integer, required
    - `version` integer, required
    - `createdBy` union, required
      - object
        - `kind` 'user', required
        - `userId` string, required
      - object
        - `kind` 'sync', required
        - `feedId` string, required
        - `jobId` string
        - `cause` object
          - `automationId` string, required
          - `runId` string, required
          - `depth` integer, required
          - `untrustedSender` true
      - object
        - `kind` 'extractor', required
        - `feedId` string, required
        - `jobId` string
        - `untrustedSender` true
      - object
        - `kind` 'import', required
        - `importId` string, required
        - `userId` string, required
      - object
        - `kind` 'api', required
        - `clientId` string, required
      - object
        - `kind` 'system', required
        - `reason` string, required
      - object
        - `kind` 'automation', required
        - `automationId` string, required
        - `revision` string, required
        - `grantId` string, required
        - `runId` string, required
        - `node` string, required
        - `startedBy` ActorRef, required (recursive)
        - `depth` integer, required
        - `untrustedSender` true
    - `createdAt` string, required
    - `updatedAt` string, required
    - `deletedAt` string

## Other responses

- `400`: Validation failed, or a read-only field was written — `code` names the refusal and `details[]` the offending field or cell
- `401`: Unauthorized
- `403`: Forbidden — missing scope, insufficient role, or plan limit reached
- `404`: Not found
- `409`: Conflict — the table is locked, the schema or row version moved, a cell the patch writes was changed by another edit (`ROW_CELL_CONFLICT`, with each cell’s current value in `details`), or a relation accepts one row. `code` says which.

---

[API](https://skmtc.dev/banksync/apis/banksync-api.md) · [All operations](https://skmtc.dev/banksync/apis/banksync-api/llms.txt) · [OpenAPI document](https://skmtc.dev/banksync/apis/banksync-api/revisions/94465f5ee922?raw)
