## Update a view bundle (select/filter/sort arrays are replaced wholesale when supplied) `client.views.update(stringviewID, ViewUpdateParamsparams, RequestOptionsoptions?): ViewUpdateResponse` **patch** `/v2/prism/{teamId}/{viewObjectType}/views/{viewId}` Update a view bundle (select/filter/sort arrays are replaced wholesale when supplied) ### Parameters - `viewID: string` - `params: ViewUpdateParams` - `teamId?: string` Path param - `viewObjectType: "action" | "deal" | "document" | 3 more` Path param - `"action"` - `"deal"` - `"document"` - `"event"` - `"identity"` - `"organization"` - `aggregation_prop_def_id?: string | null` Body param - `aggregation_type?: string | null` Body param - `column_layout?: Record | null` Body param - `combinator?: "AND" | "OR"` Body param - `"AND"` - `"OR"` - `filter?: Array>` Body param - `group_by?: string | null` Body param - `group_hidden_option_ids?: Array | unknown | null` Body param - `Array` - `unknown` - `group_hide_empty?: boolean | null` Body param - `group_sort?: string | null` Body param - `icon?: string | null` Body param - `list_id?: string | null` Body param - `name?: string` Body param - `select?: Array` Body param - `sort?: Array>` Body param - `sort_order?: number | null` Body param - `team_id?: string | null` Body param - `user_id?: string | null` Body param - `view_type?: string` Body param - `idempotencyKey?: string` Header param: A unique key (UUID or any opaque string up to 255 chars) that identifies this logical request. The server caches the first response under this key for 24 hours and replays it on retry — safe to use on every POST/PUT/PATCH to make network retries deterministic. Reusing the same key with a different body returns 409 `idempotency_key_mismatch`. Replays include the `idempotent-replay: true` response header. ### Returns - `ViewUpdateResponse` A view (saved configuration for displaying records of a given object type) plus its select/filter/sort children. Properties in select/filter/sort are referenced by slug. - `name: string` - `view_type: string` - `id?: string` - `aggregation_prop_def_id?: string | null` - `aggregation_type?: string | null` - `column_layout?: Record | null` - `combinator?: "AND" | "OR"` - `"AND"` - `"OR"` - `created_at?: string` - `filter?: Array>` Each entry is { slug: { comparator: value } } - `group_by?: string | null` Property slug to group by - `group_hidden_option_ids?: Array | unknown | null` - `Array` - `unknown` - `group_hide_empty?: boolean | null` - `group_sort?: string | null` - `icon?: string | null` - `list_id?: string | null` - `select?: Array` Property slugs (dot-paths permitted for refs) - `sort?: Array>` Each entry is { slug: 'asc' | 'desc' } - `sort_order?: number | null` - `team_id?: string | null` - `updated_at?: string | null` - `user_id?: string | null` ### Example ```typescript import Micro from '@micro-so/sdk'; const client = new Micro({ teamID: 'My Team ID', apiKey: process.env['MICRO_API_KEY'], // This is the default and can be omitted }); const view = await client.views.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { viewObjectType: 'action', }); console.log(view.id); ``` #### Response ```json { "name": "name", "view_type": "view_type", "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "aggregation_prop_def_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "aggregation_type": "aggregation_type", "column_layout": { "foo": "bar" }, "combinator": "AND", "created_at": "created_at", "filter": [ { "foo": "bar" } ], "group_by": "group_by", "group_hidden_option_ids": [ {} ], "group_hide_empty": true, "group_sort": "group_sort", "icon": "icon", "list_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "select": [ "string" ], "sort": [ { "foo": "bar" } ], "sort_order": 0, "team_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "updated_at": "updated_at", "user_id": "user_id" } ```